@ekhein/lamda-node-sdk 2.1.7 → 2.1.9

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/main.d.ts CHANGED
@@ -33,17 +33,3 @@ export declare class Device {
33
33
  };
34
34
  }): Promise<any>;
35
35
  }
36
- export declare class Storage {
37
- private readonly container;
38
- private readonly $;
39
- constructor(container: string, $: Device);
40
- set(key: string, data: any): Promise<boolean>;
41
- setex(key: string, data: any, ttl: number): Promise<boolean>;
42
- setnx(key: string, data: any): Promise<boolean>;
43
- expire(key: string, ttl: number): Promise<boolean>;
44
- get<T = any>(key: string, defaultValue?: any): Promise<T>;
45
- ttl(key: string): Promise<number>;
46
- exists(key: string): Promise<boolean>;
47
- delete(key: string): Promise<boolean>;
48
- clear(): Promise<boolean>;
49
- }
package/dist/main.js CHANGED
@@ -9,8 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Storage = exports.Device = void 0;
13
- const msgpackr_1 = require("msgpackr");
12
+ exports.Device = void 0;
14
13
  const nice_grpc_1 = require("nice-grpc");
15
14
  const inject_decorator_1 = require("./decorators/inject.decorator");
16
15
  const android_intent_1 = require("./constants/android.intent");
@@ -154,64 +153,3 @@ __decorate([
154
153
  (0, inject_decorator_1.Inject)(services_1.SettingsDefinition),
155
154
  __metadata("design:type", Object)
156
155
  ], Device.prototype, "Settings", void 0);
157
- class Storage {
158
- container;
159
- $;
160
- constructor(container, $) {
161
- this.container = container;
162
- this.$ = $;
163
- }
164
- async set(key, data) {
165
- const value = (0, msgpackr_1.pack)(data);
166
- return this.$.Storage
167
- .set({ container: this.container, key, value })
168
- .then(async (r) => r.value);
169
- }
170
- async setex(key, data, ttl) {
171
- const value = (0, msgpackr_1.pack)(data);
172
- return this.$.Storage
173
- .setex({ container: this.container, key, value, ttl })
174
- .then(async (r) => r.value);
175
- }
176
- async setnx(key, data) {
177
- const value = (0, msgpackr_1.pack)(data);
178
- return this.$.Storage
179
- .setnx({ container: this.container, key, value })
180
- .then(async (r) => r.value);
181
- }
182
- async expire(key, ttl) {
183
- return this.$.Storage
184
- .expire({ container: this.container, key, ttl })
185
- .then(async (r) => r.value);
186
- }
187
- async get(key, defaultValue) {
188
- return this.$.Storage
189
- .get({ container: this.container, key })
190
- .then(async (r) => {
191
- if (r.value.length)
192
- return (0, msgpackr_1.unpack)(r.value);
193
- return defaultValue;
194
- });
195
- }
196
- async ttl(key) {
197
- return this.$.Storage
198
- .ttl({ container: this.container, key })
199
- .then(r => r.value);
200
- }
201
- async exists(key) {
202
- return this.$.Storage
203
- .exists({ container: this.container, key })
204
- .then(async (r) => r.value);
205
- }
206
- async delete(key) {
207
- return this.$.Storage
208
- .delete({ container: this.container, key })
209
- .then(async (r) => r.value);
210
- }
211
- async clear() {
212
- return this.$.Storage
213
- .clearContainer({ container: this.container })
214
- .then(async (r) => r.value);
215
- }
216
- }
217
- exports.Storage = Storage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ekhein/lamda-node-sdk",
3
- "version": "2.1.7",
3
+ "version": "2.1.9",
4
4
  "author": "ekhein",
5
5
  "license": "MIT",
6
6
  "main": "./dist/main.js",
@@ -17,7 +17,6 @@
17
17
  "dependencies": {
18
18
  "@bufbuild/protobuf": "^2.4.0",
19
19
  "long": "^5.3.2",
20
- "msgpackr": "^1.11.5",
21
20
  "nice-grpc": "^2.1.12",
22
21
  "nice-grpc-common": "^2.0.2",
23
22
  "protobufjs": "^7.5.2"