@infinitetoken/lumber-kit 0.4.19 → 0.4.20
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/README.md +65 -15
- package/dist/cjs/types/flag.d.ts +14 -0
- package/dist/cjs/types/flag.d.ts.map +1 -0
- package/dist/cjs/types/flag.js +2 -0
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/types/index.js +1 -0
- package/dist/cjs/types/log.d.ts +18 -18
- package/dist/cjs/types/log.d.ts.map +1 -1
- package/dist/cjs/types/note.d.ts +2 -2
- package/dist/cjs/types/note.d.ts.map +1 -1
- package/dist/esm/types/flag.d.ts +14 -0
- package/dist/esm/types/flag.d.ts.map +1 -0
- package/dist/esm/types/flag.js +1 -0
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/esm/types/index.d.ts.map +1 -1
- package/dist/esm/types/index.js +1 -0
- package/dist/esm/types/log.d.ts +18 -18
- package/dist/esm/types/log.d.ts.map +1 -1
- package/dist/esm/types/note.d.ts +2 -2
- package/dist/esm/types/note.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,37 +11,87 @@ npm install @infinitetoken/lumber-kit
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
|
-
import { LogLevel, LogRecord,
|
|
14
|
+
import { LogLevel, LogRecord, LogEncrypted, LogPayload, LogsQuery } from '@infinitetoken/lumber-kit'
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## Exports
|
|
18
18
|
|
|
19
|
+
### Log types
|
|
20
|
+
|
|
19
21
|
| Export | Kind | Purpose |
|
|
20
22
|
|--------|------|---------|
|
|
21
23
|
| `LogLevel` | `const enum` | Log severity: Debug=0 Info=1 Warn=2 Error=3 Fatal=4 |
|
|
22
|
-
| `SubscriptionLevel` | `const enum` | User tier: Hobby=0 Dev=1 Pro=2 |
|
|
23
|
-
| `LogPayload` | interface | Plaintext fields before encryption |
|
|
24
|
-
| `EncryptedPayload` | interface | Wire format: `{ payload: string, v: number }` |
|
|
25
24
|
| `LogRecord` | interface | API response shape for a stored log |
|
|
26
|
-
| `
|
|
27
|
-
| `
|
|
28
|
-
| `
|
|
29
|
-
| `
|
|
30
|
-
|
|
25
|
+
| `LogEncrypted` | interface | Encrypted envelope: `{ nonce, payload, keyVersion }` |
|
|
26
|
+
| `LogPayload` | interface | Plaintext shape encrypted into `LogEncrypted` (client-side only) |
|
|
27
|
+
| `LogContext` | interface | Structured context fields (code location, custom fields) |
|
|
28
|
+
| `LogsQuery` | interface | Sync-protocol params for GET /logs |
|
|
29
|
+
|
|
30
|
+
### Subscription types
|
|
31
|
+
|
|
32
|
+
| Export | Kind | Purpose |
|
|
33
|
+
|--------|------|---------|
|
|
34
|
+
| `SubscriptionLevel` | `const enum` | Team tier: Hobby=0 Dev=1 Pro=2 Enterprise=3 |
|
|
35
|
+
| `subscriptionLevelToName` | object | Maps `SubscriptionLevel` to `'hobby' \| 'dev' \| 'pro' \| 'enterprise'` |
|
|
36
|
+
| `subscriptionLimits` | object | Per-tier limits (apps, seats, apiKeys, logRetentionDays, etc.) |
|
|
37
|
+
| `isValidSubscriptionLevel` | function | Type guard for `SubscriptionLevel` values |
|
|
38
|
+
|
|
39
|
+
### Flag types
|
|
40
|
+
|
|
41
|
+
| Export | Kind | Purpose |
|
|
42
|
+
|--------|------|---------|
|
|
43
|
+
| `FlagRecord` | interface | A user flag on a log: `{ id, createdAt, updatedAt, logId, userId }` |
|
|
44
|
+
| `FlagsQuery` | interface | Sync-protocol params for GET /flags |
|
|
45
|
+
|
|
46
|
+
### App / User / Team types
|
|
31
47
|
|
|
32
|
-
|
|
48
|
+
| Export | Kind | Purpose |
|
|
49
|
+
|--------|------|---------|
|
|
50
|
+
| `AppRecord` | interface | API response shape for an app |
|
|
51
|
+
| `AppCreatedRecord` | interface | POST /apps 201 response (includes `encryptedKey` once) |
|
|
52
|
+
| `UserRecord` | interface | API response shape for a user |
|
|
53
|
+
| `TeamRecord` | interface | API response shape for a team |
|
|
54
|
+
| `TeamMemberRecord` | interface | Team membership record |
|
|
55
|
+
|
|
56
|
+
## Wire format
|
|
57
|
+
|
|
58
|
+
All log content is E2E encrypted before leaving the client. `LogRecord` contains only:
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
{
|
|
62
|
+
id: string // server-assigned
|
|
63
|
+
createdAt: string // ISO 8601
|
|
64
|
+
updatedAt: string // ISO 8601
|
|
65
|
+
appId: string
|
|
66
|
+
encrypted: LogEncrypted // opaque blob — server cannot read this
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
`LogEncrypted` uses AES-256-GCM:
|
|
71
|
+
- `nonce` — base64(random IV, 12 bytes)
|
|
72
|
+
- `payload` — base64(authTag[16 bytes] + ciphertext)
|
|
73
|
+
- `keyVersion` — always `1` for the current format; changes are semver major
|
|
33
74
|
|
|
34
|
-
`
|
|
75
|
+
The plaintext shape inside `payload` is `LogPayload`:
|
|
35
76
|
|
|
36
|
-
|
|
77
|
+
```typescript
|
|
78
|
+
{
|
|
79
|
+
level: LogLevel
|
|
80
|
+
message: string
|
|
81
|
+
requestId?: string
|
|
82
|
+
traceId?: string
|
|
83
|
+
context?: LogContext
|
|
84
|
+
metadata?: Record<string, unknown>
|
|
85
|
+
}
|
|
86
|
+
```
|
|
37
87
|
|
|
38
|
-
## const enum and Babel
|
|
88
|
+
## const enum and Babel consumers
|
|
39
89
|
|
|
40
90
|
`LogLevel` is a TypeScript `const enum`. TypeScript consumers have values inlined at compile time (zero runtime overhead).
|
|
41
91
|
|
|
42
|
-
If your project uses Babel, esbuild, or `isolatedModules: true`, the runtime enum object is available because Lumber-Kit is compiled with `preserveConstEnums: true`. No special configuration is needed
|
|
92
|
+
If your project uses Babel, esbuild, or `isolatedModules: true`, the runtime enum object is available because Lumber-Kit is compiled with `preserveConstEnums: true`. No special configuration is needed.
|
|
43
93
|
|
|
44
|
-
## Local
|
|
94
|
+
## Local development (yalc)
|
|
45
95
|
|
|
46
96
|
Do NOT use `npm link` — it creates symlinks that break Metro in the Expo client.
|
|
47
97
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface FlagRecord {
|
|
2
|
+
id: string;
|
|
3
|
+
createdAt: string;
|
|
4
|
+
updatedAt: string;
|
|
5
|
+
logId: string;
|
|
6
|
+
userId: string;
|
|
7
|
+
}
|
|
8
|
+
export interface FlagsQuery {
|
|
9
|
+
from?: string;
|
|
10
|
+
to?: string;
|
|
11
|
+
limit?: number;
|
|
12
|
+
cursor?: string;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=flag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag.d.ts","sourceRoot":"","sources":["../../../src/types/flag.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,cAAc,CAAA;AAC5B,cAAc,OAAO,CAAA;AACrB,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA;AAC5B,cAAc,QAAQ,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,cAAc,CAAA;AAC5B,cAAc,QAAQ,CAAA;AACtB,cAAc,OAAO,CAAA;AACrB,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA;AAC5B,cAAc,QAAQ,CAAA"}
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./app"), exports);
|
|
18
18
|
__exportStar(require("./deviceLink"), exports);
|
|
19
|
+
__exportStar(require("./flag"), exports);
|
|
19
20
|
__exportStar(require("./log"), exports);
|
|
20
21
|
__exportStar(require("./note"), exports);
|
|
21
22
|
__exportStar(require("./response"), exports);
|
package/dist/cjs/types/log.d.ts
CHANGED
|
@@ -3,8 +3,6 @@ import { LogLevel } from '../constants';
|
|
|
3
3
|
* Structured log context content.
|
|
4
4
|
*/
|
|
5
5
|
export interface LogContext {
|
|
6
|
-
requestId?: string;
|
|
7
|
-
traceId?: string;
|
|
8
6
|
code?: string;
|
|
9
7
|
method?: string;
|
|
10
8
|
line?: number;
|
|
@@ -13,43 +11,45 @@ export interface LogContext {
|
|
|
13
11
|
[key: string]: unknown;
|
|
14
12
|
}
|
|
15
13
|
/**
|
|
16
|
-
* Encrypted
|
|
14
|
+
* Encrypted envelope stored on the server.
|
|
17
15
|
* payload = base64(authTag + ciphertext)
|
|
18
16
|
* nonce = base64(random IV)
|
|
19
17
|
* keyVersion enables future rotation support.
|
|
20
18
|
*/
|
|
21
|
-
export interface
|
|
22
|
-
payload: string;
|
|
19
|
+
export interface LogEncrypted {
|
|
23
20
|
nonce: string;
|
|
21
|
+
payload: string;
|
|
24
22
|
keyVersion: number;
|
|
25
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Plaintext shape of log content — encrypted before sending, never stored plaintext on server.
|
|
26
|
+
*/
|
|
27
|
+
export interface LogPayload {
|
|
28
|
+
level: LogLevel;
|
|
29
|
+
message: string;
|
|
30
|
+
requestId?: string;
|
|
31
|
+
traceId?: string;
|
|
32
|
+
context?: LogContext;
|
|
33
|
+
metadata?: Record<string, unknown>;
|
|
34
|
+
}
|
|
26
35
|
/**
|
|
27
36
|
* API response shape for a stored log.
|
|
37
|
+
* level is plaintext for server-side notification routing; all content is inside encrypted.
|
|
28
38
|
*/
|
|
29
39
|
export interface LogRecord {
|
|
30
40
|
id: string;
|
|
31
41
|
createdAt: string;
|
|
32
42
|
updatedAt: string;
|
|
33
43
|
appId: string;
|
|
34
|
-
requestId?: string;
|
|
35
|
-
traceId?: string;
|
|
36
44
|
level: LogLevel;
|
|
37
|
-
|
|
38
|
-
flagged: boolean;
|
|
39
|
-
context?: LogContext;
|
|
40
|
-
metadata?: Record<string, unknown>;
|
|
41
|
-
private?: LogPrivate;
|
|
45
|
+
encrypted: LogEncrypted;
|
|
42
46
|
}
|
|
43
47
|
/**
|
|
44
|
-
*
|
|
48
|
+
* Sync-protocol params for GET /logs.
|
|
45
49
|
*/
|
|
46
50
|
export interface LogsQuery {
|
|
47
51
|
appIds?: string[];
|
|
48
|
-
|
|
49
|
-
traceId?: string;
|
|
50
|
-
levels?: LogLevel[];
|
|
51
|
-
text?: string;
|
|
52
|
-
flagged?: boolean;
|
|
52
|
+
levels?: number[];
|
|
53
53
|
from?: string;
|
|
54
54
|
to?: string;
|
|
55
55
|
sort?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/types/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/types/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MAAM,CAAC,EAAE,MAAM,CAAA;CAChB"}
|
package/dist/cjs/types/note.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* nonce = base64(random IV)
|
|
5
5
|
* keyVersion enables future key rotation.
|
|
6
6
|
*/
|
|
7
|
-
export interface
|
|
7
|
+
export interface NoteEncrypted {
|
|
8
8
|
payload: string;
|
|
9
9
|
nonce: string;
|
|
10
10
|
keyVersion: number;
|
|
@@ -21,7 +21,7 @@ export interface NoteRecord {
|
|
|
21
21
|
appId: string;
|
|
22
22
|
userId: string;
|
|
23
23
|
logId?: string;
|
|
24
|
-
|
|
24
|
+
encrypted: NoteEncrypted;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Filter params for GET /notes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"note.d.ts","sourceRoot":"","sources":["../../../src/types/note.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"note.d.ts","sourceRoot":"","sources":["../../../src/types/note.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IAEjB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,SAAS,EAAE,aAAa,CAAA;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface FlagRecord {
|
|
2
|
+
id: string;
|
|
3
|
+
createdAt: string;
|
|
4
|
+
updatedAt: string;
|
|
5
|
+
logId: string;
|
|
6
|
+
userId: string;
|
|
7
|
+
}
|
|
8
|
+
export interface FlagsQuery {
|
|
9
|
+
from?: string;
|
|
10
|
+
to?: string;
|
|
11
|
+
limit?: number;
|
|
12
|
+
cursor?: string;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=flag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag.d.ts","sourceRoot":"","sources":["../../../src/types/flag.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,cAAc,CAAA;AAC5B,cAAc,OAAO,CAAA;AACrB,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA;AAC5B,cAAc,QAAQ,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,cAAc,CAAA;AAC5B,cAAc,QAAQ,CAAA;AACtB,cAAc,OAAO,CAAA;AACrB,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA;AAC5B,cAAc,QAAQ,CAAA"}
|
package/dist/esm/types/index.js
CHANGED
package/dist/esm/types/log.d.ts
CHANGED
|
@@ -3,8 +3,6 @@ import { LogLevel } from '../constants';
|
|
|
3
3
|
* Structured log context content.
|
|
4
4
|
*/
|
|
5
5
|
export interface LogContext {
|
|
6
|
-
requestId?: string;
|
|
7
|
-
traceId?: string;
|
|
8
6
|
code?: string;
|
|
9
7
|
method?: string;
|
|
10
8
|
line?: number;
|
|
@@ -13,43 +11,45 @@ export interface LogContext {
|
|
|
13
11
|
[key: string]: unknown;
|
|
14
12
|
}
|
|
15
13
|
/**
|
|
16
|
-
* Encrypted
|
|
14
|
+
* Encrypted envelope stored on the server.
|
|
17
15
|
* payload = base64(authTag + ciphertext)
|
|
18
16
|
* nonce = base64(random IV)
|
|
19
17
|
* keyVersion enables future rotation support.
|
|
20
18
|
*/
|
|
21
|
-
export interface
|
|
22
|
-
payload: string;
|
|
19
|
+
export interface LogEncrypted {
|
|
23
20
|
nonce: string;
|
|
21
|
+
payload: string;
|
|
24
22
|
keyVersion: number;
|
|
25
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Plaintext shape of log content — encrypted before sending, never stored plaintext on server.
|
|
26
|
+
*/
|
|
27
|
+
export interface LogPayload {
|
|
28
|
+
level: LogLevel;
|
|
29
|
+
message: string;
|
|
30
|
+
requestId?: string;
|
|
31
|
+
traceId?: string;
|
|
32
|
+
context?: LogContext;
|
|
33
|
+
metadata?: Record<string, unknown>;
|
|
34
|
+
}
|
|
26
35
|
/**
|
|
27
36
|
* API response shape for a stored log.
|
|
37
|
+
* level is plaintext for server-side notification routing; all content is inside encrypted.
|
|
28
38
|
*/
|
|
29
39
|
export interface LogRecord {
|
|
30
40
|
id: string;
|
|
31
41
|
createdAt: string;
|
|
32
42
|
updatedAt: string;
|
|
33
43
|
appId: string;
|
|
34
|
-
requestId?: string;
|
|
35
|
-
traceId?: string;
|
|
36
44
|
level: LogLevel;
|
|
37
|
-
|
|
38
|
-
flagged: boolean;
|
|
39
|
-
context?: LogContext;
|
|
40
|
-
metadata?: Record<string, unknown>;
|
|
41
|
-
private?: LogPrivate;
|
|
45
|
+
encrypted: LogEncrypted;
|
|
42
46
|
}
|
|
43
47
|
/**
|
|
44
|
-
*
|
|
48
|
+
* Sync-protocol params for GET /logs.
|
|
45
49
|
*/
|
|
46
50
|
export interface LogsQuery {
|
|
47
51
|
appIds?: string[];
|
|
48
|
-
|
|
49
|
-
traceId?: string;
|
|
50
|
-
levels?: LogLevel[];
|
|
51
|
-
text?: string;
|
|
52
|
-
flagged?: boolean;
|
|
52
|
+
levels?: number[];
|
|
53
53
|
from?: string;
|
|
54
54
|
to?: string;
|
|
55
55
|
sort?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/types/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/types/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAA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
7
|
-
export interface
|
|
7
|
+
export interface NoteEncrypted {
|
|
8
8
|
payload: string;
|
|
9
9
|
nonce: string;
|
|
10
10
|
keyVersion: number;
|
|
@@ -21,7 +21,7 @@ export interface NoteRecord {
|
|
|
21
21
|
appId: string;
|
|
22
22
|
userId: string;
|
|
23
23
|
logId?: string;
|
|
24
|
-
|
|
24
|
+
encrypted: NoteEncrypted;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Filter params for GET /notes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"note.d.ts","sourceRoot":"","sources":["../../../src/types/note.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"note.d.ts","sourceRoot":"","sources":["../../../src/types/note.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IAEjB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,SAAS,EAAE,aAAa,CAAA;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB"}
|