@gomomento/sdk-core 1.12.8
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 +83 -0
- package/dist/src/auth/credential-provider.js +82 -0
- package/dist/src/auth/index.d.ts +1 -0
- package/dist/src/auth/index.js +18 -0
- package/dist/src/config/logging/default-momento-logger.d.ts +24 -0
- package/dist/src/config/logging/default-momento-logger.js +69 -0
- package/dist/src/config/logging/index.d.ts +3 -0
- package/dist/src/config/logging/index.js +20 -0
- package/dist/src/config/logging/momento-logger.d.ts +10 -0
- package/dist/src/config/logging/momento-logger.js +3 -0
- package/dist/src/config/logging/noop-momento-logger.d.ts +11 -0
- package/dist/src/config/logging/noop-momento-logger.js +34 -0
- package/dist/src/config/transport/grpc-configuration.d.ts +41 -0
- package/dist/src/config/transport/grpc-configuration.js +3 -0
- package/dist/src/config/transport/index.d.ts +2 -0
- package/dist/src/config/transport/index.js +19 -0
- package/dist/src/config/transport/transport-strategy.d.ts +77 -0
- package/dist/src/config/transport/transport-strategy.js +60 -0
- package/dist/src/errors/error-utils.d.ts +2 -0
- package/dist/src/errors/error-utils.js +12 -0
- package/dist/src/errors/errors.d.ts +140 -0
- package/dist/src/errors/errors.js +229 -0
- package/dist/src/errors/index.d.ts +2 -0
- package/dist/src/errors/index.js +19 -0
- package/dist/src/index.d.ts +57 -0
- package/dist/src/index.js +137 -0
- package/dist/src/internal/clients/auth/AbstractAuthClient.d.ts +10 -0
- package/dist/src/internal/clients/auth/AbstractAuthClient.js +13 -0
- package/dist/src/internal/clients/auth/IAuthClient.d.ts +4 -0
- package/dist/src/internal/clients/auth/IAuthClient.js +3 -0
- package/dist/src/internal/clients/auth/index.d.ts +2 -0
- package/dist/src/internal/clients/auth/index.js +19 -0
- package/dist/src/internal/clients/cache/AbstractCacheClient.d.ts +638 -0
- package/dist/src/internal/clients/cache/AbstractCacheClient.js +870 -0
- package/dist/src/internal/clients/cache/ICacheClient.d.ts +45 -0
- package/dist/src/internal/clients/cache/ICacheClient.js +3 -0
- package/dist/src/internal/clients/cache/IControlClient.d.ts +7 -0
- package/dist/src/internal/clients/cache/IControlClient.js +3 -0
- package/dist/src/internal/clients/cache/IDataClient.d.ts +29 -0
- package/dist/src/internal/clients/cache/IDataClient.js +3 -0
- package/dist/src/internal/clients/cache/index.d.ts +4 -0
- package/dist/src/internal/clients/cache/index.js +21 -0
- package/dist/src/internal/clients/index.d.ts +3 -0
- package/dist/src/internal/clients/index.js +20 -0
- package/dist/src/internal/clients/ping/AbstractPingClient.d.ts +25 -0
- package/dist/src/internal/clients/ping/AbstractPingClient.js +29 -0
- package/dist/src/internal/clients/ping/IPingClient.d.ts +3 -0
- package/dist/src/internal/clients/ping/IPingClient.js +3 -0
- package/dist/src/internal/clients/ping/index.d.ts +2 -0
- package/dist/src/internal/clients/ping/index.js +19 -0
- package/dist/src/internal/subscription-state.d.ts +15 -0
- package/dist/src/internal/subscription-state.js +38 -0
- package/dist/src/internal/utils/auth.d.ts +25 -0
- package/dist/src/internal/utils/auth.js +50 -0
- package/dist/src/internal/utils/collections.d.ts +1 -0
- package/dist/src/internal/utils/collections.js +8 -0
- package/dist/src/internal/utils/display.d.ts +2 -0
- package/dist/src/internal/utils/display.js +30 -0
- package/dist/src/internal/utils/index.d.ts +7 -0
- package/dist/src/internal/utils/index.js +24 -0
- package/dist/src/internal/utils/object.d.ts +1 -0
- package/dist/src/internal/utils/object.js +8 -0
- package/dist/src/internal/utils/sleep.d.ts +1 -0
- package/dist/src/internal/utils/sleep.js +6 -0
- package/dist/src/internal/utils/string.d.ts +2 -0
- package/dist/src/internal/utils/string.js +17 -0
- package/dist/src/internal/utils/validators.d.ts +13 -0
- package/dist/src/internal/utils/validators.js +105 -0
- package/dist/src/internal/vendor/printf/README.md +31 -0
- package/dist/src/internal/vendor/printf/printf.d.ts +9 -0
- package/dist/src/internal/vendor/printf/printf.js +478 -0
- package/dist/src/messages/cache-info.d.ts +5 -0
- package/dist/src/messages/cache-info.js +13 -0
- package/dist/src/messages/responses/cache-delete.d.ts +61 -0
- package/dist/src/messages/responses/cache-delete.js +54 -0
- package/dist/src/messages/responses/cache-dictionary-fetch.d.ts +120 -0
- package/dist/src/messages/responses/cache-dictionary-fetch.js +162 -0
- package/dist/src/messages/responses/cache-dictionary-get-field.d.ts +123 -0
- package/dist/src/messages/responses/cache-dictionary-get-field.js +143 -0
- package/dist/src/messages/responses/cache-dictionary-get-fields.d.ts +122 -0
- package/dist/src/messages/responses/cache-dictionary-get-fields.js +173 -0
- package/dist/src/messages/responses/cache-dictionary-increment.d.ts +69 -0
- package/dist/src/messages/responses/cache-dictionary-increment.js +68 -0
- package/dist/src/messages/responses/cache-dictionary-remove-field.d.ts +61 -0
- package/dist/src/messages/responses/cache-dictionary-remove-field.js +54 -0
- package/dist/src/messages/responses/cache-dictionary-remove-fields.d.ts +61 -0
- package/dist/src/messages/responses/cache-dictionary-remove-fields.js +54 -0
- package/dist/src/messages/responses/cache-dictionary-set-field.d.ts +61 -0
- package/dist/src/messages/responses/cache-dictionary-set-field.js +54 -0
- package/dist/src/messages/responses/cache-dictionary-set-fields.d.ts +61 -0
- package/dist/src/messages/responses/cache-dictionary-set-fields.js +54 -0
- package/dist/src/messages/responses/cache-flush.d.ts +61 -0
- package/dist/src/messages/responses/cache-flush.js +54 -0
- package/dist/src/messages/responses/cache-get.d.ts +86 -0
- package/dist/src/messages/responses/cache-get.js +88 -0
- package/dist/src/messages/responses/cache-increment.d.ts +69 -0
- package/dist/src/messages/responses/cache-increment.js +68 -0
- package/dist/src/messages/responses/cache-list-concatenate-back.d.ts +69 -0
- package/dist/src/messages/responses/cache-list-concatenate-back.js +68 -0
- package/dist/src/messages/responses/cache-list-concatenate-front.d.ts +69 -0
- package/dist/src/messages/responses/cache-list-concatenate-front.js +68 -0
- package/dist/src/messages/responses/cache-list-fetch.d.ts +92 -0
- package/dist/src/messages/responses/cache-list-fetch.js +96 -0
- package/dist/src/messages/responses/cache-list-length.d.ts +84 -0
- package/dist/src/messages/responses/cache-list-length.js +78 -0
- package/dist/src/messages/responses/cache-list-pop-back.d.ts +86 -0
- package/dist/src/messages/responses/cache-list-pop-back.js +88 -0
- package/dist/src/messages/responses/cache-list-pop-front.d.ts +86 -0
- package/dist/src/messages/responses/cache-list-pop-front.js +88 -0
- package/dist/src/messages/responses/cache-list-push-back.d.ts +69 -0
- package/dist/src/messages/responses/cache-list-push-back.js +68 -0
- package/dist/src/messages/responses/cache-list-push-front.d.ts +69 -0
- package/dist/src/messages/responses/cache-list-push-front.js +68 -0
- package/dist/src/messages/responses/cache-list-remove-value.d.ts +61 -0
- package/dist/src/messages/responses/cache-list-remove-value.js +54 -0
- package/dist/src/messages/responses/cache-list-retain.d.ts +61 -0
- package/dist/src/messages/responses/cache-list-retain.js +54 -0
- package/dist/src/messages/responses/cache-set-add-element.d.ts +71 -0
- package/dist/src/messages/responses/cache-set-add-element.js +54 -0
- package/dist/src/messages/responses/cache-set-add-elements.d.ts +65 -0
- package/dist/src/messages/responses/cache-set-add-elements.js +61 -0
- package/dist/src/messages/responses/cache-set-fetch.d.ts +111 -0
- package/dist/src/messages/responses/cache-set-fetch.js +121 -0
- package/dist/src/messages/responses/cache-set-if-not-exists.d.ts +74 -0
- package/dist/src/messages/responses/cache-set-if-not-exists.js +63 -0
- package/dist/src/messages/responses/cache-set-remove-element.d.ts +61 -0
- package/dist/src/messages/responses/cache-set-remove-element.js +54 -0
- package/dist/src/messages/responses/cache-set-remove-elements.d.ts +65 -0
- package/dist/src/messages/responses/cache-set-remove-elements.js +61 -0
- package/dist/src/messages/responses/cache-set.d.ts +61 -0
- package/dist/src/messages/responses/cache-set.js +54 -0
- package/dist/src/messages/responses/cache-sorted-set-fetch.d.ts +107 -0
- package/dist/src/messages/responses/cache-sorted-set-fetch.js +124 -0
- package/dist/src/messages/responses/cache-sorted-set-get-rank.d.ts +81 -0
- package/dist/src/messages/responses/cache-sorted-set-get-rank.js +78 -0
- package/dist/src/messages/responses/cache-sorted-set-get-score.d.ts +118 -0
- package/dist/src/messages/responses/cache-sorted-set-get-score.js +131 -0
- package/dist/src/messages/responses/cache-sorted-set-get-scores.d.ts +109 -0
- package/dist/src/messages/responses/cache-sorted-set-get-scores.js +148 -0
- package/dist/src/messages/responses/cache-sorted-set-increment-score.d.ts +69 -0
- package/dist/src/messages/responses/cache-sorted-set-increment-score.js +68 -0
- package/dist/src/messages/responses/cache-sorted-set-put-element.d.ts +61 -0
- package/dist/src/messages/responses/cache-sorted-set-put-element.js +54 -0
- package/dist/src/messages/responses/cache-sorted-set-put-elements.d.ts +61 -0
- package/dist/src/messages/responses/cache-sorted-set-put-elements.js +54 -0
- package/dist/src/messages/responses/cache-sorted-set-remove-element.d.ts +61 -0
- package/dist/src/messages/responses/cache-sorted-set-remove-element.js +54 -0
- package/dist/src/messages/responses/cache-sorted-set-remove-elements.d.ts +61 -0
- package/dist/src/messages/responses/cache-sorted-set-remove-elements.js +54 -0
- package/dist/src/messages/responses/create-cache.d.ts +77 -0
- package/dist/src/messages/responses/create-cache.js +61 -0
- package/dist/src/messages/responses/create-signing-key.d.ts +71 -0
- package/dist/src/messages/responses/create-signing-key.js +76 -0
- package/dist/src/messages/responses/delete-cache.d.ts +61 -0
- package/dist/src/messages/responses/delete-cache.js +54 -0
- package/dist/src/messages/responses/generate-api-token.d.ts +50 -0
- package/dist/src/messages/responses/generate-api-token.js +52 -0
- package/dist/src/messages/responses/grpc-response-types.d.ts +41 -0
- package/dist/src/messages/responses/grpc-response-types.js +53 -0
- package/dist/src/messages/responses/list-caches.d.ts +70 -0
- package/dist/src/messages/responses/list-caches.js +69 -0
- package/dist/src/messages/responses/list-signing-keys.d.ts +68 -0
- package/dist/src/messages/responses/list-signing-keys.js +68 -0
- package/dist/src/messages/responses/response-base.d.ts +43 -0
- package/dist/src/messages/responses/response-base.js +50 -0
- package/dist/src/messages/responses/revoke-signing-key.d.ts +61 -0
- package/dist/src/messages/responses/revoke-signing-key.js +54 -0
- package/dist/src/messages/responses/topic-item.d.ts +27 -0
- package/dist/src/messages/responses/topic-item.js +43 -0
- package/dist/src/messages/responses/topic-publish.d.ts +61 -0
- package/dist/src/messages/responses/topic-publish.js +54 -0
- package/dist/src/messages/responses/topic-subscribe.d.ts +69 -0
- package/dist/src/messages/responses/topic-subscribe.js +72 -0
- package/dist/src/messages/signing-key.d.ts +9 -0
- package/dist/src/messages/signing-key.js +21 -0
- package/dist/src/utils/cache-call-options.d.ts +99 -0
- package/dist/src/utils/cache-call-options.js +9 -0
- package/dist/src/utils/collection-ttl.d.ts +78 -0
- package/dist/src/utils/collection-ttl.js +102 -0
- package/dist/src/utils/index.d.ts +3 -0
- package/dist/src/utils/index.js +20 -0
- package/dist/src/utils/topic-call-options.d.ts +19 -0
- package/dist/src/utils/topic-call-options.js +3 -0
- package/package.json +53 -0
@@ -0,0 +1,61 @@
|
|
1
|
+
import { SdkError } from '../../errors/errors';
|
2
|
+
import { ResponseBase } from './response-base';
|
3
|
+
/**
|
4
|
+
* Parent response type for a set remove element request. The
|
5
|
+
* response object is resolved to a type-safe object of one of
|
6
|
+
* the following subtypes:
|
7
|
+
*
|
8
|
+
* - {Success}
|
9
|
+
* - {Error}
|
10
|
+
*
|
11
|
+
* `instanceof` type guards can be used to operate on the appropriate subtype.
|
12
|
+
* @example
|
13
|
+
* For example:
|
14
|
+
* ```
|
15
|
+
* if (response instanceof CacheSetRemoveElement.Error) {
|
16
|
+
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
17
|
+
* // `CacheSetRemoveElement.Error` in this block, so you will have access to the properties
|
18
|
+
* // of the Error class; e.g. `response.errorCode()`.
|
19
|
+
* }
|
20
|
+
* ```
|
21
|
+
*/
|
22
|
+
export declare abstract class Response extends ResponseBase {
|
23
|
+
}
|
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
|
+
/**
|
32
|
+
* Indicates a Successful set remove element request.
|
33
|
+
*/
|
34
|
+
export declare class Success extends Success_base {
|
35
|
+
}
|
36
|
+
declare class _Error extends Response {
|
37
|
+
protected _innerException: SdkError;
|
38
|
+
constructor(_innerException: SdkError);
|
39
|
+
}
|
40
|
+
declare const Error_base: {
|
41
|
+
new (...args: any[]): {
|
42
|
+
_innerException: SdkError;
|
43
|
+
message(): string;
|
44
|
+
innerException(): SdkError;
|
45
|
+
errorCode(): import("../../errors/errors").MomentoErrorCode;
|
46
|
+
toString(): string;
|
47
|
+
};
|
48
|
+
} & typeof _Error;
|
49
|
+
/**
|
50
|
+
* Indicates that an error occurred during the set remove element request.
|
51
|
+
*
|
52
|
+
* This response object includes the following fields that you can use to determine
|
53
|
+
* how you would like to handle the error:
|
54
|
+
*
|
55
|
+
* - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
|
56
|
+
* - `message()` - a human-readable description of the error
|
57
|
+
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
58
|
+
*/
|
59
|
+
export declare class Error extends Error_base {
|
60
|
+
}
|
61
|
+
export {};
|
@@ -0,0 +1,54 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Error = exports.Success = exports.Response = void 0;
|
4
|
+
const response_base_1 = require("./response-base");
|
5
|
+
/**
|
6
|
+
* Parent response type for a set remove element request. The
|
7
|
+
* response object is resolved to a type-safe object of one of
|
8
|
+
* the following subtypes:
|
9
|
+
*
|
10
|
+
* - {Success}
|
11
|
+
* - {Error}
|
12
|
+
*
|
13
|
+
* `instanceof` type guards can be used to operate on the appropriate subtype.
|
14
|
+
* @example
|
15
|
+
* For example:
|
16
|
+
* ```
|
17
|
+
* if (response instanceof CacheSetRemoveElement.Error) {
|
18
|
+
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
19
|
+
* // `CacheSetRemoveElement.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 set remove element request.
|
31
|
+
*/
|
32
|
+
class Success extends (0, response_base_1.ResponseSuccess)(_Success) {
|
33
|
+
}
|
34
|
+
exports.Success = Success;
|
35
|
+
class _Error extends Response {
|
36
|
+
constructor(_innerException) {
|
37
|
+
super();
|
38
|
+
this._innerException = _innerException;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
/**
|
42
|
+
* Indicates that an error occurred during the set remove element request.
|
43
|
+
*
|
44
|
+
* This response object includes the following fields that you can use to determine
|
45
|
+
* how you would like to handle the error:
|
46
|
+
*
|
47
|
+
* - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
|
48
|
+
* - `message()` - a human-readable description of the error
|
49
|
+
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
50
|
+
*/
|
51
|
+
class Error extends (0, response_base_1.ResponseError)(_Error) {
|
52
|
+
}
|
53
|
+
exports.Error = Error;
|
54
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtc2V0LXJlbW92ZS1lbGVtZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL21lc3NhZ2VzL3Jlc3BvbnNlcy9jYWNoZS1zZXQtcmVtb3ZlLWVsZW1lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EsbURBQTZFO0FBRTdFOzs7Ozs7Ozs7Ozs7Ozs7Ozs7R0FrQkc7QUFDSCxNQUFzQixRQUFTLFNBQVEsNEJBQVk7Q0FBRztBQUF0RCw0QkFBc0Q7QUFFdEQsTUFBTSxRQUFTLFNBQVEsUUFBUT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gaGFuZGxlIHRoZSBlcnJvcjpcbiAqXG4gKiAtIGBlcnJvckNvZGUoKWAgLSBhIHVuaXF1ZSBNb21lbnRvIGVycm9yIGNvZGUgaW5kaWNhdGluZyB0aGUgdHlwZSBvZiBlcnJvciB0aGF0IG9jY3VycmVkLlxuICogLSBgbWVzc2FnZSgpYCAtIGEgaHVtYW4tcmVhZGFibGUgZGVzY3JpcHRpb24gb2YgdGhlIGVycm9yXG4gKiAtIGBpbm5lckV4Y2VwdGlvbigpYCAtIHRoZSBvcmlnaW5hbCBlcnJvciB0aGF0IGNhdXNlZCB0aGUgZmFpbHVyZTsgY2FuIGJlIHJlLXRocm93bi5cbiAqL1xuZXhwb3J0IGNsYXNzIEVycm9yIGV4dGVuZHMgUmVzcG9uc2VFcnJvcihfRXJyb3IpIHt9XG4iXX0=
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import * as CacheSetRemoveElement from './cache-set-remove-element';
|
2
|
+
import { ResponseBase } from './response-base';
|
3
|
+
import { SdkError } from '../../errors/errors';
|
4
|
+
declare class _Success extends ResponseBase {
|
5
|
+
}
|
6
|
+
declare class _Error extends ResponseBase {
|
7
|
+
protected _innerException: SdkError;
|
8
|
+
constructor(_innerException: SdkError);
|
9
|
+
}
|
10
|
+
/**
|
11
|
+
* Parent response type for a set remove elements request. The
|
12
|
+
* response object is resolved to a type-safe object of one of
|
13
|
+
* the following subtypes:
|
14
|
+
*
|
15
|
+
* - {Success}
|
16
|
+
* - {Error}
|
17
|
+
*
|
18
|
+
* `instanceof` type guards can be used to operate on the appropriate subtype.
|
19
|
+
* @example
|
20
|
+
* For example:
|
21
|
+
* ```
|
22
|
+
* if (response instanceof CacheSetRemoveElements.Error) {
|
23
|
+
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
24
|
+
* // `CacheSetRemoveElements.Error` in this block, so you will have access to the properties
|
25
|
+
* // of the Error class; e.g. `response.errorCode()`.
|
26
|
+
* }
|
27
|
+
* ```
|
28
|
+
*/
|
29
|
+
export declare abstract class Response extends ResponseBase {
|
30
|
+
abstract toSingularResponse(): CacheSetRemoveElement.Response;
|
31
|
+
}
|
32
|
+
declare const Success_base: {
|
33
|
+
new (...args: any[]): {
|
34
|
+
readonly is_success: boolean;
|
35
|
+
};
|
36
|
+
} & typeof _Success;
|
37
|
+
/**
|
38
|
+
* Indicates a Successful set remove elements request.
|
39
|
+
*/
|
40
|
+
export declare class Success extends Success_base {
|
41
|
+
toSingularResponse(): CacheSetRemoveElement.Response;
|
42
|
+
}
|
43
|
+
declare const Error_base: {
|
44
|
+
new (...args: any[]): {
|
45
|
+
_innerException: SdkError;
|
46
|
+
message(): string;
|
47
|
+
innerException(): SdkError;
|
48
|
+
errorCode(): import("../../errors/errors").MomentoErrorCode;
|
49
|
+
toString(): string;
|
50
|
+
};
|
51
|
+
} & typeof _Error;
|
52
|
+
/**
|
53
|
+
* Indicates that an error occurred during the set remove elements request.
|
54
|
+
*
|
55
|
+
* This response object includes the following fields that you can use to determine
|
56
|
+
* how you would like to handle the error:
|
57
|
+
*
|
58
|
+
* - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
|
59
|
+
* - `message()` - a human-readable description of the error
|
60
|
+
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
61
|
+
*/
|
62
|
+
export declare class Error extends Error_base {
|
63
|
+
toSingularResponse(): CacheSetRemoveElement.Response;
|
64
|
+
}
|
65
|
+
export {};
|
@@ -0,0 +1,61 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Error = exports.Success = exports.Response = void 0;
|
4
|
+
const CacheSetRemoveElement = require("./cache-set-remove-element");
|
5
|
+
const response_base_1 = require("./response-base");
|
6
|
+
class _Success extends response_base_1.ResponseBase {
|
7
|
+
}
|
8
|
+
class _Error extends response_base_1.ResponseBase {
|
9
|
+
constructor(_innerException) {
|
10
|
+
super();
|
11
|
+
this._innerException = _innerException;
|
12
|
+
}
|
13
|
+
}
|
14
|
+
/**
|
15
|
+
* Parent response type for a set remove elements request. The
|
16
|
+
* response object is resolved to a type-safe object of one of
|
17
|
+
* the following subtypes:
|
18
|
+
*
|
19
|
+
* - {Success}
|
20
|
+
* - {Error}
|
21
|
+
*
|
22
|
+
* `instanceof` type guards can be used to operate on the appropriate subtype.
|
23
|
+
* @example
|
24
|
+
* For example:
|
25
|
+
* ```
|
26
|
+
* if (response instanceof CacheSetRemoveElements.Error) {
|
27
|
+
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
28
|
+
* // `CacheSetRemoveElements.Error` in this block, so you will have access to the properties
|
29
|
+
* // of the Error class; e.g. `response.errorCode()`.
|
30
|
+
* }
|
31
|
+
* ```
|
32
|
+
*/
|
33
|
+
class Response extends response_base_1.ResponseBase {
|
34
|
+
}
|
35
|
+
exports.Response = Response;
|
36
|
+
/**
|
37
|
+
* Indicates a Successful set remove elements request.
|
38
|
+
*/
|
39
|
+
class Success extends (0, response_base_1.ResponseSuccess)(_Success) {
|
40
|
+
toSingularResponse() {
|
41
|
+
return new CacheSetRemoveElement.Success();
|
42
|
+
}
|
43
|
+
}
|
44
|
+
exports.Success = Success;
|
45
|
+
/**
|
46
|
+
* Indicates that an error occurred during the set remove elements request.
|
47
|
+
*
|
48
|
+
* This response object includes the following fields that you can use to determine
|
49
|
+
* how you would like to handle the error:
|
50
|
+
*
|
51
|
+
* - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
|
52
|
+
* - `message()` - a human-readable description of the error
|
53
|
+
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
54
|
+
*/
|
55
|
+
class Error extends (0, response_base_1.ResponseError)(_Error) {
|
56
|
+
toSingularResponse() {
|
57
|
+
return new CacheSetRemoveElement.Error(this._innerException);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
exports.Error = Error;
|
61
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtc2V0LXJlbW92ZS1lbGVtZW50cy5qcy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LSBgbWVzc2FnZSgpYCAtIGEgaHVtYW4tcmVhZGFibGUgZGVzY3JpcHRpb24gb2YgdGhlIGVycm9yXG4gKiAtIGBpbm5lckV4Y2VwdGlvbigpYCAtIHRoZSBvcmlnaW5hbCBlcnJvciB0aGF0IGNhdXNlZCB0aGUgZmFpbHVyZTsgY2FuIGJlIHJlLXRocm93bi5cbiAqL1xuZXhwb3J0IGNsYXNzIEVycm9yIGV4dGVuZHMgUmVzcG9uc2VFcnJvcihfRXJyb3IpIHtcbiAgdG9TaW5ndWxhclJlc3BvbnNlKCk6IENhY2hlU2V0UmVtb3ZlRWxlbWVudC5SZXNwb25zZSB7XG4gICAgcmV0dXJuIG5ldyBDYWNoZVNldFJlbW92ZUVsZW1lbnQuRXJyb3IodGhpcy5faW5uZXJFeGNlcHRpb24pO1xuICB9XG59XG4iXX0=
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import { SdkError } from '../../errors/errors';
|
2
|
+
import { ResponseBase } from './response-base';
|
3
|
+
/**
|
4
|
+
* Parent response type for a cache set request. The
|
5
|
+
* response object is resolved to a type-safe object of one of
|
6
|
+
* the following subtypes:
|
7
|
+
*
|
8
|
+
* - {Success}
|
9
|
+
* - {Error}
|
10
|
+
*
|
11
|
+
* `instanceof` type guards can be used to operate on the appropriate subtype.
|
12
|
+
* @example
|
13
|
+
* For example:
|
14
|
+
* ```
|
15
|
+
* if (response instanceof CacheSet.Error) {
|
16
|
+
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
17
|
+
* // `CacheSet.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 {
|
23
|
+
}
|
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
|
+
/**
|
32
|
+
* Indicates a Successful cache set request.
|
33
|
+
*/
|
34
|
+
export declare class Success extends Success_base {
|
35
|
+
}
|
36
|
+
declare class _Error extends Response {
|
37
|
+
protected _innerException: SdkError;
|
38
|
+
constructor(_innerException: SdkError);
|
39
|
+
}
|
40
|
+
declare const Error_base: {
|
41
|
+
new (...args: any[]): {
|
42
|
+
_innerException: SdkError;
|
43
|
+
message(): string;
|
44
|
+
innerException(): SdkError;
|
45
|
+
errorCode(): import("../../errors/errors").MomentoErrorCode;
|
46
|
+
toString(): string;
|
47
|
+
};
|
48
|
+
} & typeof _Error;
|
49
|
+
/**
|
50
|
+
* Indicates that an error occurred during the cache set request.
|
51
|
+
*
|
52
|
+
* This response object includes the following fields that you can use to determine
|
53
|
+
* how you would like to handle the error:
|
54
|
+
*
|
55
|
+
* - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
|
56
|
+
* - `message()` - a human-readable description of the error
|
57
|
+
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
58
|
+
*/
|
59
|
+
export declare class Error extends Error_base {
|
60
|
+
}
|
61
|
+
export {};
|
@@ -0,0 +1,54 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Error = exports.Success = exports.Response = void 0;
|
4
|
+
const response_base_1 = require("./response-base");
|
5
|
+
/**
|
6
|
+
* Parent response type for a cache set 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 CacheSet.Error) {
|
18
|
+
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
19
|
+
* // `CacheSet.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 cache set request.
|
31
|
+
*/
|
32
|
+
class Success extends (0, response_base_1.ResponseSuccess)(_Success) {
|
33
|
+
}
|
34
|
+
exports.Success = Success;
|
35
|
+
class _Error extends Response {
|
36
|
+
constructor(_innerException) {
|
37
|
+
super();
|
38
|
+
this._innerException = _innerException;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
/**
|
42
|
+
* Indicates that an error occurred during the cache set request.
|
43
|
+
*
|
44
|
+
* This response object includes the following fields that you can use to determine
|
45
|
+
* how you would like to handle the error:
|
46
|
+
*
|
47
|
+
* - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
|
48
|
+
* - `message()` - a human-readable description of the error
|
49
|
+
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
50
|
+
*/
|
51
|
+
class Error extends (0, response_base_1.ResponseError)(_Error) {
|
52
|
+
}
|
53
|
+
exports.Error = Error;
|
54
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtc2V0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL21lc3NhZ2VzL3Jlc3BvbnNlcy9jYWNoZS1zZXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EsbURBQTZFO0FBRTdFOzs7Ozs7Ozs7Ozs7Ozs7Ozs7R0FrQkc7QUFDSCxNQUFzQixRQUFTLFNBQVEsNEJBQVk7Q0FBRztBQUF0RCw0QkFBc0Q7QUFFdEQsTUFBTSxRQUFTLFNBQVEsUUFBUTtDQUFHO0FBRWxDOztHQUVHO0FBQ0gsTUFBYSxPQUFRLFNBQVEsSUFBQSwrQkFBZSxFQUF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nJlZC5cbiAqIC0gYG1lc3NhZ2UoKWAgLSBhIGh1bWFuLXJlYWRhYmxlIGRlc2NyaXB0aW9uIG9mIHRoZSBlcnJvclxuICogLSBgaW5uZXJFeGNlcHRpb24oKWAgLSB0aGUgb3JpZ2luYWwgZXJyb3IgdGhhdCBjYXVzZWQgdGhlIGZhaWx1cmU7IGNhbiBiZSByZS10aHJvd24uXG4gKi9cbmV4cG9ydCBjbGFzcyBFcnJvciBleHRlbmRzIFJlc3BvbnNlRXJyb3IoX0Vycm9yKSB7fVxuIl19
|
@@ -0,0 +1,107 @@
|
|
1
|
+
import { ResponseBase } from './response-base';
|
2
|
+
import { SdkError } from '../../errors/errors';
|
3
|
+
import { _SortedSetElement } from './grpc-response-types';
|
4
|
+
/**
|
5
|
+
* Parent response type for a sorted set fetch request. The
|
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 CacheSortedSetFetch.Error) {
|
18
|
+
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
19
|
+
* // `CacheSortedSetFetch.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 {
|
25
|
+
}
|
26
|
+
declare class _Hit extends Response {
|
27
|
+
private readonly elements;
|
28
|
+
private readonly _displayListSizeLimit;
|
29
|
+
constructor(elements: _SortedSetElement[]);
|
30
|
+
/**
|
31
|
+
* Returns the elements as an array of objects, each containing a `value` and `score` field.
|
32
|
+
* The value is a byte array, and the score is a number.
|
33
|
+
* @returns {{value: Uint8Array; score: number}[]}
|
34
|
+
*/
|
35
|
+
valueArrayUint8Elements(): {
|
36
|
+
value: Uint8Array;
|
37
|
+
score: number;
|
38
|
+
}[];
|
39
|
+
/**
|
40
|
+
* Returns the elements as an array of objects, each containing a `value` and `score` field.
|
41
|
+
* The value is a utf-8 string, decoded from the underlying byte array, and the score is a number.
|
42
|
+
* @returns {{value: string; score: number}[]}
|
43
|
+
*/
|
44
|
+
valueArrayStringElements(): {
|
45
|
+
value: string;
|
46
|
+
score: number;
|
47
|
+
}[];
|
48
|
+
/**
|
49
|
+
* Returns the elements as an array of objects, each containing a `value` and `score` field.
|
50
|
+
* The value is a utf-8 string, decoded from the underlying byte array, and the score is a number.
|
51
|
+
* This is a convenience alias for {valueArrayStringNumber}.
|
52
|
+
* @returns {value: string; score: number}[]
|
53
|
+
*/
|
54
|
+
valueArray(): {
|
55
|
+
value: string;
|
56
|
+
score: number;
|
57
|
+
}[];
|
58
|
+
private truncateValueStrings;
|
59
|
+
toString(): string;
|
60
|
+
}
|
61
|
+
declare const Hit_base: {
|
62
|
+
new (...args: any[]): {};
|
63
|
+
} & typeof _Hit;
|
64
|
+
/**
|
65
|
+
* Indicates that the requested data was successfully retrieved from the cache. Provides
|
66
|
+
* `value*` accessors to retrieve the data in the appropriate format.
|
67
|
+
*/
|
68
|
+
export declare class Hit extends Hit_base {
|
69
|
+
}
|
70
|
+
declare class _Miss extends Response {
|
71
|
+
}
|
72
|
+
declare const Miss_base: {
|
73
|
+
new (...args: any[]): {
|
74
|
+
readonly is_miss: boolean;
|
75
|
+
};
|
76
|
+
} & typeof _Miss;
|
77
|
+
/**
|
78
|
+
* Indicates that the requested data was not available in the cache.
|
79
|
+
*/
|
80
|
+
export declare class Miss extends Miss_base {
|
81
|
+
}
|
82
|
+
declare class _Error extends Response {
|
83
|
+
protected _innerException: SdkError;
|
84
|
+
constructor(_innerException: SdkError);
|
85
|
+
}
|
86
|
+
declare const Error_base: {
|
87
|
+
new (...args: any[]): {
|
88
|
+
_innerException: SdkError;
|
89
|
+
message(): string;
|
90
|
+
innerException(): SdkError;
|
91
|
+
errorCode(): import("../../errors/errors").MomentoErrorCode;
|
92
|
+
toString(): string;
|
93
|
+
};
|
94
|
+
} & typeof _Error;
|
95
|
+
/**
|
96
|
+
* Indicates that an error occurred during the dictionary fetch request.
|
97
|
+
*
|
98
|
+
* This response object includes the following fields that you can use to determine
|
99
|
+
* how you would like to handle the error:
|
100
|
+
*
|
101
|
+
* - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
|
102
|
+
* - `message()` - a human-readable description of the error
|
103
|
+
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
104
|
+
*/
|
105
|
+
export declare class Error extends Error_base {
|
106
|
+
}
|
107
|
+
export {};
|
@@ -0,0 +1,124 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Error = exports.Miss = exports.Hit = exports.Response = void 0;
|
4
|
+
const response_base_1 = require("./response-base");
|
5
|
+
const TEXT_DECODER = new TextDecoder();
|
6
|
+
/**
|
7
|
+
* Parent response type for a sorted set fetch request. The
|
8
|
+
* response object is resolved to a type-safe object of one of
|
9
|
+
* the following subtypes:
|
10
|
+
*
|
11
|
+
* - {Hit}
|
12
|
+
* - {Miss}
|
13
|
+
* - {Error}
|
14
|
+
*
|
15
|
+
* `instanceof` type guards can be used to operate on the appropriate subtype.
|
16
|
+
* @example
|
17
|
+
* For example:
|
18
|
+
* ```
|
19
|
+
* if (response instanceof CacheSortedSetFetch.Error) {
|
20
|
+
* // Handle error as appropriate. The compiler will smart-cast `response` to type
|
21
|
+
* // `CacheSortedSetFetch.Error` in this block, so you will have access to the properties
|
22
|
+
* // of the Error class; e.g. `response.errorCode()`.
|
23
|
+
* }
|
24
|
+
* ```
|
25
|
+
*/
|
26
|
+
class Response extends response_base_1.ResponseBase {
|
27
|
+
}
|
28
|
+
exports.Response = Response;
|
29
|
+
class _Hit extends Response {
|
30
|
+
constructor(elements) {
|
31
|
+
super();
|
32
|
+
this._displayListSizeLimit = 5;
|
33
|
+
this.elements = elements;
|
34
|
+
}
|
35
|
+
/**
|
36
|
+
* Returns the elements as an array of objects, each containing a `value` and `score` field.
|
37
|
+
* The value is a byte array, and the score is a number.
|
38
|
+
* @returns {{value: Uint8Array; score: number}[]}
|
39
|
+
*/
|
40
|
+
valueArrayUint8Elements() {
|
41
|
+
return this.elements.map(item => {
|
42
|
+
return {
|
43
|
+
value: item.value,
|
44
|
+
score: item.score,
|
45
|
+
};
|
46
|
+
});
|
47
|
+
}
|
48
|
+
/**
|
49
|
+
* Returns the elements as an array of objects, each containing a `value` and `score` field.
|
50
|
+
* The value is a utf-8 string, decoded from the underlying byte array, and the score is a number.
|
51
|
+
* @returns {{value: string; score: number}[]}
|
52
|
+
*/
|
53
|
+
valueArrayStringElements() {
|
54
|
+
return this.elements.map(item => {
|
55
|
+
return {
|
56
|
+
value: TEXT_DECODER.decode(item.value),
|
57
|
+
score: item.score,
|
58
|
+
};
|
59
|
+
});
|
60
|
+
}
|
61
|
+
/**
|
62
|
+
* Returns the elements as an array of objects, each containing a `value` and `score` field.
|
63
|
+
* The value is a utf-8 string, decoded from the underlying byte array, and the score is a number.
|
64
|
+
* This is a convenience alias for {valueArrayStringNumber}.
|
65
|
+
* @returns {value: string; score: number}[]
|
66
|
+
*/
|
67
|
+
valueArray() {
|
68
|
+
return this.valueArrayStringElements();
|
69
|
+
}
|
70
|
+
truncateValueStrings() {
|
71
|
+
const keyValueArray = this.valueArrayStringElements();
|
72
|
+
const elements = [];
|
73
|
+
if (keyValueArray.length <= this._displayListSizeLimit) {
|
74
|
+
keyValueArray.forEach(element => {
|
75
|
+
elements.push(`${element.value}: ${element.score}`);
|
76
|
+
});
|
77
|
+
}
|
78
|
+
else {
|
79
|
+
const slicedArray = keyValueArray.slice(0, this._displayListSizeLimit);
|
80
|
+
slicedArray.forEach(element => {
|
81
|
+
elements.push(`${element.value}: ${element.score}`);
|
82
|
+
});
|
83
|
+
}
|
84
|
+
return elements.join(', ');
|
85
|
+
}
|
86
|
+
toString() {
|
87
|
+
return `${super.toString()}: valueArrayStringElements: ${this.truncateValueStrings()}`;
|
88
|
+
}
|
89
|
+
}
|
90
|
+
/**
|
91
|
+
* Indicates that the requested data was successfully retrieved from the cache. Provides
|
92
|
+
* `value*` accessors to retrieve the data in the appropriate format.
|
93
|
+
*/
|
94
|
+
class Hit extends (0, response_base_1.ResponseHit)(_Hit) {
|
95
|
+
}
|
96
|
+
exports.Hit = Hit;
|
97
|
+
class _Miss extends Response {
|
98
|
+
}
|
99
|
+
/**
|
100
|
+
* Indicates that the requested data was not available in the cache.
|
101
|
+
*/
|
102
|
+
class Miss extends (0, response_base_1.ResponseMiss)(_Miss) {
|
103
|
+
}
|
104
|
+
exports.Miss = Miss;
|
105
|
+
class _Error extends Response {
|
106
|
+
constructor(_innerException) {
|
107
|
+
super();
|
108
|
+
this._innerException = _innerException;
|
109
|
+
}
|
110
|
+
}
|
111
|
+
/**
|
112
|
+
* Indicates that an error occurred during the dictionary fetch request.
|
113
|
+
*
|
114
|
+
* This response object includes the following fields that you can use to determine
|
115
|
+
* how you would like to handle the error:
|
116
|
+
*
|
117
|
+
* - `errorCode()` - a unique Momento error code indicating the type of error that occurred.
|
118
|
+
* - `message()` - a human-readable description of the error
|
119
|
+
* - `innerException()` - the original error that caused the failure; can be re-thrown.
|
120
|
+
*/
|
121
|
+
class Error extends (0, response_base_1.ResponseError)(_Error) {
|
122
|
+
}
|
123
|
+
exports.Error = Error;
|
124
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FjaGUtc29ydGVkLXNldC1mZXRjaC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9tZXNzYWdlcy9yZXNwb25zZXMvY2FjaGUtc29ydGVkLXNldC1mZXRjaC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxtREFLeUI7QUFJekIsTU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