@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.
- package/dist/src/auth/credential-provider.d.ts +26 -0
- package/dist/src/auth/credential-provider.js +45 -7
- package/dist/src/errors/errors.js +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +2 -1
- package/dist/src/internal/utils/auth.d.ts +7 -3
- package/dist/src/internal/utils/auth.js +19 -7
- package/dist/src/messages/responses/cache-batch-get.d.ts +18 -51
- package/dist/src/messages/responses/cache-batch-get.js +23 -56
- package/dist/src/messages/responses/cache-batch-set.d.ts +14 -51
- package/dist/src/messages/responses/cache-batch-set.js +12 -42
- package/dist/src/messages/responses/cache-delete.d.ts +11 -44
- package/dist/src/messages/responses/cache-delete.js +14 -35
- package/dist/src/messages/responses/cache-dictionary-fetch.d.ts +18 -54
- package/dist/src/messages/responses/cache-dictionary-fetch.js +23 -46
- package/dist/src/messages/responses/cache-dictionary-get-field.d.ts +19 -58
- package/dist/src/messages/responses/cache-dictionary-get-field.js +19 -52
- package/dist/src/messages/responses/cache-dictionary-get-fields.d.ts +19 -56
- package/dist/src/messages/responses/cache-dictionary-get-fields.js +27 -50
- package/dist/src/messages/responses/cache-dictionary-increment.d.ts +14 -46
- package/dist/src/messages/responses/cache-dictionary-increment.js +14 -41
- package/dist/src/messages/responses/cache-dictionary-length.d.ts +19 -53
- package/dist/src/messages/responses/cache-dictionary-length.js +26 -40
- package/dist/src/messages/responses/cache-dictionary-remove-field.d.ts +10 -43
- package/dist/src/messages/responses/cache-dictionary-remove-field.js +13 -34
- package/dist/src/messages/responses/cache-dictionary-remove-fields.d.ts +10 -43
- package/dist/src/messages/responses/cache-dictionary-remove-fields.js +13 -34
- package/dist/src/messages/responses/cache-dictionary-set-field.d.ts +10 -43
- package/dist/src/messages/responses/cache-dictionary-set-field.js +13 -34
- package/dist/src/messages/responses/cache-dictionary-set-fields.d.ts +10 -43
- package/dist/src/messages/responses/cache-dictionary-set-fields.js +13 -34
- package/dist/src/messages/responses/cache-flush.d.ts +12 -45
- package/dist/src/messages/responses/cache-flush.js +15 -36
- package/dist/src/messages/responses/cache-get.d.ts +19 -54
- package/dist/src/messages/responses/cache-get.js +22 -45
- package/dist/src/messages/responses/cache-increment.d.ts +24 -51
- package/dist/src/messages/responses/cache-increment.js +27 -49
- package/dist/src/messages/responses/cache-item-get-ttl.d.ts +22 -55
- package/dist/src/messages/responses/cache-item-get-ttl.js +27 -41
- package/dist/src/messages/responses/cache-item-get-type.d.ts +22 -55
- package/dist/src/messages/responses/cache-item-get-type.js +27 -41
- package/dist/src/messages/responses/cache-key-exists.d.ts +16 -47
- package/dist/src/messages/responses/cache-key-exists.js +17 -38
- package/dist/src/messages/responses/cache-keys-exist.d.ts +16 -47
- package/dist/src/messages/responses/cache-keys-exist.js +16 -37
- package/dist/src/messages/responses/cache-list-concatenate-back.d.ts +13 -46
- package/dist/src/messages/responses/cache-list-concatenate-back.js +13 -37
- package/dist/src/messages/responses/cache-list-concatenate-front.d.ts +13 -46
- package/dist/src/messages/responses/cache-list-concatenate-front.js +13 -37
- package/dist/src/messages/responses/cache-list-fetch.d.ts +23 -58
- package/dist/src/messages/responses/cache-list-fetch.js +26 -49
- package/dist/src/messages/responses/cache-list-length.d.ts +27 -59
- package/dist/src/messages/responses/cache-list-length.js +32 -42
- package/dist/src/messages/responses/cache-list-pop-back.d.ts +22 -57
- package/dist/src/messages/responses/cache-list-pop-back.js +25 -48
- package/dist/src/messages/responses/cache-list-pop-front.d.ts +22 -57
- package/dist/src/messages/responses/cache-list-pop-front.js +25 -48
- package/dist/src/messages/responses/cache-list-push-back.d.ts +13 -46
- package/dist/src/messages/responses/cache-list-push-back.js +13 -37
- package/dist/src/messages/responses/cache-list-push-front.d.ts +13 -46
- package/dist/src/messages/responses/cache-list-push-front.js +13 -37
- package/dist/src/messages/responses/cache-list-remove-value.d.ts +11 -44
- package/dist/src/messages/responses/cache-list-remove-value.js +14 -35
- package/dist/src/messages/responses/cache-list-retain.d.ts +11 -44
- package/dist/src/messages/responses/cache-list-retain.js +14 -35
- package/dist/src/messages/responses/cache-set-add-element.d.ts +10 -53
- package/dist/src/messages/responses/cache-set-add-element.js +13 -34
- package/dist/src/messages/responses/cache-set-add-elements.d.ts +12 -45
- package/dist/src/messages/responses/cache-set-add-elements.js +17 -38
- package/dist/src/messages/responses/cache-set-fetch.d.ts +18 -54
- package/dist/src/messages/responses/cache-set-fetch.js +23 -46
- package/dist/src/messages/responses/cache-set-if-absent-or-equal.d.ts +15 -55
- package/dist/src/messages/responses/cache-set-if-absent-or-equal.js +21 -41
- package/dist/src/messages/responses/cache-set-if-absent.d.ts +14 -63
- package/dist/src/messages/responses/cache-set-if-absent.js +20 -40
- package/dist/src/messages/responses/cache-set-if-equal.d.ts +15 -55
- package/dist/src/messages/responses/cache-set-if-equal.js +21 -41
- package/dist/src/messages/responses/cache-set-if-not-equal.d.ts +15 -55
- package/dist/src/messages/responses/cache-set-if-not-equal.js +21 -41
- package/dist/src/messages/responses/cache-set-if-not-exists.d.ts +14 -54
- package/dist/src/messages/responses/cache-set-if-not-exists.js +20 -40
- package/dist/src/messages/responses/cache-set-if-present-and-not-equal.d.ts +15 -55
- package/dist/src/messages/responses/cache-set-if-present-and-not-equal.js +21 -41
- package/dist/src/messages/responses/cache-set-if-present.d.ts +15 -55
- package/dist/src/messages/responses/cache-set-if-present.js +21 -41
- package/dist/src/messages/responses/cache-set-remove-element.d.ts +10 -43
- package/dist/src/messages/responses/cache-set-remove-element.js +13 -34
- package/dist/src/messages/responses/cache-set-remove-elements.d.ts +13 -46
- package/dist/src/messages/responses/cache-set-remove-elements.js +13 -34
- package/dist/src/messages/responses/cache-set-sample.d.ts +18 -54
- package/dist/src/messages/responses/cache-set-sample.js +23 -46
- package/dist/src/messages/responses/cache-set.d.ts +10 -43
- package/dist/src/messages/responses/cache-set.js +13 -34
- package/dist/src/messages/responses/cache-sorted-set-fetch.js +1 -1
- package/dist/src/messages/responses/cache-sorted-set-get-score.d.ts +6 -1
- package/dist/src/messages/responses/cache-sorted-set-get-score.js +1 -1
- package/dist/src/messages/responses/cache-sorted-set-get-scores.js +1 -1
- package/dist/src/messages/responses/cache-sorted-set-increment-score.js +1 -1
- package/dist/src/messages/responses/cache-ttl-decrease.d.ts +19 -53
- package/dist/src/messages/responses/cache-ttl-decrease.js +29 -39
- package/dist/src/messages/responses/cache-ttl-increase.d.ts +19 -53
- package/dist/src/messages/responses/cache-ttl-increase.js +29 -39
- package/dist/src/messages/responses/cache-ttl-update.d.ts +15 -55
- package/dist/src/messages/responses/cache-ttl-update.js +21 -41
- package/dist/src/messages/responses/create-cache.d.ts +15 -58
- package/dist/src/messages/responses/create-cache.js +21 -39
- package/dist/src/messages/responses/delete-cache.d.ts +11 -44
- package/dist/src/messages/responses/delete-cache.js +14 -35
- package/dist/src/messages/responses/enums/auth/generate-api-key.d.ts +4 -0
- package/dist/src/messages/responses/enums/auth/generate-api-key.js +9 -0
- package/dist/src/messages/responses/enums/auth/generate-disposable-token.d.ts +4 -0
- package/dist/src/messages/responses/enums/auth/generate-disposable-token.js +9 -0
- package/dist/src/messages/responses/enums/auth/index.d.ts +3 -0
- package/dist/src/messages/responses/enums/auth/index.js +10 -0
- package/dist/src/messages/responses/enums/auth/refresh-api-key.d.ts +4 -0
- package/dist/src/messages/responses/enums/auth/refresh-api-key.js +9 -0
- package/dist/src/messages/responses/enums/cache/control/index.d.ts +17 -0
- package/dist/src/messages/responses/enums/cache/control/index.js +25 -0
- package/dist/src/messages/responses/enums/cache/dictionary/index.d.ts +40 -0
- package/dist/src/messages/responses/enums/cache/dictionary/index.js +53 -0
- package/dist/src/messages/responses/enums/cache/index.d.ts +5 -0
- package/dist/src/messages/responses/enums/cache/index.js +22 -0
- package/dist/src/messages/responses/enums/cache/list/index.d.ts +44 -0
- package/dist/src/messages/responses/enums/cache/list/index.js +58 -0
- package/dist/src/messages/responses/enums/cache/scalar/index.d.ts +95 -0
- package/dist/src/messages/responses/enums/cache/scalar/index.js +122 -0
- package/dist/src/messages/responses/enums/cache/set/index.d.ts +26 -0
- package/dist/src/messages/responses/enums/cache/set/index.js +36 -0
- package/dist/src/messages/responses/enums/index.d.ts +4 -0
- package/dist/src/messages/responses/enums/index.js +21 -0
- package/dist/src/messages/responses/enums/leaderboard/index.d.ts +20 -0
- package/dist/src/messages/responses/enums/leaderboard/index.js +29 -0
- package/dist/src/messages/responses/enums/topics/index.d.ts +8 -0
- package/dist/src/messages/responses/enums/topics/index.js +14 -0
- package/dist/src/messages/responses/generate-api-key.d.ts +10 -27
- package/dist/src/messages/responses/generate-api-key.js +10 -18
- package/dist/src/messages/responses/generate-disposable-token.d.ts +10 -27
- package/dist/src/messages/responses/generate-disposable-token.js +10 -18
- package/dist/src/messages/responses/leaderboard/leaderboard-delete.d.ts +10 -43
- package/dist/src/messages/responses/leaderboard/leaderboard-delete.js +13 -34
- package/dist/src/messages/responses/leaderboard/leaderboard-fetch.d.ts +12 -45
- package/dist/src/messages/responses/leaderboard/leaderboard-fetch.js +11 -35
- package/dist/src/messages/responses/leaderboard/leaderboard-length.d.ts +12 -45
- package/dist/src/messages/responses/leaderboard/leaderboard-length.js +11 -35
- package/dist/src/messages/responses/leaderboard/leaderboard-remove-elements.d.ts +10 -43
- package/dist/src/messages/responses/leaderboard/leaderboard-remove-elements.js +13 -34
- package/dist/src/messages/responses/leaderboard/leaderboard-upsert.d.ts +11 -44
- package/dist/src/messages/responses/leaderboard/leaderboard-upsert.js +14 -35
- package/dist/src/messages/responses/list-caches.d.ts +13 -46
- package/dist/src/messages/responses/list-caches.js +11 -35
- package/dist/src/messages/responses/refresh-api-key.d.ts +10 -27
- package/dist/src/messages/responses/refresh-api-key.js +10 -18
- package/dist/src/messages/responses/response-base.d.ts +20 -0
- package/dist/src/messages/responses/response-base.js +42 -2
- package/dist/src/messages/responses/topic-publish.d.ts +10 -43
- package/dist/src/messages/responses/topic-publish.js +13 -34
- package/dist/src/messages/responses/topic-subscribe.d.ts +10 -37
- package/dist/src/messages/responses/topic-subscribe.js +10 -33
- package/dist/src/messages/responses/webhook/put-webhook.d.ts +1 -10
- package/package.json +1 -1
@@ -1,43 +1,18 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Error = exports.Success =
|
3
|
+
exports.Error = exports.Success = void 0;
|
4
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
|
-
}
|
5
|
+
const enums_1 = require("./enums");
|
29
6
|
/**
|
30
7
|
* Indicates a Successful cache set request.
|
31
8
|
*/
|
32
|
-
class Success extends
|
33
|
-
|
34
|
-
|
35
|
-
|
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.TopicPublishResponse.Success;
|
39
13
|
}
|
40
14
|
}
|
15
|
+
exports.Success = Success;
|
41
16
|
/**
|
42
17
|
* Indicates that an error occurred during the cache set 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
|
26
|
+
class Error extends response_base_1.BaseResponseError {
|
27
|
+
constructor(_innerException) {
|
28
|
+
super(_innerException);
|
29
|
+
this.type = enums_1.TopicPublishResponse.Error;
|
30
|
+
}
|
52
31
|
}
|
53
32
|
exports.Error = Error;
|
54
|
-
//# sourceMappingURL=data:application/json;base64,
|
33
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9waWMtcHVibGlzaC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9tZXNzYWdlcy9yZXNwb25zZXMvdG9waWMtcHVibGlzaC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFDQSxtREFBdUU7QUFDdkUsbUNBQTZDO0FBTTdDOztHQUVHO0FBQ0gsTUFBYSxPQUFRLFNBQVEsbUNBQW1CO0lBQWhEOztRQUNXLFNBQUksR0FBaUMsNEJBQW9CLENBQUMsT0FBTyxDQUFDO0lBQzdFLENBQUM7Q0FBQTtBQUZELDBCQUVDO0FBRUQ7Ozs7Ozs7OztHQVNHO0FBQ0gsTUFBYSxLQUFNLFNBQVEsaUNBQWlCO0lBRTFDLFlBQVksZUFBeUI7UUFDbkMsS0FBSyxDQUFDLGVBQWUsQ0FBQyxDQUFDO1FBRmhCLFNBQUksR0FBK0IsNEJBQW9CLENBQUMsS0FBSyxDQUFDO0lBR3ZFLENBQUM7Q0FDRjtBQUxELHNCQUtDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtTZGtFcnJvcn0gZnJvbSAnLi4vLi4vZXJyb3JzJztcbmltcG9ydCB7QmFzZVJlc3BvbnNlRXJyb3IsIEJhc2VSZXNwb25zZVN1Y2Nlc3N9IGZyb20gJy4v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uICovXG5leHBvcnQgY2xhc3MgRXJyb3IgZXh0ZW5kcyBCYXNlUmVzcG9uc2VFcnJvciBpbXBsZW1lbnRzIElSZXNwb25zZSB7XG4gIHJlYWRvbmx5IHR5cGU6IFRvcGljUHVibGlzaFJlc3BvbnNlLkVycm9yID0gVG9waWNQdWJsaXNoUmVzcG9uc2UuRXJyb3I7XG4gIGNvbnN0cnVjdG9yKF9pbm5lckV4Y2VwdGlvbjogU2RrRXJyb3IpIHtcbiAgICBzdXBlcihfaW5uZXJFeGNlcHRpb24pO1xuICB9XG59XG5cbmV4cG9ydCB0eXBlIFJlc3BvbnNlID0gU3VjY2VzcyB8IEVycm9yO1xuIl19
|
@@ -1,27 +1,9 @@
|
|
1
1
|
import { SdkError } from '../../errors';
|
2
|
-
import {
|
2
|
+
import { BaseResponseError, BaseResponseSubscription } from './response-base';
|
3
3
|
import { SubscriptionState } from '../../internal/subscription-state';
|
4
|
-
|
5
|
-
|
6
|
-
|
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 {
|
4
|
+
import { TopicSubscribeResponse } from './enums';
|
5
|
+
interface IResponse {
|
6
|
+
readonly type: TopicSubscribeResponse;
|
25
7
|
}
|
26
8
|
/**
|
27
9
|
* Encapsulates a topic subscription.
|
@@ -30,8 +12,9 @@ export declare abstract class Response extends ResponseBase {
|
|
30
12
|
* In the future, this may be extended to include additional
|
31
13
|
* statistics about the subscription.
|
32
14
|
*/
|
33
|
-
export declare class Subscription extends
|
15
|
+
export declare class Subscription extends BaseResponseSubscription implements IResponse {
|
34
16
|
private subscriptionState;
|
17
|
+
readonly type: TopicSubscribeResponse.Subscription;
|
35
18
|
constructor(subscriptionState: SubscriptionState);
|
36
19
|
/**
|
37
20
|
* Unsubscribes from the topic.
|
@@ -41,19 +24,6 @@ export declare class Subscription extends Response {
|
|
41
24
|
unsubscribe(): void;
|
42
25
|
get isSubscribed(): boolean;
|
43
26
|
}
|
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").MomentoErrorCode;
|
54
|
-
toString(): string;
|
55
|
-
};
|
56
|
-
} & typeof _Error;
|
57
27
|
/**
|
58
28
|
* Indicates that an error occurred during the topic subscribe request.
|
59
29
|
*
|
@@ -64,6 +34,9 @@ declare const Error_base: {
|
|
64
34
|
* - `message()` - a human-readable description of the error
|
65
35
|
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
66
36
|
*/
|
67
|
-
export declare class Error extends
|
37
|
+
export declare class Error extends BaseResponseError implements IResponse {
|
38
|
+
readonly type: TopicSubscribeResponse.Error;
|
39
|
+
constructor(_innerException: SdkError);
|
68
40
|
}
|
41
|
+
export type Response = Subscription | Error;
|
69
42
|
export {};
|
@@ -1,30 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Error = exports.Subscription =
|
3
|
+
exports.Error = exports.Subscription = void 0;
|
4
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;
|
5
|
+
const enums_1 = require("./enums");
|
28
6
|
/**
|
29
7
|
* Encapsulates a topic subscription.
|
30
8
|
*
|
@@ -32,9 +10,10 @@ exports.Response = Response;
|
|
32
10
|
* In the future, this may be extended to include additional
|
33
11
|
* statistics about the subscription.
|
34
12
|
*/
|
35
|
-
class Subscription extends
|
13
|
+
class Subscription extends response_base_1.BaseResponseSubscription {
|
36
14
|
constructor(subscriptionState) {
|
37
15
|
super();
|
16
|
+
this.type = enums_1.TopicSubscribeResponse.Subscription;
|
38
17
|
this.subscriptionState = subscriptionState;
|
39
18
|
}
|
40
19
|
/**
|
@@ -50,12 +29,6 @@ class Subscription extends Response {
|
|
50
29
|
}
|
51
30
|
}
|
52
31
|
exports.Subscription = Subscription;
|
53
|
-
class _Error extends Response {
|
54
|
-
constructor(_innerException) {
|
55
|
-
super();
|
56
|
-
this._innerException = _innerException;
|
57
|
-
}
|
58
|
-
}
|
59
32
|
/**
|
60
33
|
* Indicates that an error occurred during the topic subscribe request.
|
61
34
|
*
|
@@ -66,7 +39,11 @@ class _Error extends Response {
|
|
66
39
|
* - `message()` - a human-readable description of the error
|
67
40
|
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
68
41
|
*/
|
69
|
-
class Error extends
|
42
|
+
class Error extends response_base_1.BaseResponseError {
|
43
|
+
constructor(_innerException) {
|
44
|
+
super(_innerException);
|
45
|
+
this.type = enums_1.TopicSubscribeResponse.Error;
|
46
|
+
}
|
70
47
|
}
|
71
48
|
exports.Error = Error;
|
72
|
-
//# sourceMappingURL=data:application/json;base64,
|
49
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9waWMtc3Vic2NyaWJlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL21lc3NhZ2VzL3Jlc3BvbnNlcy90b3BpYy1zdWJzY3JpYmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EsbURBQTRFO0FBRTVFLG1DQUErQztBQU0vQzs7Ozs7O0dBTUc7QUFDSCxNQUFhLFlBQ1gsU0FBUSx3Q0FBd0I7SUFPaEMsWUFBWSxpQkFBb0M7UUFDOUMsS0FBSyxFQUFFLENBQUM7UUFKRCxTQUFJLEdBQ1gsOEJBQXNCLENBQUMsWUFBWSxDQUFDO1FBSXBDLElBQUksQ0FBQyxpQkFBaUIsR0FBRyxpQkFBaUIsQ0FBQztJQUM3QyxDQUFDO0lBRUQ7Ozs7T0FJRztJQUNJLFdBQVc7UUFDaEIsSUFBSSxDQUFDLGlCQUFpQixDQUFDLFdBQVcsRUFBRSxDQUFDO0lBQ3ZDLENBQUM7SUFFRCxJQUFXLFlBQVk7UUFDckIsT0FBTyxJQUFJLENBQUMsaUJBQWlCLENBQUMsWUFBWSxDQUFDO0lBQzdDLENBQUM7Q0FDRjtBQXpCRCxvQ0F5QkM7QUFFRDs7Ozs7Ozs7O0dBU0c7QUFDSCxNQUFhLEtBQU0sU0FBUSxpQ0FBaUI7SUFFMUMsWUFBWSxlQUF5QjtRQUNuQyxLQUFLLENBQUMsZUFBZSxDQUFDLENBQUM7UUFGaEIsU0FBSSxHQUFpQyw4QkFBc0IsQ0FBQyxLQUFLLENBQUM7SUFHM0UsQ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2F1c2VkIHRoZSBmYWlsdXJlOyBjYW4gYmUgcmUtdGhyb3duLlxuICovXG5leHBvcnQgY2xhc3MgRXJyb3IgZXh0ZW5kcyBCYXNlUmVzcG9uc2VFcnJvciBpbXBsZW1lbnRzIElSZXNwb25zZSB7XG4gIHJlYWRvbmx5IHR5cGU6IFRvcGljU3Vic2NyaWJlUmVzcG9uc2UuRXJyb3IgPSBUb3BpY1N1YnNjcmliZVJlc3BvbnNlLkVycm9yO1xuICBjb25zdHJ1Y3RvcihfaW5uZXJFeGNlcHRpb246IFNka0Vycm9yKSB7XG4gICAgc3VwZXIoX2lubmVyRXhjZXB0aW9uKTtcbiAgfVxufVxuXG5leHBvcnQgdHlwZSBSZXNwb25zZSA9IFN1YnNjcmlwdGlvbiB8IEVycm9yO1xuIl19
|
@@ -45,16 +45,7 @@ declare const Error_base: {
|
|
45
45
|
_innerException: SdkError;
|
46
46
|
message(): string;
|
47
47
|
innerException(): SdkError;
|
48
|
-
errorCode(): import("../../../errors").MomentoErrorCode;
|
49
|
-
* Indicates that an error occurred during the PutWebhook request.
|
50
|
-
*
|
51
|
-
* This response object includes the following fields that you can use to determine
|
52
|
-
* how you would like to handle the error:
|
53
|
-
*
|
54
|
-
* - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
|
55
|
-
* - `message()` - a human-readable description of the error
|
56
|
-
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
57
|
-
*/
|
48
|
+
errorCode(): import("../../../errors").MomentoErrorCode;
|
58
49
|
toString(): string;
|
59
50
|
};
|
60
51
|
} & typeof _Error;
|