@cyberskill/shared 1.50.0 → 1.52.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/_tsup-dts-rollup.d.cts +100 -129
- package/dist/_tsup-dts-rollup.d.ts +100 -129
- package/dist/cli.cjs +1 -2146
- package/dist/cli.d.cts +1 -2
- package/dist/cli.d.ts +1 -2
- package/dist/cli.js +1 -2066
- package/dist/configs/commitlint/base.cjs +1 -64
- package/dist/configs/commitlint/base.js +1 -7
- package/dist/configs/eslint/base.cjs +1 -121
- package/dist/configs/eslint/base.js +1 -52
- package/dist/configs/eslint/nestjs.cjs +1 -155
- package/dist/configs/eslint/nestjs.js +1 -85
- package/dist/configs/eslint/nextjs.cjs +1 -155
- package/dist/configs/eslint/nextjs.js +1 -85
- package/dist/configs/eslint/nodejs.cjs +1 -156
- package/dist/configs/eslint/nodejs.js +1 -86
- package/dist/configs/eslint/vite-react.cjs +1 -159
- package/dist/configs/eslint/vite-react.js +1 -89
- package/dist/configs/graphql/graphql-codegen.cjs +1 -125
- package/dist/configs/graphql/graphql-codegen.js +1 -64
- package/dist/configs/graphql/index.cjs +1 -126
- package/dist/configs/graphql/index.js +1 -64
- package/dist/configs/i18n/react/i18next.cjs +1 -80
- package/dist/configs/i18n/react/i18next.js +1 -7
- package/dist/configs/i18n/react/index.cjs +1 -81
- package/dist/configs/i18n/react/index.js +1 -7
- package/dist/configs/index.cjs +1 -232
- package/dist/configs/index.js +1 -166
- package/dist/configs/lint-staged/base.cjs +1 -64
- package/dist/configs/lint-staged/base.js +1 -7
- package/dist/configs/vitest/react/e2e.cjs +1 -128
- package/dist/configs/vitest/react/e2e.js +1 -59
- package/dist/configs/vitest/react/unit.cjs +1 -305
- package/dist/configs/vitest/react/unit.js +1 -228
- package/dist/configs/vitest/react/unit.setup.cjs +1 -60
- package/dist/configs/vitest/react/unit.setup.js +1 -8
- package/dist/constants/index.cjs +1 -677
- package/dist/constants/index.d.cts +8 -3
- package/dist/constants/index.d.ts +8 -3
- package/dist/constants/index.js +1 -468
- package/dist/constants/path.cjs +1 -422
- package/dist/constants/path.d.cts +8 -3
- package/dist/constants/path.d.ts +8 -3
- package/dist/constants/path.js +1 -217
- package/dist/constants/response-status.cjs +1 -313
- package/dist/constants/response-status.js +1 -252
- package/dist/index.cjs +1 -4559
- package/dist/index.d.cts +13 -8
- package/dist/index.d.ts +13 -8
- package/dist/index.js +1 -4142
- package/dist/nodejs/index.cjs +1 -2138
- package/dist/nodejs/index.js +1 -2054
- package/dist/nodejs/mongo.cjs +1 -2137
- package/dist/nodejs/mongo.js +1 -2054
- package/dist/react/apollo-client.cjs +1 -177
- package/dist/react/apollo-client.js +1 -116
- package/dist/react/index.cjs +1 -990
- package/dist/react/index.js +1 -876
- package/dist/react/loading.cjs +1 -301
- package/dist/react/loading.js +1 -216
- package/dist/react/next-intl.cjs +1 -744
- package/dist/react/next-intl.js +1 -655
- package/dist/react/storage.cjs +1 -631
- package/dist/react/storage.js +1 -558
- package/dist/typescript/api-response.cjs +1 -48
- package/dist/typescript/apollo.cjs +1 -48
- package/dist/typescript/command.cjs +1 -68
- package/dist/typescript/command.d.cts +3 -0
- package/dist/typescript/command.d.ts +3 -0
- package/dist/typescript/command.js +1 -7
- package/dist/typescript/config.cjs +1 -48
- package/dist/typescript/fs.cjs +1 -48
- package/dist/typescript/graphql-codegen.cjs +1 -48
- package/dist/typescript/index.cjs +1 -175
- package/dist/typescript/index.d.cts +3 -0
- package/dist/typescript/index.d.ts +3 -0
- package/dist/typescript/index.js +1 -151
- package/dist/typescript/loading.cjs +1 -48
- package/dist/typescript/log.cjs +1 -48
- package/dist/typescript/mongo.cjs +1 -164
- package/dist/typescript/mongo.js +1 -145
- package/dist/typescript/next-intl.cjs +1 -48
- package/dist/typescript/react.cjs +1 -48
- package/dist/typescript/serializer.cjs +1 -48
- package/dist/typescript/string.cjs +1 -48
- package/dist/utils/command.cjs +1 -1387
- package/dist/utils/command.d.cts +2 -2
- package/dist/utils/command.d.ts +2 -2
- package/dist/utils/command.js +1 -1287
- package/dist/utils/common.cjs +1 -300
- package/dist/utils/common.js +1 -219
- package/dist/utils/config.cjs +1 -146
- package/dist/utils/config.js +1 -89
- package/dist/utils/fs.cjs +1 -132
- package/dist/utils/fs.js +1 -47
- package/dist/utils/index-nodejs.cjs +1 -1752
- package/dist/utils/index-nodejs.d.cts +2 -5
- package/dist/utils/index-nodejs.d.ts +2 -5
- package/dist/utils/index-nodejs.js +1 -1581
- package/dist/utils/index.cjs +1 -727
- package/dist/utils/index.js +1 -625
- package/dist/utils/log.cjs +1 -330
- package/dist/utils/log.js +1 -269
- package/dist/utils/package.cjs +1 -941
- package/dist/utils/package.js +1 -857
- package/dist/utils/path.cjs +1 -291
- package/dist/utils/path.d.cts +0 -3
- package/dist/utils/path.d.ts +0 -3
- package/dist/utils/path.js +1 -191
- package/dist/utils/serializer.cjs +1 -91
- package/dist/utils/serializer.js +1 -30
- package/dist/utils/storage-client.cjs +1 -349
- package/dist/utils/storage-client.js +1 -276
- package/dist/utils/storage-server.cjs +1 -636
- package/dist/utils/storage-server.js +1 -550
- package/dist/utils/string.cjs +1 -152
- package/dist/utils/string.js +1 -75
- package/dist/utils/validate.cjs +1 -90
- package/dist/utils/validate.js +1 -33
- package/package.json +15 -13
- /package/{src/public → public}/favicon/android-icon-144x144.png +0 -0
- /package/{src/public → public}/favicon/android-icon-192x192.png +0 -0
- /package/{src/public → public}/favicon/android-icon-36x36.png +0 -0
- /package/{src/public → public}/favicon/android-icon-48x48.png +0 -0
- /package/{src/public → public}/favicon/android-icon-72x72.png +0 -0
- /package/{src/public → public}/favicon/android-icon-96x96.png +0 -0
- /package/{src/public → public}/favicon/apple-icon-114x114.png +0 -0
- /package/{src/public → public}/favicon/apple-icon-120x120.png +0 -0
- /package/{src/public → public}/favicon/apple-icon-144x144.png +0 -0
- /package/{src/public → public}/favicon/apple-icon-152x152.png +0 -0
- /package/{src/public → public}/favicon/apple-icon-180x180.png +0 -0
- /package/{src/public → public}/favicon/apple-icon-57x57.png +0 -0
- /package/{src/public → public}/favicon/apple-icon-60x60.png +0 -0
- /package/{src/public → public}/favicon/apple-icon-72x72.png +0 -0
- /package/{src/public → public}/favicon/apple-icon-76x76.png +0 -0
- /package/{src/public → public}/favicon/apple-icon-precomposed.png +0 -0
- /package/{src/public → public}/favicon/apple-icon.png +0 -0
- /package/{src/public → public}/favicon/browserconfig.xml +0 -0
- /package/{src/public → public}/favicon/favicon-16x16.png +0 -0
- /package/{src/public → public}/favicon/favicon-32x32.png +0 -0
- /package/{src/public → public}/favicon/favicon-96x96.png +0 -0
- /package/{src/public → public}/favicon/favicon.ico +0 -0
- /package/{src/public → public}/favicon/manifest.json +0 -0
- /package/{src/public → public}/favicon/ms-icon-144x144.png +0 -0
- /package/{src/public → public}/favicon/ms-icon-150x150.png +0 -0
- /package/{src/public → public}/favicon/ms-icon-310x310.png +0 -0
- /package/{src/public → public}/favicon/ms-icon-70x70.png +0 -0
|
@@ -1,349 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
3
|
-
try {
|
|
4
|
-
var info = gen[key](arg);
|
|
5
|
-
var value = info.value;
|
|
6
|
-
} catch (error) {
|
|
7
|
-
reject(error);
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
if (info.done) {
|
|
11
|
-
resolve(value);
|
|
12
|
-
} else {
|
|
13
|
-
Promise.resolve(value).then(_next, _throw);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
function _async_to_generator(fn) {
|
|
17
|
-
return function() {
|
|
18
|
-
var self = this, args = arguments;
|
|
19
|
-
return new Promise(function(resolve, reject) {
|
|
20
|
-
var gen = fn.apply(self, args);
|
|
21
|
-
function _next(value) {
|
|
22
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
23
|
-
}
|
|
24
|
-
function _throw(err) {
|
|
25
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
26
|
-
}
|
|
27
|
-
_next(undefined);
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function _type_of(obj) {
|
|
32
|
-
"@swc/helpers - typeof";
|
|
33
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
34
|
-
}
|
|
35
|
-
function _ts_generator(thisArg, body) {
|
|
36
|
-
var f, y, t, g, _ = {
|
|
37
|
-
label: 0,
|
|
38
|
-
sent: function() {
|
|
39
|
-
if (t[0] & 1) throw t[1];
|
|
40
|
-
return t[1];
|
|
41
|
-
},
|
|
42
|
-
trys: [],
|
|
43
|
-
ops: []
|
|
44
|
-
};
|
|
45
|
-
return g = {
|
|
46
|
-
next: verb(0),
|
|
47
|
-
"throw": verb(1),
|
|
48
|
-
"return": verb(2)
|
|
49
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
50
|
-
return this;
|
|
51
|
-
}), g;
|
|
52
|
-
function verb(n) {
|
|
53
|
-
return function(v) {
|
|
54
|
-
return step([
|
|
55
|
-
n,
|
|
56
|
-
v
|
|
57
|
-
]);
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
function step(op) {
|
|
61
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
62
|
-
while(_)try {
|
|
63
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
64
|
-
if (y = 0, t) op = [
|
|
65
|
-
op[0] & 2,
|
|
66
|
-
t.value
|
|
67
|
-
];
|
|
68
|
-
switch(op[0]){
|
|
69
|
-
case 0:
|
|
70
|
-
case 1:
|
|
71
|
-
t = op;
|
|
72
|
-
break;
|
|
73
|
-
case 4:
|
|
74
|
-
_.label++;
|
|
75
|
-
return {
|
|
76
|
-
value: op[1],
|
|
77
|
-
done: false
|
|
78
|
-
};
|
|
79
|
-
case 5:
|
|
80
|
-
_.label++;
|
|
81
|
-
y = op[1];
|
|
82
|
-
op = [
|
|
83
|
-
0
|
|
84
|
-
];
|
|
85
|
-
continue;
|
|
86
|
-
case 7:
|
|
87
|
-
op = _.ops.pop();
|
|
88
|
-
_.trys.pop();
|
|
89
|
-
continue;
|
|
90
|
-
default:
|
|
91
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
92
|
-
_ = 0;
|
|
93
|
-
continue;
|
|
94
|
-
}
|
|
95
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
96
|
-
_.label = op[1];
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
99
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
100
|
-
_.label = t[1];
|
|
101
|
-
t = op;
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
if (t && _.label < t[2]) {
|
|
105
|
-
_.label = t[2];
|
|
106
|
-
_.ops.push(op);
|
|
107
|
-
break;
|
|
108
|
-
}
|
|
109
|
-
if (t[2]) _.ops.pop();
|
|
110
|
-
_.trys.pop();
|
|
111
|
-
continue;
|
|
112
|
-
}
|
|
113
|
-
op = body.call(thisArg, _);
|
|
114
|
-
} catch (e) {
|
|
115
|
-
op = [
|
|
116
|
-
6,
|
|
117
|
-
e
|
|
118
|
-
];
|
|
119
|
-
y = 0;
|
|
120
|
-
} finally{
|
|
121
|
-
f = t = 0;
|
|
122
|
-
}
|
|
123
|
-
if (op[0] & 5) throw op[1];
|
|
124
|
-
return {
|
|
125
|
-
value: op[0] ? op[1] : void 0,
|
|
126
|
-
done: true
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
var __create = Object.create;
|
|
131
|
-
var __defProp = Object.defineProperty;
|
|
132
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
133
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
134
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
135
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
136
|
-
var __export = function(target, all) {
|
|
137
|
-
for(var name in all)__defProp(target, name, {
|
|
138
|
-
get: all[name],
|
|
139
|
-
enumerable: true
|
|
140
|
-
});
|
|
141
|
-
};
|
|
142
|
-
var __copyProps = function(to, from, except, desc) {
|
|
143
|
-
if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
|
|
144
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
145
|
-
try {
|
|
146
|
-
var _loop = function() {
|
|
147
|
-
var key = _step.value;
|
|
148
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
149
|
-
get: function() {
|
|
150
|
-
return from[key];
|
|
151
|
-
},
|
|
152
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
153
|
-
});
|
|
154
|
-
};
|
|
155
|
-
for(var _iterator = __getOwnPropNames(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
|
|
156
|
-
} catch (err) {
|
|
157
|
-
_didIteratorError = true;
|
|
158
|
-
_iteratorError = err;
|
|
159
|
-
} finally{
|
|
160
|
-
try {
|
|
161
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
162
|
-
_iterator.return();
|
|
163
|
-
}
|
|
164
|
-
} finally{
|
|
165
|
-
if (_didIteratorError) {
|
|
166
|
-
throw _iteratorError;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
return to;
|
|
172
|
-
};
|
|
173
|
-
var __toESM = function(mod, isNodeMode, target) {
|
|
174
|
-
return target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(// If the importer is in node compatibility mode or this is not an ESM
|
|
175
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
176
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
177
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
178
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
179
|
-
value: mod,
|
|
180
|
-
enumerable: true
|
|
181
|
-
}) : target, mod);
|
|
182
|
-
};
|
|
183
|
-
var __toCommonJS = function(mod) {
|
|
184
|
-
return __copyProps(__defProp({}, "__esModule", {
|
|
185
|
-
value: true
|
|
186
|
-
}), mod);
|
|
187
|
-
};
|
|
188
|
-
// src/utils/storage-client.ts
|
|
189
|
-
var storage_client_exports = {};
|
|
190
|
-
__export(storage_client_exports, {
|
|
191
|
-
storageClient: function() {
|
|
192
|
-
return storageClient;
|
|
193
|
-
}
|
|
194
|
-
});
|
|
195
|
-
module.exports = __toCommonJS(storage_client_exports);
|
|
196
|
-
var import_localforage = __toESM(require("localforage"), 1);
|
|
197
|
-
var storageClient = {
|
|
198
|
-
get: function get(key) {
|
|
199
|
-
return _async_to_generator(function() {
|
|
200
|
-
var error;
|
|
201
|
-
return _ts_generator(this, function(_state) {
|
|
202
|
-
switch(_state.label){
|
|
203
|
-
case 0:
|
|
204
|
-
_state.trys.push([
|
|
205
|
-
0,
|
|
206
|
-
2,
|
|
207
|
-
,
|
|
208
|
-
3
|
|
209
|
-
]);
|
|
210
|
-
return [
|
|
211
|
-
4,
|
|
212
|
-
import_localforage.default.getItem(key)
|
|
213
|
-
];
|
|
214
|
-
case 1:
|
|
215
|
-
return [
|
|
216
|
-
2,
|
|
217
|
-
_state.sent()
|
|
218
|
-
];
|
|
219
|
-
case 2:
|
|
220
|
-
error = _state.sent();
|
|
221
|
-
console.error('❌ [Storage:get] Error getting key "'.concat(key, '":'), error);
|
|
222
|
-
return [
|
|
223
|
-
2,
|
|
224
|
-
null
|
|
225
|
-
];
|
|
226
|
-
case 3:
|
|
227
|
-
return [
|
|
228
|
-
2
|
|
229
|
-
];
|
|
230
|
-
}
|
|
231
|
-
});
|
|
232
|
-
})();
|
|
233
|
-
},
|
|
234
|
-
set: function set(key, value) {
|
|
235
|
-
return _async_to_generator(function() {
|
|
236
|
-
var error;
|
|
237
|
-
return _ts_generator(this, function(_state) {
|
|
238
|
-
switch(_state.label){
|
|
239
|
-
case 0:
|
|
240
|
-
_state.trys.push([
|
|
241
|
-
0,
|
|
242
|
-
2,
|
|
243
|
-
,
|
|
244
|
-
3
|
|
245
|
-
]);
|
|
246
|
-
return [
|
|
247
|
-
4,
|
|
248
|
-
import_localforage.default.setItem(key, value)
|
|
249
|
-
];
|
|
250
|
-
case 1:
|
|
251
|
-
_state.sent();
|
|
252
|
-
return [
|
|
253
|
-
3,
|
|
254
|
-
3
|
|
255
|
-
];
|
|
256
|
-
case 2:
|
|
257
|
-
error = _state.sent();
|
|
258
|
-
console.error('❌ [Storage:set] Error setting key "'.concat(key, '":'), error);
|
|
259
|
-
return [
|
|
260
|
-
3,
|
|
261
|
-
3
|
|
262
|
-
];
|
|
263
|
-
case 3:
|
|
264
|
-
return [
|
|
265
|
-
2
|
|
266
|
-
];
|
|
267
|
-
}
|
|
268
|
-
});
|
|
269
|
-
})();
|
|
270
|
-
},
|
|
271
|
-
remove: function remove(key) {
|
|
272
|
-
return _async_to_generator(function() {
|
|
273
|
-
var error;
|
|
274
|
-
return _ts_generator(this, function(_state) {
|
|
275
|
-
switch(_state.label){
|
|
276
|
-
case 0:
|
|
277
|
-
_state.trys.push([
|
|
278
|
-
0,
|
|
279
|
-
2,
|
|
280
|
-
,
|
|
281
|
-
3
|
|
282
|
-
]);
|
|
283
|
-
return [
|
|
284
|
-
4,
|
|
285
|
-
import_localforage.default.removeItem(key)
|
|
286
|
-
];
|
|
287
|
-
case 1:
|
|
288
|
-
_state.sent();
|
|
289
|
-
return [
|
|
290
|
-
3,
|
|
291
|
-
3
|
|
292
|
-
];
|
|
293
|
-
case 2:
|
|
294
|
-
error = _state.sent();
|
|
295
|
-
console.error('❌ [Storage:remove] Error removing key "'.concat(key, '":'), error);
|
|
296
|
-
return [
|
|
297
|
-
3,
|
|
298
|
-
3
|
|
299
|
-
];
|
|
300
|
-
case 3:
|
|
301
|
-
return [
|
|
302
|
-
2
|
|
303
|
-
];
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
|
-
})();
|
|
307
|
-
},
|
|
308
|
-
keys: function keys() {
|
|
309
|
-
return _async_to_generator(function() {
|
|
310
|
-
var keys, error;
|
|
311
|
-
return _ts_generator(this, function(_state) {
|
|
312
|
-
switch(_state.label){
|
|
313
|
-
case 0:
|
|
314
|
-
_state.trys.push([
|
|
315
|
-
0,
|
|
316
|
-
2,
|
|
317
|
-
,
|
|
318
|
-
3
|
|
319
|
-
]);
|
|
320
|
-
return [
|
|
321
|
-
4,
|
|
322
|
-
import_localforage.default.keys()
|
|
323
|
-
];
|
|
324
|
-
case 1:
|
|
325
|
-
keys = _state.sent();
|
|
326
|
-
return [
|
|
327
|
-
2,
|
|
328
|
-
keys !== null && keys !== void 0 ? keys : []
|
|
329
|
-
];
|
|
330
|
-
case 2:
|
|
331
|
-
error = _state.sent();
|
|
332
|
-
console.error("❌ [Storage:keys] Error getting keys:", error);
|
|
333
|
-
return [
|
|
334
|
-
2,
|
|
335
|
-
[]
|
|
336
|
-
];
|
|
337
|
-
case 3:
|
|
338
|
-
return [
|
|
339
|
-
2
|
|
340
|
-
];
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
|
-
})();
|
|
344
|
-
}
|
|
345
|
-
};
|
|
346
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
347
|
-
0 && (module.exports = {
|
|
348
|
-
storageClient: storageClient
|
|
349
|
-
});
|
|
1
|
+
"use strict";function e(e,r,t,n,o,u,a){try{var c=e[u](a);var s=c.value}catch(e){t(e);return}if(c.done){r(s)}else{Promise.resolve(s).then(n,o)}}function r(r){return function(){var t=this,n=arguments;return new Promise(function(o,u){var a=r.apply(t,n);function c(r){e(a,o,u,c,s,"next",r)}function s(r){e(a,o,u,c,s,"throw",r)}c(undefined)})}}function t(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function n(e,r){var t,n,o,u,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]};return u={next:c(0),"throw":c(1),"return":c(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(e){return function(r){return s([e,r])}}function s(u){if(t)throw new TypeError("Generator is already executing.");while(a)try{if(t=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=r.call(e,a)}catch(e){u=[6,e];n=0}finally{t=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}var o=Object.create;var u=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var s=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty;var l=function(e,r){for(var t in r)u(e,t,{get:r[t],enumerable:!0})},f=function(e,r,n,o){var s=true,l=false,f=undefined;if(r&&(typeof r==="undefined"?"undefined":t(r))=="object"||typeof r=="function")try{var y=function(){var t=v.value;!i.call(e,t)&&t!==n&&u(e,t,{get:function(){return r[t]},enumerable:!(o=a(r,t))||o.enumerable})};for(var p=c(r)[Symbol.iterator](),v;!(s=(v=p.next()).done);s=true)y()}catch(e){l=true;f=e}finally{try{if(!s&&p.return!=null){p.return()}}finally{if(l){throw f}}}return e};var y=function(e,r,t){return t=e!=null?o(s(e)):{},f(r||!e||!e.__esModule?u(t,"default",{value:e,enumerable:!0}):t,e)},p=function(e){return f(u({},"__esModule",{value:!0}),e)};var v={};l(v,{storageClient:function(){return h}});module.exports=p(v);var b=y(require("localforage"),1),h={get:function e(e){return r(function(){var r;return n(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,b.default.getItem(e)];case 1:return[2,t.sent()];case 2:r=t.sent();return[2,(console.error('❌ [Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 3:return[2]}})})()},set:function e(e,t){return r(function(){var r;return n(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,b.default.setItem(e,t)];case 1:n.sent();return[3,3];case 2:r=n.sent();console.error('❌ [Storage:set] Error setting key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})})()},remove:function e(e){return r(function(){var r;return n(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,b.default.removeItem(e)];case 1:t.sent();return[3,3];case 2:r=t.sent();console.error('❌ [Storage:remove] Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})})()},keys:function e(){return r(function(){var e,r;return n(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,b.default.keys()];case 1:return[2,(e=t.sent())!==null&&e!==void 0?e:[]];case 2:r=t.sent();return[2,(console.error("❌ [Storage:keys] Error getting keys:",r),[])];case 3:return[2]}})})()}};0&&(module.exports={storageClient:storageClient});
|
|
@@ -1,276 +1 @@
|
|
|
1
|
-
|
|
2
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
3
|
-
try {
|
|
4
|
-
var info = gen[key](arg);
|
|
5
|
-
var value = info.value;
|
|
6
|
-
} catch (error) {
|
|
7
|
-
reject(error);
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
if (info.done) {
|
|
11
|
-
resolve(value);
|
|
12
|
-
} else {
|
|
13
|
-
Promise.resolve(value).then(_next, _throw);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
function _async_to_generator(fn) {
|
|
17
|
-
return function() {
|
|
18
|
-
var self = this, args = arguments;
|
|
19
|
-
return new Promise(function(resolve, reject) {
|
|
20
|
-
var gen = fn.apply(self, args);
|
|
21
|
-
function _next(value) {
|
|
22
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
23
|
-
}
|
|
24
|
-
function _throw(err) {
|
|
25
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
26
|
-
}
|
|
27
|
-
_next(undefined);
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function _ts_generator(thisArg, body) {
|
|
32
|
-
var f, y, t, g, _ = {
|
|
33
|
-
label: 0,
|
|
34
|
-
sent: function() {
|
|
35
|
-
if (t[0] & 1) throw t[1];
|
|
36
|
-
return t[1];
|
|
37
|
-
},
|
|
38
|
-
trys: [],
|
|
39
|
-
ops: []
|
|
40
|
-
};
|
|
41
|
-
return g = {
|
|
42
|
-
next: verb(0),
|
|
43
|
-
"throw": verb(1),
|
|
44
|
-
"return": verb(2)
|
|
45
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
46
|
-
return this;
|
|
47
|
-
}), g;
|
|
48
|
-
function verb(n) {
|
|
49
|
-
return function(v) {
|
|
50
|
-
return step([
|
|
51
|
-
n,
|
|
52
|
-
v
|
|
53
|
-
]);
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
function step(op) {
|
|
57
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
58
|
-
while(_)try {
|
|
59
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
60
|
-
if (y = 0, t) op = [
|
|
61
|
-
op[0] & 2,
|
|
62
|
-
t.value
|
|
63
|
-
];
|
|
64
|
-
switch(op[0]){
|
|
65
|
-
case 0:
|
|
66
|
-
case 1:
|
|
67
|
-
t = op;
|
|
68
|
-
break;
|
|
69
|
-
case 4:
|
|
70
|
-
_.label++;
|
|
71
|
-
return {
|
|
72
|
-
value: op[1],
|
|
73
|
-
done: false
|
|
74
|
-
};
|
|
75
|
-
case 5:
|
|
76
|
-
_.label++;
|
|
77
|
-
y = op[1];
|
|
78
|
-
op = [
|
|
79
|
-
0
|
|
80
|
-
];
|
|
81
|
-
continue;
|
|
82
|
-
case 7:
|
|
83
|
-
op = _.ops.pop();
|
|
84
|
-
_.trys.pop();
|
|
85
|
-
continue;
|
|
86
|
-
default:
|
|
87
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
88
|
-
_ = 0;
|
|
89
|
-
continue;
|
|
90
|
-
}
|
|
91
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
92
|
-
_.label = op[1];
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
96
|
-
_.label = t[1];
|
|
97
|
-
t = op;
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
100
|
-
if (t && _.label < t[2]) {
|
|
101
|
-
_.label = t[2];
|
|
102
|
-
_.ops.push(op);
|
|
103
|
-
break;
|
|
104
|
-
}
|
|
105
|
-
if (t[2]) _.ops.pop();
|
|
106
|
-
_.trys.pop();
|
|
107
|
-
continue;
|
|
108
|
-
}
|
|
109
|
-
op = body.call(thisArg, _);
|
|
110
|
-
} catch (e) {
|
|
111
|
-
op = [
|
|
112
|
-
6,
|
|
113
|
-
e
|
|
114
|
-
];
|
|
115
|
-
y = 0;
|
|
116
|
-
} finally{
|
|
117
|
-
f = t = 0;
|
|
118
|
-
}
|
|
119
|
-
if (op[0] & 5) throw op[1];
|
|
120
|
-
return {
|
|
121
|
-
value: op[0] ? op[1] : void 0,
|
|
122
|
-
done: true
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
import localForage from "localforage";
|
|
127
|
-
var storageClient = {
|
|
128
|
-
get: function get(key) {
|
|
129
|
-
return _async_to_generator(function() {
|
|
130
|
-
var error;
|
|
131
|
-
return _ts_generator(this, function(_state) {
|
|
132
|
-
switch(_state.label){
|
|
133
|
-
case 0:
|
|
134
|
-
_state.trys.push([
|
|
135
|
-
0,
|
|
136
|
-
2,
|
|
137
|
-
,
|
|
138
|
-
3
|
|
139
|
-
]);
|
|
140
|
-
return [
|
|
141
|
-
4,
|
|
142
|
-
localForage.getItem(key)
|
|
143
|
-
];
|
|
144
|
-
case 1:
|
|
145
|
-
return [
|
|
146
|
-
2,
|
|
147
|
-
_state.sent()
|
|
148
|
-
];
|
|
149
|
-
case 2:
|
|
150
|
-
error = _state.sent();
|
|
151
|
-
console.error('❌ [Storage:get] Error getting key "'.concat(key, '":'), error);
|
|
152
|
-
return [
|
|
153
|
-
2,
|
|
154
|
-
null
|
|
155
|
-
];
|
|
156
|
-
case 3:
|
|
157
|
-
return [
|
|
158
|
-
2
|
|
159
|
-
];
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
})();
|
|
163
|
-
},
|
|
164
|
-
set: function set(key, value) {
|
|
165
|
-
return _async_to_generator(function() {
|
|
166
|
-
var error;
|
|
167
|
-
return _ts_generator(this, function(_state) {
|
|
168
|
-
switch(_state.label){
|
|
169
|
-
case 0:
|
|
170
|
-
_state.trys.push([
|
|
171
|
-
0,
|
|
172
|
-
2,
|
|
173
|
-
,
|
|
174
|
-
3
|
|
175
|
-
]);
|
|
176
|
-
return [
|
|
177
|
-
4,
|
|
178
|
-
localForage.setItem(key, value)
|
|
179
|
-
];
|
|
180
|
-
case 1:
|
|
181
|
-
_state.sent();
|
|
182
|
-
return [
|
|
183
|
-
3,
|
|
184
|
-
3
|
|
185
|
-
];
|
|
186
|
-
case 2:
|
|
187
|
-
error = _state.sent();
|
|
188
|
-
console.error('❌ [Storage:set] Error setting key "'.concat(key, '":'), error);
|
|
189
|
-
return [
|
|
190
|
-
3,
|
|
191
|
-
3
|
|
192
|
-
];
|
|
193
|
-
case 3:
|
|
194
|
-
return [
|
|
195
|
-
2
|
|
196
|
-
];
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
})();
|
|
200
|
-
},
|
|
201
|
-
remove: function remove(key) {
|
|
202
|
-
return _async_to_generator(function() {
|
|
203
|
-
var error;
|
|
204
|
-
return _ts_generator(this, function(_state) {
|
|
205
|
-
switch(_state.label){
|
|
206
|
-
case 0:
|
|
207
|
-
_state.trys.push([
|
|
208
|
-
0,
|
|
209
|
-
2,
|
|
210
|
-
,
|
|
211
|
-
3
|
|
212
|
-
]);
|
|
213
|
-
return [
|
|
214
|
-
4,
|
|
215
|
-
localForage.removeItem(key)
|
|
216
|
-
];
|
|
217
|
-
case 1:
|
|
218
|
-
_state.sent();
|
|
219
|
-
return [
|
|
220
|
-
3,
|
|
221
|
-
3
|
|
222
|
-
];
|
|
223
|
-
case 2:
|
|
224
|
-
error = _state.sent();
|
|
225
|
-
console.error('❌ [Storage:remove] Error removing key "'.concat(key, '":'), error);
|
|
226
|
-
return [
|
|
227
|
-
3,
|
|
228
|
-
3
|
|
229
|
-
];
|
|
230
|
-
case 3:
|
|
231
|
-
return [
|
|
232
|
-
2
|
|
233
|
-
];
|
|
234
|
-
}
|
|
235
|
-
});
|
|
236
|
-
})();
|
|
237
|
-
},
|
|
238
|
-
keys: function keys() {
|
|
239
|
-
return _async_to_generator(function() {
|
|
240
|
-
var keys, error;
|
|
241
|
-
return _ts_generator(this, function(_state) {
|
|
242
|
-
switch(_state.label){
|
|
243
|
-
case 0:
|
|
244
|
-
_state.trys.push([
|
|
245
|
-
0,
|
|
246
|
-
2,
|
|
247
|
-
,
|
|
248
|
-
3
|
|
249
|
-
]);
|
|
250
|
-
return [
|
|
251
|
-
4,
|
|
252
|
-
localForage.keys()
|
|
253
|
-
];
|
|
254
|
-
case 1:
|
|
255
|
-
keys = _state.sent();
|
|
256
|
-
return [
|
|
257
|
-
2,
|
|
258
|
-
keys !== null && keys !== void 0 ? keys : []
|
|
259
|
-
];
|
|
260
|
-
case 2:
|
|
261
|
-
error = _state.sent();
|
|
262
|
-
console.error("❌ [Storage:keys] Error getting keys:", error);
|
|
263
|
-
return [
|
|
264
|
-
2,
|
|
265
|
-
[]
|
|
266
|
-
];
|
|
267
|
-
case 3:
|
|
268
|
-
return [
|
|
269
|
-
2
|
|
270
|
-
];
|
|
271
|
-
}
|
|
272
|
-
});
|
|
273
|
-
})();
|
|
274
|
-
}
|
|
275
|
-
};
|
|
276
|
-
export { storageClient };
|
|
1
|
+
function e(e,r,t,n,o,u,s){try{var a=e[u](s);var c=a.value}catch(e){t(e);return}if(a.done){r(c)}else{Promise.resolve(c).then(n,o)}}function r(r){return function(){var t=this,n=arguments;return new Promise(function(o,u){var s=r.apply(t,n);function a(r){e(s,o,u,a,c,"next",r)}function c(r){e(s,o,u,a,c,"throw",r)}a(undefined)})}}function t(e,r){var t,n,o,u,s={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]};return u={next:a(0),"throw":a(1),"return":a(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function a(e){return function(r){return c([e,r])}}function c(u){if(t)throw new TypeError("Generator is already executing.");while(s)try{if(t=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:s.label++;return{value:u[1],done:false};case 5:s.label++;n=u[1];u=[0];continue;case 7:u=s.ops.pop();s.trys.pop();continue;default:if(!(o=s.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){s=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){s.label=u[1];break}if(u[0]===6&&s.label<o[1]){s.label=o[1];o=u;break}if(o&&s.label<o[2]){s.label=o[2];s.ops.push(u);break}if(o[2])s.ops.pop();s.trys.pop();continue}u=r.call(e,s)}catch(e){u=[6,e];n=0}finally{t=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}import n from"localforage";var o={get:function e(e){return r(function(){var r;return t(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,n.getItem(e)];case 1:return[2,t.sent()];case 2:r=t.sent();return[2,(console.error('❌ [Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 3:return[2]}})})()},set:function e(e,o){return r(function(){var r;return t(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,n.setItem(e,o)];case 1:t.sent();return[3,3];case 2:r=t.sent();console.error('❌ [Storage:set] Error setting key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})})()},remove:function e(e){return r(function(){var r;return t(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,n.removeItem(e)];case 1:t.sent();return[3,3];case 2:r=t.sent();console.error('❌ [Storage:remove] Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})})()},keys:function e(){return r(function(){var e,r;return t(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,n.keys()];case 1:return[2,(e=t.sent())!==null&&e!==void 0?e:[]];case 2:r=t.sent();return[2,(console.error("❌ [Storage:keys] Error getting keys:",r),[])];case 3:return[2]}})})()}};export{o as storageClient};
|