@ngx-pwa/local-storage 19.0.0 → 20.0.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/LICENSE +1 -1
- package/fesm2022/ngx-pwa-local-storage.mjs +63 -50
- package/fesm2022/ngx-pwa-local-storage.mjs.map +1 -1
- package/index.d.ts +656 -3
- package/package.json +3 -3
- package/schematics/ng-add/index.js +5 -5
- package/lib/databases/exceptions.d.ts +0 -20
- package/lib/databases/indexeddb-database.d.ts +0 -107
- package/lib/databases/local-database.d.ts +0 -18
- package/lib/databases/localstorage-database.d.ts +0 -64
- package/lib/databases/memory-database.d.ts +0 -50
- package/lib/providers.d.ts +0 -56
- package/lib/storage.module.d.ts +0 -19
- package/lib/storages/exceptions.d.ts +0 -10
- package/lib/storages/storage-map.service.d.ts +0 -254
- package/lib/tokens.d.ts +0 -75
- package/lib/validation/json-schema.d.ts +0 -260
- package/lib/validation/json-validator.d.ts +0 -71
- package/public-api.d.ts +0 -7
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* JSON Schema to describe a boolean value.
|
|
3
|
-
*/
|
|
4
|
-
export interface JSONSchemaBoolean {
|
|
5
|
-
/**
|
|
6
|
-
* Type for a boolean value.
|
|
7
|
-
*/
|
|
8
|
-
type: "boolean";
|
|
9
|
-
/**
|
|
10
|
-
* Checks if a value is strictly equal to this.
|
|
11
|
-
*/
|
|
12
|
-
const?: boolean;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* JSON Schema to describe a number value.
|
|
16
|
-
*/
|
|
17
|
-
export interface JSONSchemaNumber {
|
|
18
|
-
/**
|
|
19
|
-
* Type for a numeric value.
|
|
20
|
-
*/
|
|
21
|
-
type: "number";
|
|
22
|
-
/**
|
|
23
|
-
* Checks if a value is strictly equal to this.
|
|
24
|
-
*/
|
|
25
|
-
const?: number;
|
|
26
|
-
/**
|
|
27
|
-
* Checks if a value is strictly equal to one of the value of enum.
|
|
28
|
-
*/
|
|
29
|
-
enum?: readonly number[];
|
|
30
|
-
/**
|
|
31
|
-
* Check if a number is a multiple of x.
|
|
32
|
-
* Must be strictly greater than 0.
|
|
33
|
-
*/
|
|
34
|
-
multipleOf?: number;
|
|
35
|
-
/**
|
|
36
|
-
* Check if a number is lower or equal than this maximum.
|
|
37
|
-
*/
|
|
38
|
-
maximum?: number;
|
|
39
|
-
/**
|
|
40
|
-
* Check if a number is strictly lower than this maximum.
|
|
41
|
-
*/
|
|
42
|
-
exclusiveMaximum?: number;
|
|
43
|
-
/**
|
|
44
|
-
* Check if a number is greater or equal than this minimum.
|
|
45
|
-
*/
|
|
46
|
-
minimum?: number;
|
|
47
|
-
/**
|
|
48
|
-
* Check if a number is strictly greater than this minimum.
|
|
49
|
-
*/
|
|
50
|
-
exclusiveMinimum?: number;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* JSON Schema to describe an integer value.
|
|
54
|
-
*/
|
|
55
|
-
export interface JSONSchemaInteger {
|
|
56
|
-
/**
|
|
57
|
-
* Type for an integer value.
|
|
58
|
-
*/
|
|
59
|
-
type: "integer";
|
|
60
|
-
/**
|
|
61
|
-
* Checks if a value is strictly equal to this.
|
|
62
|
-
*/
|
|
63
|
-
const?: number;
|
|
64
|
-
/**
|
|
65
|
-
* Checks if a value is strictly equal to one of the value of enum.
|
|
66
|
-
*/
|
|
67
|
-
enum?: readonly number[];
|
|
68
|
-
/**
|
|
69
|
-
* Check if a number is a multiple of x.
|
|
70
|
-
* Must be strictly greater than 0.
|
|
71
|
-
*/
|
|
72
|
-
multipleOf?: number;
|
|
73
|
-
/**
|
|
74
|
-
* Check if a number is lower or equal than this maximum.
|
|
75
|
-
*/
|
|
76
|
-
maximum?: number;
|
|
77
|
-
/**
|
|
78
|
-
* Check if a number is strictly lower than this maximum.
|
|
79
|
-
*/
|
|
80
|
-
exclusiveMaximum?: number;
|
|
81
|
-
/**
|
|
82
|
-
* Check if a number is greater or equal than this minimum.
|
|
83
|
-
*/
|
|
84
|
-
minimum?: number;
|
|
85
|
-
/**
|
|
86
|
-
* Check if a number is strictly greater than this minimum.
|
|
87
|
-
*/
|
|
88
|
-
exclusiveMinimum?: number;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* JSON Schema to describe a string value.
|
|
92
|
-
*/
|
|
93
|
-
export interface JSONSchemaString {
|
|
94
|
-
/**
|
|
95
|
-
* Type for a string value.
|
|
96
|
-
*/
|
|
97
|
-
type: "string";
|
|
98
|
-
/**
|
|
99
|
-
* Checks if a value is strictly equal to this.
|
|
100
|
-
*/
|
|
101
|
-
const?: string;
|
|
102
|
-
/**
|
|
103
|
-
* Checks if a value is strictly equal to one of the value of enum.
|
|
104
|
-
*/
|
|
105
|
-
enum?: readonly string[];
|
|
106
|
-
/**
|
|
107
|
-
* Maxium length for a string.
|
|
108
|
-
* Must be a non-negative integer.
|
|
109
|
-
*/
|
|
110
|
-
maxLength?: number;
|
|
111
|
-
/**
|
|
112
|
-
* Minimum length for a string.
|
|
113
|
-
* Must be a non-negative integer.
|
|
114
|
-
*/
|
|
115
|
-
minLength?: number;
|
|
116
|
-
/**
|
|
117
|
-
* Pattern to match for a string.
|
|
118
|
-
* Must be a valid regular expression, *without* the `/` delimiters.
|
|
119
|
-
*/
|
|
120
|
-
pattern?: string;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* JSON schema to describe an array of values.
|
|
124
|
-
*/
|
|
125
|
-
export interface JSONSchemaArray {
|
|
126
|
-
/**
|
|
127
|
-
* Type for an array of values.
|
|
128
|
-
*/
|
|
129
|
-
type: "array";
|
|
130
|
-
/**
|
|
131
|
-
* Schema for the values of the array.
|
|
132
|
-
*/
|
|
133
|
-
items: JSONSchema;
|
|
134
|
-
/**
|
|
135
|
-
* Check if an array length is lower or equal to this value.
|
|
136
|
-
* Must be a non negative integer.
|
|
137
|
-
*/
|
|
138
|
-
maxItems?: number;
|
|
139
|
-
/**
|
|
140
|
-
* Check if an array length is greater or equal to this value.
|
|
141
|
-
* Must be a non negative integer.
|
|
142
|
-
*/
|
|
143
|
-
minItems?: number;
|
|
144
|
-
/**
|
|
145
|
-
* Check if an array only have unique values.
|
|
146
|
-
*/
|
|
147
|
-
uniqueItems?: boolean;
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* JSON Schema to describe an array of primitive values:
|
|
151
|
-
* - array of booleans: `JSONSchemaArrayOf<JSONSchemaBoolean>`,
|
|
152
|
-
* - array of numbers: `JSONSchemaArrayOf<JSONSchemaNumber>`,
|
|
153
|
-
* - array of integers: `JSONSchemaArrayOf<JSONSchemaInteger>`,
|
|
154
|
-
* - array of strings: `JSONSchemaArrayOf<JSONSchemaString>`.
|
|
155
|
-
*/
|
|
156
|
-
export interface JSONSchemaArrayOf<T extends JSONSchemaBoolean | JSONSchemaNumber | JSONSchemaInteger | JSONSchemaString> {
|
|
157
|
-
/**
|
|
158
|
-
* Type for an array of values.
|
|
159
|
-
*/
|
|
160
|
-
type: "array";
|
|
161
|
-
/**
|
|
162
|
-
* Schema for the values of an array.
|
|
163
|
-
*/
|
|
164
|
-
items: T;
|
|
165
|
-
/**
|
|
166
|
-
* Check if an array length is lower or equal to this value.
|
|
167
|
-
* Must be a non negative integer.
|
|
168
|
-
*/
|
|
169
|
-
maxItems?: number;
|
|
170
|
-
/**
|
|
171
|
-
* Check if an array length is greater or equal to this value.
|
|
172
|
-
* Must be a non negative integer.
|
|
173
|
-
*/
|
|
174
|
-
minItems?: number;
|
|
175
|
-
/**
|
|
176
|
-
* Check if an array only have unique values.
|
|
177
|
-
*/
|
|
178
|
-
uniqueItems?: boolean;
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* JSON schema to describe a tuple.
|
|
182
|
-
*/
|
|
183
|
-
export interface JSONSchemaTuple {
|
|
184
|
-
/**
|
|
185
|
-
* Type for an array of values.
|
|
186
|
-
*/
|
|
187
|
-
type: "array";
|
|
188
|
-
/**
|
|
189
|
-
* Schema for the values of the tuple.
|
|
190
|
-
*/
|
|
191
|
-
items?: readonly JSONSchema[];
|
|
192
|
-
/**
|
|
193
|
-
* Check if an array length is lower or equal to this value.
|
|
194
|
-
* Must be a non negative integer.
|
|
195
|
-
*/
|
|
196
|
-
maxItems?: number;
|
|
197
|
-
/**
|
|
198
|
-
* Check if an array length is greater or equal to this value.
|
|
199
|
-
* Must be a non negative integer.
|
|
200
|
-
*/
|
|
201
|
-
minItems?: number;
|
|
202
|
-
/**
|
|
203
|
-
* Check if an array only have unique values.
|
|
204
|
-
*/
|
|
205
|
-
uniqueItems?: boolean;
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* JSON schema to describe an object.
|
|
209
|
-
*/
|
|
210
|
-
export interface JSONSchemaObject {
|
|
211
|
-
/**
|
|
212
|
-
* Type for an object.
|
|
213
|
-
*/
|
|
214
|
-
type: "object";
|
|
215
|
-
/**
|
|
216
|
-
* List of properties of the object and their associated JSON schemas.
|
|
217
|
-
*/
|
|
218
|
-
properties: Record<string, JSONSchema>;
|
|
219
|
-
/**
|
|
220
|
-
* Array of names of the required properties for an object.
|
|
221
|
-
* Properties set as required should be present in `properties` too.
|
|
222
|
-
*/
|
|
223
|
-
required?: readonly string[];
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* Subset of the JSON Schema standard.
|
|
227
|
-
*
|
|
228
|
-
* Types are enforced to validate everything: each value **must** have a `type`.
|
|
229
|
-
*
|
|
230
|
-
* @see {@link https://github.com/cyrilletuzi/angular-async-local-storage/blob/main/docs/VALIDATION.md}
|
|
231
|
-
*
|
|
232
|
-
* @example
|
|
233
|
-
* const schema = { type: 'string' } satisfies JSONSchema;
|
|
234
|
-
*
|
|
235
|
-
* @example
|
|
236
|
-
* const schema = { type: 'number' } satisfies JSONSchema;
|
|
237
|
-
*
|
|
238
|
-
* @example
|
|
239
|
-
* const schema = { type: 'integer' } satisfies JSONSchema;
|
|
240
|
-
*
|
|
241
|
-
* @example
|
|
242
|
-
* const schema = { type: 'boolean' } satisfies JSONSchema;
|
|
243
|
-
*
|
|
244
|
-
* @example
|
|
245
|
-
* const schema = {
|
|
246
|
-
* type: 'array',
|
|
247
|
-
* items: { type: 'string' },
|
|
248
|
-
* } satisfies JSONSchema;
|
|
249
|
-
*
|
|
250
|
-
* @example
|
|
251
|
-
* const schema = {
|
|
252
|
-
* type: 'object',
|
|
253
|
-
* properties: {
|
|
254
|
-
* firstName: { type: 'string' },
|
|
255
|
-
* lastName: { type: 'string' },
|
|
256
|
-
* },
|
|
257
|
-
* required: ['firstName'],
|
|
258
|
-
* } satisfies JSONSchema;
|
|
259
|
-
*/
|
|
260
|
-
export type JSONSchema = JSONSchemaString | JSONSchemaNumber | JSONSchemaInteger | JSONSchemaBoolean | JSONSchemaArray | JSONSchemaTuple | JSONSchemaObject;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { JSONSchema } from "./json-schema";
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class JSONValidator {
|
|
4
|
-
/**
|
|
5
|
-
* Validate a JSON data against a Jsubset of the JSON Schema standard.
|
|
6
|
-
* Types are enforced to validate everything: each schema must
|
|
7
|
-
* @param data JSON data to validate
|
|
8
|
-
* @param schema Subset of JSON Schema. Must have a `type`.
|
|
9
|
-
* @returns If data is valid: `true`, if it is invalid: `false`
|
|
10
|
-
* @see {@link https://github.com/cyrilletuzi/angular-async-local-storage/blob/main/docs/VALIDATION.md}
|
|
11
|
-
*/
|
|
12
|
-
validate(data: unknown, schema: JSONSchema): boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Validate a string
|
|
15
|
-
* @param data Data to validate
|
|
16
|
-
* @param schema Schema describing the string
|
|
17
|
-
* @returns If data is valid: `true`, if it is invalid: `false`
|
|
18
|
-
*/
|
|
19
|
-
private validateString;
|
|
20
|
-
/**
|
|
21
|
-
* Validate a number or an integer
|
|
22
|
-
* @param data Data to validate
|
|
23
|
-
* @param schema Schema describing the number or integer
|
|
24
|
-
* @returns If data is valid: `true`, if it is invalid: `false`
|
|
25
|
-
*/
|
|
26
|
-
private validateNumber;
|
|
27
|
-
/**
|
|
28
|
-
* Validate a boolean
|
|
29
|
-
* @param data Data to validate
|
|
30
|
-
* @param schema Schema describing the boolean
|
|
31
|
-
* @returns If data is valid: `true`, if it is invalid: `false`
|
|
32
|
-
*/
|
|
33
|
-
private validateBoolean;
|
|
34
|
-
/**
|
|
35
|
-
* Validate an array
|
|
36
|
-
* @param data Data to validate
|
|
37
|
-
* @param schema Schema describing the array
|
|
38
|
-
* @returns If data is valid: `true`, if it is invalid: `false`
|
|
39
|
-
*/
|
|
40
|
-
private validateArray;
|
|
41
|
-
/**
|
|
42
|
-
* Validate a tuple (array with fixed length and multiple types)
|
|
43
|
-
* @param data Data to validate
|
|
44
|
-
* @param schemas Schemas describing the tuple
|
|
45
|
-
* @returns If data is valid: `true`, if it is invalid: `false`
|
|
46
|
-
*/
|
|
47
|
-
private validateTuple;
|
|
48
|
-
/**
|
|
49
|
-
* Validate an object
|
|
50
|
-
* @param data Data to validate
|
|
51
|
-
* @param schema JSON schema describing the object
|
|
52
|
-
* @returns If data is valid: `true`, if it is invalid: `false`
|
|
53
|
-
*/
|
|
54
|
-
private validateObject;
|
|
55
|
-
/**
|
|
56
|
-
* Validate a constant
|
|
57
|
-
* @param data Data ta validate
|
|
58
|
-
* @param schema JSON schema describing the constant
|
|
59
|
-
* @returns If data is valid: `true`, if it is invalid: `false`
|
|
60
|
-
*/
|
|
61
|
-
private validateConst;
|
|
62
|
-
/**
|
|
63
|
-
* Validate an enum
|
|
64
|
-
* @param data Data ta validate
|
|
65
|
-
* @param schema JSON schema describing the enum
|
|
66
|
-
* @returns If data is valid: `true`, if it is invalid: `false`
|
|
67
|
-
*/
|
|
68
|
-
private validateEnum;
|
|
69
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<JSONValidator, never>;
|
|
70
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<JSONValidator>;
|
|
71
|
-
}
|
package/public-api.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { SERIALIZATION_ERROR, SerializationError } from "./lib/databases/exceptions";
|
|
2
|
-
export { provideIndexedDBDataBaseName, provideIndexedDBDataBaseVersion, provideIndexedDBStoreName, provideLocalStoragePrefix } from "./lib/providers";
|
|
3
|
-
export { StorageModule } from "./lib/storage.module";
|
|
4
|
-
export { VALIDATION_ERROR, ValidationError } from "./lib/storages/exceptions";
|
|
5
|
-
export { StorageMap } from "./lib/storages/storage-map.service";
|
|
6
|
-
export type { StorageConfig } from "./lib/tokens";
|
|
7
|
-
export type { JSONSchema } from "./lib/validation/json-schema";
|