@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,55 +1,32 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Error = exports.Miss = exports.Hit =
|
3
|
+
exports.Error = exports.Miss = exports.Hit = void 0;
|
4
4
|
const response_base_1 = require("./response-base");
|
5
5
|
const utils_1 = require("../../internal/utils");
|
6
|
+
const enums_1 = require("./enums");
|
6
7
|
const TEXT_DECODER = new TextDecoder();
|
7
8
|
/**
|
8
|
-
*
|
9
|
-
*
|
10
|
-
* the following subtypes:
|
11
|
-
*
|
12
|
-
* - {Hit}
|
13
|
-
* - {Miss}
|
14
|
-
* - {Error}
|
15
|
-
*
|
16
|
-
* `instanceof` type guards can be used to operate on the appropriate subtype.
|
17
|
-
* @example
|
18
|
-
* For example:
|
19
|
-
* ```
|
20
|
-
* if (response instanceof CacheListPopFront.Error) {
|
21
|
-
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
22
|
-
* // `CacheListPopFront.Error` in this block, so you will have access to the properties
|
23
|
-
* // of the Error class; e.g. `response.errorCode()`.
|
24
|
-
* }
|
25
|
-
* ```
|
9
|
+
* Indicates a successful list pop front request.
|
10
|
+
* Provides `value*` accessors to retrieve the data in the appropriate format.
|
26
11
|
*/
|
27
|
-
class
|
28
|
-
value() {
|
29
|
-
if (this instanceof Hit) {
|
30
|
-
return this.value();
|
31
|
-
}
|
32
|
-
return undefined;
|
33
|
-
}
|
34
|
-
}
|
35
|
-
exports.Response = Response;
|
36
|
-
class _Hit extends Response {
|
12
|
+
class Hit extends response_base_1.ResponseBase {
|
37
13
|
constructor(body) {
|
38
14
|
super();
|
15
|
+
this.type = enums_1.CacheListPopFrontResponse.Hit;
|
39
16
|
this.body = body;
|
40
17
|
}
|
41
18
|
/**
|
42
19
|
* Returns the data as a utf-8 string, decoded from the underlying byte array.
|
43
20
|
* @returns string
|
44
21
|
*/
|
45
|
-
|
22
|
+
value() {
|
46
23
|
return TEXT_DECODER.decode(this.body);
|
47
24
|
}
|
48
25
|
/**
|
49
26
|
* Returns the data as a utf-8 string, decoded from the underlying byte array.
|
50
27
|
* @returns string
|
51
28
|
*/
|
52
|
-
|
29
|
+
valueString() {
|
53
30
|
return TEXT_DECODER.decode(this.body);
|
54
31
|
}
|
55
32
|
/**
|
@@ -64,27 +41,20 @@ class _Hit extends Response {
|
|
64
41
|
return `${super.toString()}: ${display}`;
|
65
42
|
}
|
66
43
|
}
|
67
|
-
/**
|
68
|
-
* Indicates that the requested data was successfully retrieved from the cache. Provides
|
69
|
-
* `value*` accessors to retrieve the data in the appropriate format.
|
70
|
-
*/
|
71
|
-
class Hit extends (0, response_base_1.ResponseHit)(_Hit) {
|
72
|
-
}
|
73
44
|
exports.Hit = Hit;
|
74
|
-
class _Miss extends Response {
|
75
|
-
}
|
76
45
|
/**
|
77
|
-
* Indicates that the requested
|
46
|
+
* Indicates that the requested list was not available in the cache.
|
78
47
|
*/
|
79
|
-
class Miss extends
|
80
|
-
|
81
|
-
exports.Miss = Miss;
|
82
|
-
class _Error extends Response {
|
83
|
-
constructor(_innerException) {
|
48
|
+
class Miss extends response_base_1.BaseResponseMiss {
|
49
|
+
constructor() {
|
84
50
|
super();
|
85
|
-
this.
|
51
|
+
this.type = enums_1.CacheListPopFrontResponse.Miss;
|
52
|
+
}
|
53
|
+
value() {
|
54
|
+
return undefined;
|
86
55
|
}
|
87
56
|
}
|
57
|
+
exports.Miss = Miss;
|
88
58
|
/**
|
89
59
|
* Indicates that an error occurred during the list pop front request.
|
90
60
|
*
|
@@ -95,7 +65,14 @@ class _Error extends Response {
|
|
95
65
|
* - `message()` - a human-readable description of the error
|
96
66
|
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
97
67
|
*/
|
98
|
-
class Error extends
|
68
|
+
class Error extends response_base_1.BaseResponseError {
|
69
|
+
constructor(_innerException) {
|
70
|
+
super(_innerException);
|
71
|
+
this.type = enums_1.CacheListPopFrontResponse.Error;
|
72
|
+
}
|
73
|
+
value() {
|
74
|
+
return undefined;
|
75
|
+
}
|
99
76
|
}
|
100
77
|
exports.Error = Error;
|
101
|
-
//# sourceMappingURL=data:application/json;base64,
|
78
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtbGlzdC1wb3AtZnJvbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvbWVzc2FnZXMvcmVzcG9uc2VzL2NhY2hlLWxpc3QtcG9wLWZyb250LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUNBLG1EQUl5QjtBQUN6QixnREFBb0Q7QUFDcEQsbUNBQWtEO0FBRWxELE1BQU0sWUFBWSxHQUFHLElBQUksV0FBVyxFQUFFLENBQUM7QUFPdkM7OztHQUdHO0FBQ0gsTUFBYSxHQUFJLFNBQVEsNEJBQVk7SUFJbkMsWUFBWSxJQUFnQjtRQUMxQixLQUFLLEVBQUUsQ0FBQztRQUpELFNBQUksR0FBa0MsaUNBQXlCLENBQUMsR0FBRyxDQUFDO1FBSzNFLElBQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFDO0lBQ25CLENBQUM7SUFFRDs7O09BR0c7SUFDSSxLQUFLO1FBQ1YsT0FBTyxZQUFZLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQztJQUN4QyxDQUFDO0lBRUQ7OztPQUdHO0lBQ0ksV0FBVztRQUNoQixPQUFPLFlBQVksQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO0lBQ3hDLENBQUM7SUFFRDs7O09BR0c7SUFDSSxlQUFlO1FBQ3BCLE9BQU8sSUFBSSxDQUFDLElBQUksQ0FBQztJQUNuQixDQ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==
|
@@ -1,29 +1,16 @@
|
|
1
|
-
import { IListResponseSuccess, ResponseBase } from './response-base';
|
2
1
|
import { SdkError } from '../../errors';
|
2
|
+
import { BaseResponseError, BaseResponseSuccess } from './response-base';
|
3
|
+
import { CacheListPushBackResponse } from './enums';
|
4
|
+
interface IResponse {
|
5
|
+
readonly type: CacheListPushBackResponse;
|
6
|
+
}
|
3
7
|
/**
|
4
|
-
*
|
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 CacheListPushBack.Error) {
|
16
|
-
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
17
|
-
* // `CacheListPushBack.Error` in this block, so you will have access to the properties
|
18
|
-
* // of the Error class; e.g. `response.errorCode()`.
|
19
|
-
* }
|
20
|
-
* ```
|
8
|
+
* Indicates a successful list push back request.
|
21
9
|
*/
|
22
|
-
export declare
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
constructor(list_length: number);
|
10
|
+
export declare class Success extends BaseResponseSuccess implements IResponse {
|
11
|
+
readonly type: CacheListPushBackResponse.Success;
|
12
|
+
private readonly _listLength;
|
13
|
+
constructor(listLength: number);
|
27
14
|
/**
|
28
15
|
* Returns the new length of the list after the push operation.
|
29
16
|
* @returns {number}
|
@@ -31,27 +18,6 @@ declare class _Success extends Response implements IListResponseSuccess {
|
|
31
18
|
listLength(): number;
|
32
19
|
toString(): string;
|
33
20
|
}
|
34
|
-
declare const Success_base: {
|
35
|
-
new (...args: any[]): {
|
36
|
-
readonly is_success: boolean;
|
37
|
-
};
|
38
|
-
} & typeof _Success;
|
39
|
-
/**
|
40
|
-
* Indicates a Successful list push back request.
|
41
|
-
*/
|
42
|
-
export declare class Success extends Success_base {
|
43
|
-
}
|
44
|
-
declare class _Error extends Response {
|
45
|
-
}
|
46
|
-
declare const Error_base: {
|
47
|
-
new (...args: any[]): {
|
48
|
-
_innerException: SdkError;
|
49
|
-
message(): string;
|
50
|
-
innerException(): SdkError;
|
51
|
-
errorCode(): import("../../errors").MomentoErrorCode;
|
52
|
-
toString(): string;
|
53
|
-
};
|
54
|
-
} & typeof _Error;
|
55
21
|
/**
|
56
22
|
* Indicates that an error occurred during the list push back request.
|
57
23
|
*
|
@@ -62,8 +28,9 @@ declare const Error_base: {
|
|
62
28
|
* - `message()` - a human-readable description of the error
|
63
29
|
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
64
30
|
*/
|
65
|
-
export declare class Error extends
|
66
|
-
_innerException: SdkError;
|
31
|
+
export declare class Error extends BaseResponseError implements IResponse {
|
67
32
|
constructor(_innerException: SdkError);
|
33
|
+
readonly type: CacheListPushBackResponse.Error;
|
68
34
|
}
|
35
|
+
export type Response = Success | Error;
|
69
36
|
export {};
|
@@ -1,53 +1,29 @@
|
|
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
|
+
const enums_1 = require("./enums");
|
5
6
|
/**
|
6
|
-
*
|
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 CacheListPushBack.Error) {
|
18
|
-
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
19
|
-
* // `CacheListPushBack.Error` in this block, so you will have access to the properties
|
20
|
-
* // of the Error class; e.g. `response.errorCode()`.
|
21
|
-
* }
|
22
|
-
* ```
|
7
|
+
* Indicates a successful list push back request.
|
23
8
|
*/
|
24
|
-
class
|
25
|
-
|
26
|
-
exports.Response = Response;
|
27
|
-
class _Success extends Response {
|
28
|
-
constructor(list_length) {
|
9
|
+
class Success extends response_base_1.BaseResponseSuccess {
|
10
|
+
constructor(listLength) {
|
29
11
|
super();
|
30
|
-
this.
|
12
|
+
this.type = enums_1.CacheListPushBackResponse.Success;
|
13
|
+
this._listLength = listLength;
|
31
14
|
}
|
32
15
|
/**
|
33
16
|
* Returns the new length of the list after the push operation.
|
34
17
|
* @returns {number}
|
35
18
|
*/
|
36
19
|
listLength() {
|
37
|
-
return this.
|
20
|
+
return this._listLength;
|
38
21
|
}
|
39
22
|
toString() {
|
40
|
-
return `${super.toString()}: listLength: ${this.
|
23
|
+
return `${super.toString()}: listLength: ${this._listLength}`;
|
41
24
|
}
|
42
25
|
}
|
43
|
-
/**
|
44
|
-
* Indicates a Successful list push back request.
|
45
|
-
*/
|
46
|
-
class Success extends (0, response_base_1.ResponseSuccess)(_Success) {
|
47
|
-
}
|
48
26
|
exports.Success = Success;
|
49
|
-
class _Error extends Response {
|
50
|
-
}
|
51
27
|
/**
|
52
28
|
* Indicates that an error occurred during the list push back request.
|
53
29
|
*
|
@@ -58,11 +34,11 @@ class _Error extends Response {
|
|
58
34
|
* - `message()` - a human-readable description of the error
|
59
35
|
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
60
36
|
*/
|
61
|
-
class Error extends
|
37
|
+
class Error extends response_base_1.BaseResponseError {
|
62
38
|
constructor(_innerException) {
|
63
|
-
super();
|
64
|
-
this.
|
39
|
+
super(_innerException);
|
40
|
+
this.type = enums_1.CacheListPushBackResponse.Error;
|
65
41
|
}
|
66
42
|
}
|
67
43
|
exports.Error = Error;
|
68
|
-
//# sourceMappingURL=data:application/json;base64,
|
44
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtbGlzdC1wdXNoLWJhY2suanMiLCJzb3VyY2VSb290IjoiIi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B0aGUgbGlzdCBwdXNoIGJhY2sgcmVxdWVzdC5cbiAqXG4gKiBUaGlzIHJlc3BvbnNlIG9iamVjdCBpbmNsdWRlcyB0aGUgZm9sbG93aW5nIGZpZWxkcyB0aGF0IHlvdSBjYW4gdXNlIHRvIGRldGVybWluZVxuICogaG93IHlvdSB3b3VsZCBsaWtlIHRvIGhhbmRsZSB0aGUgZXJyb3I6XG4gKlxuICogLSBgZXJyb3JDb2RlKClgIC0gYSB1bmlxdWUgTW9tZW50byBlcnJvciBjb2RlIGluZGljYXRpbmcgdGhlIHR5cGUgb2YgZXJyb3IgdGhhdCBvY2N1cnJlZC5cbiAqIC0gYG1lc3NhZ2UoKWAgLSBhIGh1bWFuLXJlYWRhYmxlIGRlc2NyaXB0aW9uIG9mIHRoZSBlcnJvclxuICogLSBgaW5uZXJFeGNlcHRpb24oKWAgLSB0aGUgb3JpZ2luYWwgZXJyb3IgdGhhdCBjYXVzZWQgdGhlIGZhaWx1cmU7IGNhbiBiZSByZS10aHJvd24uXG4gKi9cbmV4cG9ydCBjbGFzcyBFcnJvciBleHRlbmRzIEJhc2VSZXNwb25zZUVycm9yIGltcGxlbWVudHMgSVJlc3BvbnNlIHtcbiAgY29uc3RydWN0b3IoX2lubmVyRXhjZXB0aW9uOiBTZGtFcnJvcikge1xuICAgIHN1cGVyKF9pbm5lckV4Y2VwdGlvbik7XG4gIH1cblxuICByZWFkb25seSB0eXBlOiBDYWNoZUxpc3RQdXNoQmFja1Jlc3BvbnNlLkVycm9yID1cbiAgICBDYWNoZUxpc3RQdXNoQmFja1Jlc3BvbnNlLkVycm9yO1xufVxuXG5leHBvcnQgdHlwZSBSZXNwb25zZSA9IFN1Y2Nlc3MgfCBFcnJvcjtcbiJdfQ==
|
@@ -1,29 +1,16 @@
|
|
1
|
-
import { IListResponseSuccess, ResponseBase } from './response-base';
|
2
1
|
import { SdkError } from '../../errors';
|
2
|
+
import { BaseResponseError, BaseResponseSuccess } from './response-base';
|
3
|
+
import { CacheListPushFrontResponse } from './enums';
|
4
|
+
interface IResponse {
|
5
|
+
readonly type: CacheListPushFrontResponse;
|
6
|
+
}
|
3
7
|
/**
|
4
|
-
*
|
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 CacheListPushFront.Error) {
|
16
|
-
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
17
|
-
* // `CacheListPushFront.Error` in this block, so you will have access to the properties
|
18
|
-
* // of the Error class; e.g. `response.errorCode()`.
|
19
|
-
* }
|
20
|
-
* ```
|
8
|
+
* Indicates a successful list push front request.
|
21
9
|
*/
|
22
|
-
export declare
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
constructor(list_length: number);
|
10
|
+
export declare class Success extends BaseResponseSuccess implements IResponse {
|
11
|
+
readonly type: CacheListPushFrontResponse.Success;
|
12
|
+
private readonly _listLength;
|
13
|
+
constructor(listLength: number);
|
27
14
|
/**
|
28
15
|
* Returns the new length of the list after the push operation.
|
29
16
|
* @returns {number}
|
@@ -31,27 +18,6 @@ declare class _Success extends Response implements IListResponseSuccess {
|
|
31
18
|
listLength(): number;
|
32
19
|
toString(): string;
|
33
20
|
}
|
34
|
-
declare const Success_base: {
|
35
|
-
new (...args: any[]): {
|
36
|
-
readonly is_success: boolean;
|
37
|
-
};
|
38
|
-
} & typeof _Success;
|
39
|
-
/**
|
40
|
-
* Indicates a Successful list push front request.
|
41
|
-
*/
|
42
|
-
export declare class Success extends Success_base {
|
43
|
-
}
|
44
|
-
declare class _Error extends Response {
|
45
|
-
}
|
46
|
-
declare const Error_base: {
|
47
|
-
new (...args: any[]): {
|
48
|
-
_innerException: SdkError;
|
49
|
-
message(): string;
|
50
|
-
innerException(): SdkError;
|
51
|
-
errorCode(): import("../../errors").MomentoErrorCode;
|
52
|
-
toString(): string;
|
53
|
-
};
|
54
|
-
} & typeof _Error;
|
55
21
|
/**
|
56
22
|
* Indicates that an error occurred during the list push front request.
|
57
23
|
*
|
@@ -62,8 +28,9 @@ declare const Error_base: {
|
|
62
28
|
* - `message()` - a human-readable description of the error
|
63
29
|
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
64
30
|
*/
|
65
|
-
export declare class Error extends
|
66
|
-
_innerException: SdkError;
|
31
|
+
export declare class Error extends BaseResponseError implements IResponse {
|
67
32
|
constructor(_innerException: SdkError);
|
33
|
+
readonly type: CacheListPushFrontResponse.Error;
|
68
34
|
}
|
35
|
+
export type Response = Success | Error;
|
69
36
|
export {};
|
@@ -1,53 +1,29 @@
|
|
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
|
+
const enums_1 = require("./enums");
|
5
6
|
/**
|
6
|
-
*
|
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 CacheListPushFront.Error) {
|
18
|
-
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
19
|
-
* // `CacheListPushFront.Error` in this block, so you will have access to the properties
|
20
|
-
* // of the Error class; e.g. `response.errorCode()`.
|
21
|
-
* }
|
22
|
-
* ```
|
7
|
+
* Indicates a successful list push front request.
|
23
8
|
*/
|
24
|
-
class
|
25
|
-
|
26
|
-
exports.Response = Response;
|
27
|
-
class _Success extends Response {
|
28
|
-
constructor(list_length) {
|
9
|
+
class Success extends response_base_1.BaseResponseSuccess {
|
10
|
+
constructor(listLength) {
|
29
11
|
super();
|
30
|
-
this.
|
12
|
+
this.type = enums_1.CacheListPushFrontResponse.Success;
|
13
|
+
this._listLength = listLength;
|
31
14
|
}
|
32
15
|
/**
|
33
16
|
* Returns the new length of the list after the push operation.
|
34
17
|
* @returns {number}
|
35
18
|
*/
|
36
19
|
listLength() {
|
37
|
-
return this.
|
20
|
+
return this._listLength;
|
38
21
|
}
|
39
22
|
toString() {
|
40
|
-
return `${super.toString()}: listLength: ${this.
|
23
|
+
return `${super.toString()}: listLength: ${this._listLength}`;
|
41
24
|
}
|
42
25
|
}
|
43
|
-
/**
|
44
|
-
* Indicates a Successful list push front request.
|
45
|
-
*/
|
46
|
-
class Success extends (0, response_base_1.ResponseSuccess)(_Success) {
|
47
|
-
}
|
48
26
|
exports.Success = Success;
|
49
|
-
class _Error extends Response {
|
50
|
-
}
|
51
27
|
/**
|
52
28
|
* Indicates that an error occurred during the list push front request.
|
53
29
|
*
|
@@ -58,11 +34,11 @@ class _Error extends Response {
|
|
58
34
|
* - `message()` - a human-readable description of the error
|
59
35
|
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
60
36
|
*/
|
61
|
-
class Error extends
|
37
|
+
class Error extends response_base_1.BaseResponseError {
|
62
38
|
constructor(_innerException) {
|
63
|
-
super();
|
64
|
-
this.
|
39
|
+
super(_innerException);
|
40
|
+
this.type = enums_1.CacheListPushFrontResponse.Error;
|
65
41
|
}
|
66
42
|
}
|
67
43
|
exports.Error = Error;
|
68
|
-
//# sourceMappingURL=data:application/json;base64,
|
44
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtbGlzdC1wdXNoLWZyb250LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL21lc3NhZ2VzL3Jlc3BvbnNlcy9jYWNoZS1saXN0LXB1c2gtZnJvbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncy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GNhbiB1c2UgdG8gZGV0ZXJtaW5lXG4gKiBob3cgeW91IHdvdWxkIGxpa2UgdG8gaGFuZGxlIHRoZSBlcnJvcjpcbiAqXG4gKiAtIGBlcnJvckNvZGUoKWAgLSBhIHVuaXF1ZSBNb21lbnRvIGVycm9yIGNvZGUgaW5kaWNhdGluZyB0aGUgdHlwZSBvZiBlcnJvciB0aGF0IG9jY3VycmVkLlxuICogLSBgbWVzc2FnZSgpYCAtIGEgaHVtYW4tcmVhZGFibGUgZGVzY3JpcHRpb24gb2YgdGhlIGVycm9yXG4gKiAtIGBpbm5lckV4Y2VwdGlvbigpYCAtIHRoZSBvcmlnaW5hbCBlcnJvciB0aGF0IGNhdXNlZCB0aGUgZmFpbHVyZTsgY2FuIGJlIHJlLXRocm93bi5cbiAqL1xuZXhwb3J0IGNsYXNzIEVycm9yIGV4dGVuZHMgQmFzZVJlc3BvbnNlRXJyb3IgaW1wbGVtZW50cyBJUmVzcG9uc2Uge1xuICBjb25zdHJ1Y3RvcihfaW5uZXJFeGNlcHRpb246IFNka0Vycm9yKSB7XG4gICAgc3VwZXIoX2lubmVyRXhjZXB0aW9uKTtcbiAgfVxuXG4gIHJlYWRvbmx5IHR5cGU6IENhY2hlTGlzdFB1c2hGcm9udFJlc3BvbnNlLkVycm9yID1cbiAgICBDYWNoZUxpc3RQdXNoRnJvbnRSZXNwb25zZS5FcnJvcjtcbn1cblxuZXhwb3J0IHR5cGUgUmVzcG9uc2UgPSBTdWNjZXNzIHwgRXJyb3I7XG4iXX0=
|
@@ -1,51 +1,15 @@
|
|
1
1
|
import { SdkError } from '../../errors';
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
5
|
-
|
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 CacheListRemoveValue.Error) {
|
16
|
-
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
17
|
-
* // `CacheListRemoveValue.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 { CacheListRemoveValueResponse } from './enums';
|
4
|
+
interface IResponse {
|
5
|
+
readonly type: CacheListRemoveValueResponse;
|
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
|
8
|
+
* Indicates a successful list remove value request.
|
33
9
|
*/
|
34
|
-
export declare class Success extends
|
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: CacheListRemoveValueResponse.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 remove value 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
|
23
|
+
export declare class Error extends BaseResponseError implements IResponse {
|
24
|
+
constructor(_innerException: SdkError);
|
25
|
+
readonly type: CacheListRemoveValueResponse.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 =
|
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
|
-
*
|
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 CacheListRemoveValue.Error) {
|
18
|
-
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
19
|
-
* // `CacheListRemoveValue.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 remove value request.
|
7
|
+
* Indicates a successful list remove value 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.CacheListRemoveValueResponse.Success;
|
39
13
|
}
|
40
14
|
}
|
15
|
+
exports.Success = Success;
|
41
16
|
/**
|
42
17
|
* Indicates that an error occurred during the list remove value 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.CacheListRemoveValueResponse.Error;
|
30
|
+
}
|
52
31
|
}
|
53
32
|
exports.Error = Error;
|
54
|
-
//# sourceMappingURL=data:application/json;base64,
|
33
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtbGlzdC1yZW1vdmUtdmFsdWUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvbWVzc2FnZXMvcmVzcG9uc2VzL2NhY2hlLWxpc3QtcmVtb3ZlLXZhbHVlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUNBLG1EQUF1RTtBQUN2RSxtQ0FBcUQ7QUFNckQ7O0dBRUc7QUFDSCxNQUFhLE9BQVEsU0FBUSxtQ0FBbUI7SUFBaEQ7O1FBQ1csU0FBSSxHQUNYLG9DQUE0QixDQUFDLE9BQU8sQ0FBQztJQUN6QyxDQUFDO0NBQUE7QUFIRCwwQkFHQztBQUVEOzs7Ozs7Ozs7R0FTRztBQUNILE1BQWEsS0FBTSxTQUFRLGlDQUFpQjtJQUMxQyxZQUFZLGVBQXlCO1FBQ25DLEtBQUssQ0FBQyxlQUFlLENBQUMsQ0FBQztRQUdoQixTQUFJLEdBQ1gsb0NBQTRCLENBQUMsS0FBSyxDQUFDO0lBSHJDLENBQUM7Q0FJRjtBQVBELHNCQU9DIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtTZGtFcnJvcn0gZnJvbSAnLi4vLi4vZXJyb3JzJztcbmltcG9ydCB7QmFzZVJlc3BvbnNlRXJyb3IsIEJhc2VSZXNw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