@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,72 +1,35 @@
|
|
1
1
|
import { SdkError } from '../../errors';
|
2
|
-
import { ResponseBase } from './response-base';
|
2
|
+
import { BaseResponseError, BaseResponseMiss, ResponseBase } from './response-base';
|
3
|
+
import { CacheItemGetTypeResponse } from './enums';
|
3
4
|
import { ItemType } from '../../utils';
|
5
|
+
interface IResponse {
|
6
|
+
itemType(): ItemType | undefined;
|
7
|
+
readonly type: CacheItemGetTypeResponse;
|
8
|
+
}
|
4
9
|
/**
|
5
|
-
*
|
6
|
-
* response object is resolved to a type-safe object of one of
|
7
|
-
* the following subtypes:
|
8
|
-
*
|
9
|
-
* - {Hit}
|
10
|
-
* - {Miss}
|
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 ItemType.Error) {
|
18
|
-
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
19
|
-
* // `ItemType.Error` in this block, so you will have access to the properties
|
20
|
-
* // of the Error class; e.g. `response.errorCode()`.
|
21
|
-
* }
|
22
|
-
* ```
|
10
|
+
* Indicates a successful item get type request.
|
23
11
|
*/
|
24
|
-
export declare
|
25
|
-
|
26
|
-
declare class _Hit extends Response {
|
12
|
+
export declare class Hit extends ResponseBase implements IResponse {
|
13
|
+
readonly type: CacheItemGetTypeResponse.Hit;
|
27
14
|
private readonly keyType;
|
28
15
|
constructor(keyType: ItemType);
|
29
16
|
/**
|
30
17
|
* Returns the type of key.
|
31
|
-
* @returns
|
18
|
+
* @returns {ItemType}
|
32
19
|
*/
|
33
20
|
itemType(): ItemType;
|
21
|
+
toString(): string;
|
34
22
|
}
|
35
|
-
declare const Hit_base: {
|
36
|
-
new (...args: any[]): {};
|
37
|
-
} & typeof _Hit;
|
38
23
|
/**
|
39
|
-
* Indicates that the
|
24
|
+
* Indicates that the requested item was not available in the cache.
|
40
25
|
*/
|
41
|
-
export declare class
|
42
|
-
|
43
|
-
|
26
|
+
export declare class Miss extends BaseResponseMiss implements IResponse {
|
27
|
+
readonly type: CacheItemGetTypeResponse.Miss;
|
28
|
+
constructor();
|
29
|
+
itemType(): undefined;
|
44
30
|
}
|
45
|
-
declare const Miss_base: {
|
46
|
-
new (...args: any[]): {
|
47
|
-
readonly is_miss: boolean;
|
48
|
-
};
|
49
|
-
} & typeof _Miss;
|
50
31
|
/**
|
51
|
-
* Indicates that
|
52
|
-
*/
|
53
|
-
export declare class Miss extends Miss_base {
|
54
|
-
}
|
55
|
-
declare class _Error extends Response {
|
56
|
-
protected _innerException: SdkError;
|
57
|
-
constructor(_innerException: SdkError);
|
58
|
-
}
|
59
|
-
declare const Error_base: {
|
60
|
-
new (...args: any[]): {
|
61
|
-
_innerException: SdkError;
|
62
|
-
message(): string;
|
63
|
-
innerException(): SdkError;
|
64
|
-
errorCode(): import("../../errors").MomentoErrorCode;
|
65
|
-
toString(): string;
|
66
|
-
};
|
67
|
-
} & typeof _Error;
|
68
|
-
/**
|
69
|
-
* Indicates that an error occurred during the item type request.
|
32
|
+
* Indicates that an error occurred during the item get type request.
|
70
33
|
*
|
71
34
|
* This response object includes the following fields that you can use to determine
|
72
35
|
* how you would like to handle the error:
|
@@ -75,6 +38,10 @@ declare const Error_base: {
|
|
75
38
|
* - `message()` - a human-readable description of the error
|
76
39
|
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
77
40
|
*/
|
78
|
-
export declare class Error extends
|
41
|
+
export declare class Error extends BaseResponseError implements IResponse {
|
42
|
+
readonly type: CacheItemGetTypeResponse.Error;
|
43
|
+
constructor(_innerException: SdkError);
|
44
|
+
itemType(): undefined;
|
79
45
|
}
|
46
|
+
export type Response = Hit | Miss | Error;
|
80
47
|
export {};
|
@@ -1,65 +1,44 @@
|
|
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
|
+
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
|
-
* - {Hit}
|
11
|
-
* - {Miss}
|
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 ItemType.Error) {
|
19
|
-
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
20
|
-
* // `ItemType.Error` in this block, so you will have access to the properties
|
21
|
-
* // of the Error class; e.g. `response.errorCode()`.
|
22
|
-
* }
|
23
|
-
* ```
|
7
|
+
* Indicates a successful item get type request.
|
24
8
|
*/
|
25
|
-
class
|
26
|
-
}
|
27
|
-
exports.Response = Response;
|
28
|
-
class _Hit extends Response {
|
9
|
+
class Hit extends response_base_1.ResponseBase {
|
29
10
|
constructor(keyType) {
|
30
11
|
super();
|
12
|
+
this.type = enums_1.CacheItemGetTypeResponse.Hit;
|
31
13
|
this.keyType = keyType;
|
32
14
|
}
|
33
15
|
/**
|
34
16
|
* Returns the type of key.
|
35
|
-
* @returns
|
17
|
+
* @returns {ItemType}
|
36
18
|
*/
|
37
19
|
itemType() {
|
38
20
|
return this.keyType;
|
39
21
|
}
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
*/
|
44
|
-
class Hit extends (0, response_base_1.ResponseHit)(_Hit) {
|
22
|
+
toString() {
|
23
|
+
return `${super.toString()}: item type: ${this.keyType}`;
|
24
|
+
}
|
45
25
|
}
|
46
26
|
exports.Hit = Hit;
|
47
|
-
class _Miss extends Response {
|
48
|
-
}
|
49
27
|
/**
|
50
|
-
* Indicates that the requested
|
28
|
+
* Indicates that the requested item was not available in the cache.
|
51
29
|
*/
|
52
|
-
class Miss extends
|
53
|
-
|
54
|
-
exports.Miss = Miss;
|
55
|
-
class _Error extends Response {
|
56
|
-
constructor(_innerException) {
|
30
|
+
class Miss extends response_base_1.BaseResponseMiss {
|
31
|
+
constructor() {
|
57
32
|
super();
|
58
|
-
this.
|
33
|
+
this.type = enums_1.CacheItemGetTypeResponse.Miss;
|
34
|
+
}
|
35
|
+
itemType() {
|
36
|
+
return undefined;
|
59
37
|
}
|
60
38
|
}
|
39
|
+
exports.Miss = Miss;
|
61
40
|
/**
|
62
|
-
* Indicates that an error occurred during the item type request.
|
41
|
+
* Indicates that an error occurred during the item get type request.
|
63
42
|
*
|
64
43
|
* This response object includes the following fields that you can use to determine
|
65
44
|
* how you would like to handle the error:
|
@@ -68,7 +47,14 @@ class _Error extends Response {
|
|
68
47
|
* - `message()` - a human-readable description of the error
|
69
48
|
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
70
49
|
*/
|
71
|
-
class Error extends
|
50
|
+
class Error extends response_base_1.BaseResponseError {
|
51
|
+
constructor(_innerException) {
|
52
|
+
super(_innerException);
|
53
|
+
this.type = enums_1.CacheItemGetTypeResponse.Error;
|
54
|
+
}
|
55
|
+
itemType() {
|
56
|
+
return undefined;
|
57
|
+
}
|
72
58
|
}
|
73
59
|
exports.Error = Error;
|
74
|
-
//# sourceMappingURL=data:application/json;base64,
|
60
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtaXRlbS1nZXQtdHlwZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9tZXNzYWdlcy9yZXNwb25zZXMvY2FjaGUtaXRlbS1nZXQtdHlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFDQSxtREFJeUI7QUFDekIsbU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vcmlnaW5hbCBlcnJvciB0aGF0IGNhdXNlZCB0aGUgZmFpbHVyZTsgY2FuIGJlIHJlLXRocm93bi5cbiAqL1xuZXhwb3J0IGNsYXNzIEVycm9yIGV4dGVuZHMgQmFzZVJlc3BvbnNlRXJyb3IgaW1wbGVtZW50cyBJUmVzcG9uc2Uge1xuICByZWFkb25seSB0eXBlOiBDYWNoZUl0ZW1HZXRUeXBlUmVzcG9uc2UuRXJyb3IgPVxuICAgIENhY2hlSXRlbUdldFR5cGVSZXNwb25zZS5FcnJvcjtcblxuICBjb25zdHJ1Y3RvcihfaW5uZXJFeGNlcHRpb246IFNka0Vycm9yKSB7XG4gICAgc3VwZXIoX2lubmVyRXhjZXB0aW9uKTtcbiAgfVxuXG4gIGl0ZW1UeXBlKCk6IHVuZGVmaW5lZCB7XG4gICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgfVxufVxuXG5leHBvcnQgdHlwZSBSZXNwb25zZSA9IEhpdCB8IE1pc3MgfCBFcnJvcjtcbiJdfQ==
|
@@ -1,61 +1,26 @@
|
|
1
1
|
import { SdkError } from '../../errors';
|
2
|
-
import {
|
2
|
+
import { BaseResponseError, BaseResponseSuccess } from './response-base';
|
3
|
+
import { CacheKeyExistsResponse } from './enums';
|
4
|
+
interface IResponse {
|
5
|
+
exists(): boolean | undefined;
|
6
|
+
readonly type: CacheKeyExistsResponse;
|
7
|
+
}
|
3
8
|
/**
|
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 CacheKeyExists.Error) {
|
16
|
-
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
17
|
-
* // `CacheKeyExists.Error` in this block, so you will have access to the properties
|
18
|
-
* // of the Error class; e.g. `response.errorCode()`.
|
19
|
-
* }
|
20
|
-
* ```
|
9
|
+
* Indicates a successful key exists request.
|
21
10
|
*/
|
22
|
-
export declare
|
23
|
-
|
24
|
-
declare class _Success extends Response {
|
11
|
+
export declare class Success extends BaseResponseSuccess implements IResponse {
|
12
|
+
readonly type: CacheKeyExistsResponse.Success;
|
25
13
|
private readonly _exists;
|
26
14
|
constructor(exists: boolean[]);
|
27
15
|
/**
|
28
|
-
*
|
16
|
+
* Returns the boolean indicating whether the given key was found in the cache.
|
29
17
|
* @returns {boolean}
|
30
18
|
*/
|
31
19
|
exists(): boolean;
|
32
20
|
toString(): string;
|
33
21
|
}
|
34
|
-
declare const Success_base: {
|
35
|
-
new (...args: any[]): {
|
36
|
-
readonly is_success: boolean;
|
37
|
-
};
|
38
|
-
} & typeof _Success;
|
39
|
-
/**
|
40
|
-
* Indicates a Successful cache key exists request.
|
41
|
-
*/
|
42
|
-
export declare class Success extends Success_base {
|
43
|
-
}
|
44
|
-
declare class _Error extends Response {
|
45
|
-
protected _innerException: SdkError;
|
46
|
-
constructor(_innerException: SdkError);
|
47
|
-
}
|
48
|
-
declare const Error_base: {
|
49
|
-
new (...args: any[]): {
|
50
|
-
_innerException: SdkError;
|
51
|
-
message(): string;
|
52
|
-
innerException(): SdkError;
|
53
|
-
errorCode(): import("../../errors").MomentoErrorCode;
|
54
|
-
toString(): string;
|
55
|
-
};
|
56
|
-
} & typeof _Error;
|
57
22
|
/**
|
58
|
-
* Indicates that an error occurred during the
|
23
|
+
* Indicates that an error occurred during the key exists request.
|
59
24
|
*
|
60
25
|
* This response object includes the following fields that you can use to determine
|
61
26
|
* how you would like to handle the error:
|
@@ -64,6 +29,10 @@ declare const Error_base: {
|
|
64
29
|
* - `message()` - a human-readable description of the error
|
65
30
|
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
66
31
|
*/
|
67
|
-
export declare class Error extends
|
32
|
+
export declare class Error extends BaseResponseError implements IResponse {
|
33
|
+
readonly type: CacheKeyExistsResponse.Error;
|
34
|
+
constructor(_innerException: SdkError);
|
35
|
+
exists(): undefined;
|
68
36
|
}
|
37
|
+
export type Response = Success | Error;
|
69
38
|
export {};
|
@@ -1,59 +1,31 @@
|
|
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 CacheKeyExists.Error) {
|
18
|
-
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
19
|
-
* // `CacheKeyExists.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 key exists request.
|
23
8
|
*/
|
24
|
-
class
|
25
|
-
}
|
26
|
-
exports.Response = Response;
|
27
|
-
class _Success extends Response {
|
9
|
+
class Success extends response_base_1.BaseResponseSuccess {
|
28
10
|
constructor(exists) {
|
29
11
|
super();
|
12
|
+
this.type = enums_1.CacheKeyExistsResponse.Success;
|
30
13
|
this._exists = exists[0];
|
31
14
|
}
|
32
15
|
/**
|
33
|
-
*
|
16
|
+
* Returns the boolean indicating whether the given key was found in the cache.
|
34
17
|
* @returns {boolean}
|
35
18
|
*/
|
36
19
|
exists() {
|
37
20
|
return this._exists;
|
38
21
|
}
|
39
22
|
toString() {
|
40
|
-
return `${super.toString()}: exists: ${String(this.
|
23
|
+
return `${super.toString()}: exists: ${String(this._exists)}`;
|
41
24
|
}
|
42
25
|
}
|
43
|
-
/**
|
44
|
-
* Indicates a Successful cache key exists request.
|
45
|
-
*/
|
46
|
-
class Success extends (0, response_base_1.ResponseSuccess)(_Success) {
|
47
|
-
}
|
48
26
|
exports.Success = Success;
|
49
|
-
class _Error extends Response {
|
50
|
-
constructor(_innerException) {
|
51
|
-
super();
|
52
|
-
this._innerException = _innerException;
|
53
|
-
}
|
54
|
-
}
|
55
27
|
/**
|
56
|
-
* Indicates that an error occurred during the
|
28
|
+
* Indicates that an error occurred during the key exists request.
|
57
29
|
*
|
58
30
|
* This response object includes the following fields that you can use to determine
|
59
31
|
* how you would like to handle the error:
|
@@ -62,7 +34,14 @@ class _Error extends Response {
|
|
62
34
|
* - `message()` - a human-readable description of the error
|
63
35
|
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
64
36
|
*/
|
65
|
-
class Error extends
|
37
|
+
class Error extends response_base_1.BaseResponseError {
|
38
|
+
constructor(_innerException) {
|
39
|
+
super(_innerException);
|
40
|
+
this.type = enums_1.CacheKeyExistsResponse.Error;
|
41
|
+
}
|
42
|
+
exists() {
|
43
|
+
return undefined;
|
44
|
+
}
|
66
45
|
}
|
67
46
|
exports.Error = Error;
|
68
|
-
//# sourceMappingURL=data:application/json;base64,
|
47
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUta2V5LWV4aXN0cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9tZXNzYWdlcy9yZXNwb25zZXMvY2FjaGUta2V5LWV4aXN0cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFDQSxtREFBdUU7QUFDdkUsbUNBQStDO0FBTy9DOztHQUVHO0FBQ0gsTUFBYSxPQUFRLFNBQVEsbUNBQW1CO0lBTTlDLFlBQVksTUFBaUI7UUFDM0IsS0FBSyxFQUFFLENBQUM7UUFORCxTQUFJLEdBQ1gsOEJBQXNCLENBQ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iAqXG4gKiAtIGBlcnJvckNvZGUoKWAgLSBhIHVuaXF1ZSBNb21lbnRvIGVycm9yIGNvZGUgaW5kaWNhdGluZyB0aGUgdHlwZSBvZiBlcnJvciB0aGF0IG9jY3VycmVkLlxuICogLSBgbWVzc2FnZSgpYCAtIGEgaHVtYW4tcmVhZGFibGUgZGVzY3JpcHRpb24gb2YgdGhlIGVycm9yXG4gKiAtIGBpbm5lckV4Y2VwdGlvbigpYCAtIHRoZSBvcmlnaW5hbCBlcnJvciB0aGF0IGNhdXNlZCB0aGUgZmFpbHVyZTsgY2FuIGJlIHJlLXRocm93bi5cbiAqL1xuZXhwb3J0IGNsYXNzIEVycm9yIGV4dGVuZHMgQmFzZVJlc3BvbnNlRXJyb3IgaW1wbGVtZW50cyBJUmVzcG9uc2Uge1xuICByZWFkb25seSB0eXBlOiBDYWNoZUtleUV4aXN0c1Jlc3BvbnNlLkVycm9yID0gQ2FjaGVLZXlFeGlzdHNSZXNwb25zZS5FcnJvcjtcblxuICBjb25zdHJ1Y3RvcihfaW5uZXJFeGNlcHRpb246IFNka0Vycm9yKSB7XG4gICAgc3VwZXIoX2lubmVyRXhjZXB0aW9uKTtcbiAgfVxuXG4gIGV4aXN0cygpOiB1bmRlZmluZWQge1xuICAgIHJldHVybiB1bmRlZmluZWQ7XG4gIH1cbn1cblxuZXhwb3J0IHR5cGUgUmVzcG9uc2UgPSBTdWNjZXNzIHwgRXJyb3I7XG4iXX0=
|
@@ -1,27 +1,15 @@
|
|
1
1
|
import { SdkError } from '../../errors';
|
2
|
-
import {
|
2
|
+
import { BaseResponseError, BaseResponseSuccess } from './response-base';
|
3
|
+
import { CacheKeysExistResponse } from './enums';
|
4
|
+
interface IResponse {
|
5
|
+
exists(): boolean[] | undefined;
|
6
|
+
readonly type: CacheKeysExistResponse;
|
7
|
+
}
|
3
8
|
/**
|
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 CacheKeysExist.Error) {
|
16
|
-
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
17
|
-
* // `CacheKeysExist.Error` in this block, so you will have access to the properties
|
18
|
-
* // of the Error class; e.g. `response.errorCode()`.
|
19
|
-
* }
|
20
|
-
* ```
|
9
|
+
* Indicates a successful keys exist request.
|
21
10
|
*/
|
22
|
-
export declare
|
23
|
-
|
24
|
-
declare class _Success extends Response {
|
11
|
+
export declare class Success extends BaseResponseSuccess implements IResponse {
|
12
|
+
readonly type: CacheKeysExistResponse.Success;
|
25
13
|
private readonly _keys;
|
26
14
|
private readonly _exists;
|
27
15
|
constructor(keys: Uint8Array[], exists: boolean[]);
|
@@ -31,37 +19,14 @@ declare class _Success extends Response {
|
|
31
19
|
*/
|
32
20
|
exists(): boolean[];
|
33
21
|
/**
|
34
|
-
* A record of key-
|
22
|
+
* A record of key-exists pairs indicating whether each given key was found in the cache.
|
35
23
|
* @returns {Record<string, boolean>}
|
36
24
|
*/
|
37
25
|
valueRecord(): Record<string, boolean>;
|
38
26
|
toString(): string;
|
39
27
|
}
|
40
|
-
declare const Success_base: {
|
41
|
-
new (...args: any[]): {
|
42
|
-
readonly is_success: boolean;
|
43
|
-
};
|
44
|
-
} & typeof _Success;
|
45
|
-
/**
|
46
|
-
* Indicates a Successful cache keys exist request.
|
47
|
-
*/
|
48
|
-
export declare class Success extends Success_base {
|
49
|
-
}
|
50
|
-
declare class _Error extends Response {
|
51
|
-
protected _innerException: SdkError;
|
52
|
-
constructor(_innerException: SdkError);
|
53
|
-
}
|
54
|
-
declare const Error_base: {
|
55
|
-
new (...args: any[]): {
|
56
|
-
_innerException: SdkError;
|
57
|
-
message(): string;
|
58
|
-
innerException(): SdkError;
|
59
|
-
errorCode(): import("../../errors").MomentoErrorCode;
|
60
|
-
toString(): string;
|
61
|
-
};
|
62
|
-
} & typeof _Error;
|
63
28
|
/**
|
64
|
-
* Indicates that an error occurred during the
|
29
|
+
* Indicates that an error occurred during the keys exist request.
|
65
30
|
*
|
66
31
|
* This response object includes the following fields that you can use to determine
|
67
32
|
* how you would like to handle the error:
|
@@ -70,6 +35,10 @@ declare const Error_base: {
|
|
70
35
|
* - `message()` - a human-readable description of the error
|
71
36
|
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
72
37
|
*/
|
73
|
-
export declare class Error extends
|
38
|
+
export declare class Error extends BaseResponseError implements IResponse {
|
39
|
+
readonly type: CacheKeysExistResponse.Error;
|
40
|
+
constructor(_innerException: SdkError);
|
41
|
+
exists(): undefined;
|
74
42
|
}
|
43
|
+
export type Response = Success | Error;
|
75
44
|
export {};
|
@@ -1,33 +1,16 @@
|
|
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
|
const TEXT_DECODER = new TextDecoder();
|
6
7
|
/**
|
7
|
-
*
|
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 CacheKeysExist.Error) {
|
19
|
-
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
20
|
-
* // `CacheKeysExist.Error` in this block, so you will have access to the properties
|
21
|
-
* // of the Error class; e.g. `response.errorCode()`.
|
22
|
-
* }
|
23
|
-
* ```
|
8
|
+
* Indicates a successful keys exist request.
|
24
9
|
*/
|
25
|
-
class
|
26
|
-
}
|
27
|
-
exports.Response = Response;
|
28
|
-
class _Success extends Response {
|
10
|
+
class Success extends response_base_1.BaseResponseSuccess {
|
29
11
|
constructor(keys, exists) {
|
30
12
|
super();
|
13
|
+
this.type = enums_1.CacheKeysExistResponse.Success;
|
31
14
|
this._keys = keys;
|
32
15
|
this._exists = exists;
|
33
16
|
}
|
@@ -39,7 +22,7 @@ class _Success extends Response {
|
|
39
22
|
return this._exists;
|
40
23
|
}
|
41
24
|
/**
|
42
|
-
* A record of key-
|
25
|
+
* A record of key-exists pairs indicating whether each given key was found in the cache.
|
43
26
|
* @returns {Record<string, boolean>}
|
44
27
|
*/
|
45
28
|
valueRecord() {
|
@@ -53,20 +36,9 @@ class _Success extends Response {
|
|
53
36
|
return super.toString() + ': exists: ' + booleans.join(', ');
|
54
37
|
}
|
55
38
|
}
|
56
|
-
/**
|
57
|
-
* Indicates a Successful cache keys exist request.
|
58
|
-
*/
|
59
|
-
class Success extends (0, response_base_1.ResponseSuccess)(_Success) {
|
60
|
-
}
|
61
39
|
exports.Success = Success;
|
62
|
-
class _Error extends Response {
|
63
|
-
constructor(_innerException) {
|
64
|
-
super();
|
65
|
-
this._innerException = _innerException;
|
66
|
-
}
|
67
|
-
}
|
68
40
|
/**
|
69
|
-
* Indicates that an error occurred during the
|
41
|
+
* Indicates that an error occurred during the keys exist request.
|
70
42
|
*
|
71
43
|
* This response object includes the following fields that you can use to determine
|
72
44
|
* how you would like to handle the error:
|
@@ -75,7 +47,14 @@ class _Error extends Response {
|
|
75
47
|
* - `message()` - a human-readable description of the error
|
76
48
|
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
77
49
|
*/
|
78
|
-
class Error extends
|
50
|
+
class Error extends response_base_1.BaseResponseError {
|
51
|
+
constructor(_innerException) {
|
52
|
+
super(_innerException);
|
53
|
+
this.type = enums_1.CacheKeysExistResponse.Error;
|
54
|
+
}
|
55
|
+
exists() {
|
56
|
+
return undefined;
|
57
|
+
}
|
79
58
|
}
|
80
59
|
exports.Error = Error;
|
81
|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