lemon-model 5.0.1 → 5.0.3

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 CHANGED
@@ -147,6 +147,8 @@ See [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md)
147
147
 
148
148
  | Version | Description
149
149
  |-- |--
150
+ | 5.0.3 | (Unreleased) strict consumers: index signatures admit `undefined` (B17, TS2411 fix) — `GeneralItem` (so `SimpleSearchParam`) passes `strict` without `skipLibCheck`; devDependencies: typedoc/gh-pages/ttypescript/husky/lint-staged/ts-node removed, Jest 27 → 29 (ts-jest 29), `deepmerge` overridden by the dev-only `scripts/deepmerge-safe` (no upstream fix for GHSA-gcqx-w48m-w2h4), `npm audit` 0 (B17-d).
151
+ | 5.0.2 | (2026-10-30) v5 B15: `NextIdentity.cid?`, `NextIdentity.aid?`; `NextContext.accountId` doc (receiving service's own account); `channel`/`trace` bundle label B13 -> B14.
150
152
  | 1.0.6 | optimized `SearchBody` with `knn` support.
151
153
  | 1.0.5 | optimized `NextIdentity` with `authorization`.
152
154
  | 1.0.4 | optimized `NextIdentity` with `referer` and `origin`.
@@ -10,7 +10,9 @@
10
10
  * @date 2024-12-20 optimized `NextIdentityCognito`
11
11
  * @date 2025-05-13 optimized `NextContext` with `Authorization` header
12
12
  * @date 2025-06-12 optimized `SearchBody` with `knn` support
13
- * @date 2026-10-30 v5 B13: `NextContext.channel` and `NextContext.trace` (`NextTrace`).
13
+ * @date 2026-10-30 v5 B14: `NextContext.channel` and `NextContext.trace` (`NextTrace`).
14
+ * @date 2026-10-30 v5 B15: `NextIdentity.cid` and `NextIdentity.aid`.
15
+ * @date 2026-10-30 v5 B17: `GeneralItem` index signature admits `undefined` (strict consumers, TS2411).
14
16
  *
15
17
  * @copyright (C) lemoncloud.io 2019 - All Rights Reserved.
16
18
  */
@@ -1 +1 @@
1
- {"version":3,"file":"core-types.js","sourceRoot":"","sources":["../../../src/types/core-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
1
+ {"version":3,"file":"core-types.js","sourceRoot":"","sources":["../../../src/types/core-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG"}
@@ -10,7 +10,9 @@
10
10
  * @date 2024-12-20 optimized `NextIdentityCognito`
11
11
  * @date 2025-05-13 optimized `NextContext` with `Authorization` header
12
12
  * @date 2025-06-12 optimized `SearchBody` with `knn` support
13
- * @date 2026-10-30 v5 B13: `NextContext.channel` and `NextContext.trace` (`NextTrace`).
13
+ * @date 2026-10-30 v5 B14: `NextContext.channel` and `NextContext.trace` (`NextTrace`).
14
+ * @date 2026-10-30 v5 B15: `NextIdentity.cid` and `NextIdentity.aid`.
15
+ * @date 2026-10-30 v5 B17: `GeneralItem` index signature admits `undefined` (strict consumers, TS2411).
14
16
  *
15
17
  * @copyright (C) lemoncloud.io 2019 - All Rights Reserved.
16
18
  */
@@ -34,7 +36,7 @@ export interface GeneralItem {
34
36
  /**
35
37
  * only has simple string or number (and in arrays)
36
38
  */
37
- [key: string]: string | string[] | number | number[];
39
+ [key: string]: string | string[] | number | number[] | undefined;
38
40
  }
39
41
  /**
40
42
  * type: simple data-types
@@ -83,6 +85,17 @@ export interface NextIdentity<T = any> {
83
85
  * @since ver2.2.3 2020/JUL/15
84
86
  */
85
87
  lang?: string;
88
+ /**
89
+ * (optional) cloud-id: the AWS account number of the cloud the identity belongs to (v5 B15).
90
+ * - empty means the same cloud as the receiving service.
91
+ * - a value different from the receiver's `NextContext.accountId` marks a cross-cloud request.
92
+ */
93
+ cid?: string;
94
+ /**
95
+ * (optional) auth-id: the id of the authentication record (`AuthModel`) behind this identity (v5 B15).
96
+ * - not an account id.
97
+ */
98
+ aid?: string;
86
99
  /**
87
100
  * (optional) internal last-error message
88
101
  * - if this is not empty, then DO NOT use this object.
@@ -225,7 +238,8 @@ export interface NextContext<T extends NextIdentity = NextIdentity> {
225
238
  */
226
239
  requestId?: string;
227
240
  /**
228
- * id of aws account number from initial request. (ex: `085403634746` for lemon profile)
241
+ * id of the aws account number of the receiving service itself (from `invokedFunctionArn`).
242
+ * - not the account of the initial request (since lemon-core 5.0.6, v5 B14).
229
243
  */
230
244
  accountId?: string;
231
245
  /**
@@ -255,20 +269,20 @@ export interface NextContext<T extends NextIdentity = NextIdentity> {
255
269
  */
256
270
  depth?: number;
257
271
  /**
258
- * (optional) the channel of this request, set once by the receiving entry (v5 B13).
272
+ * (optional) the channel of this request, set once by the receiving entry (v5 B14).
259
273
  * - `external`: a web request with a `host` header (API Gateway, ALB, Function URL).
260
274
  * - `internal`: a host-less web event (direct invoke) or a protocol call (relay, SNS, SQS).
261
275
  * - `local`: the local express harness (local mode).
262
276
  */
263
277
  channel?: 'external' | 'internal' | 'local';
264
278
  /**
265
- * (optional) the trace of the call chain, set by the receiving entry (v5 B13).
279
+ * (optional) the trace of the call chain, set by the receiving entry (v5 B14).
266
280
  */
267
281
  trace?: NextTrace;
268
282
  }
269
283
  /**
270
284
  * type: `NextTrace`
271
- * - the trace of a call chain across internal hops (v5 B13).
285
+ * - the trace of a call chain across internal hops (v5 B14).
272
286
  */
273
287
  export interface NextTrace {
274
288
  /**
@@ -11,7 +11,9 @@
11
11
  * @date 2024-12-20 optimized `NextIdentityCognito`
12
12
  * @date 2025-05-13 optimized `NextContext` with `Authorization` header
13
13
  * @date 2025-06-12 optimized `SearchBody` with `knn` support
14
- * @date 2026-10-30 v5 B13: `NextContext.channel` and `NextContext.trace` (`NextTrace`).
14
+ * @date 2026-10-30 v5 B14: `NextContext.channel` and `NextContext.trace` (`NextTrace`).
15
+ * @date 2026-10-30 v5 B15: `NextIdentity.cid` and `NextIdentity.aid`.
16
+ * @date 2026-10-30 v5 B17: `GeneralItem` index signature admits `undefined` (strict consumers, TS2411).
15
17
  *
16
18
  * @copyright (C) lemoncloud.io 2019 - All Rights Reserved.
17
19
  */
@@ -1 +1 @@
1
- {"version":3,"file":"core-types.js","sourceRoot":"","sources":["../../src/types/core-types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG"}
1
+ {"version":3,"file":"core-types.js","sourceRoot":"","sources":["../../src/types/core-types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lemon-model",
3
- "version": "5.0.1",
3
+ "version": "5.0.3",
4
4
  "description": "Common shared model definitions for Lemon Micro-Service Platform",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -64,9 +64,15 @@
64
64
  },
65
65
  "typesVersions": {
66
66
  "*": {
67
- "upload": ["dist/upload/index.d.ts"],
68
- "upload/testing": ["dist/upload/testing.d.ts"],
69
- "upload/engine": ["dist/upload/engine/index.d.ts"]
67
+ "upload": [
68
+ "dist/upload/index.d.ts"
69
+ ],
70
+ "upload/testing": [
71
+ "dist/upload/testing.d.ts"
72
+ ],
73
+ "upload/engine": [
74
+ "dist/upload/engine/index.d.ts"
75
+ ]
70
76
  }
71
77
  },
72
78
  "scripts": {
@@ -74,9 +80,6 @@
74
80
  "build-ts": "tsc -v && tsc",
75
81
  "build-esm": "tsc -p tsconfig.esm.json && node scripts/fix-esm-build.cjs",
76
82
  "watch-ts": "tsc -w",
77
- "doc": "npm run doc:html && open dist/docs/index.html",
78
- "doc:html": "typedoc src/ --exclude **/*.spec.ts --target ES6 --mode file --out dist/docs",
79
- "doc:publish": "npm run doc:html && gh-pages -m \"docs(gh-pages): publish gh-pages via typedoc\" -d dist/docs",
80
83
  "lint": "tsc --noEmit && eslint '*/**/*.{js,ts,jsx,tsx}' --fix",
81
84
  "format": "prettier --write \"src/**/*.ts\"",
82
85
  "!test": "------- run self-test with jest -----",
@@ -87,17 +90,6 @@
87
90
  "prepare": "npm run build",
88
91
  "prepublishOnly": "npm test && npm run lint && npm run format"
89
92
  },
90
- "husky": {
91
- "hooks": {
92
- "!pre-commit": "lint-staged"
93
- }
94
- },
95
- "lint-staged": {
96
- "src/**/*.{js,ts,tsx,jsx}": [
97
- "npm run lint",
98
- "git add"
99
- ]
100
- },
101
93
  "files": [
102
94
  "dist/**/*"
103
95
  ],
@@ -111,28 +103,26 @@
111
103
  "@types/cookie-parser": "^1.4.2",
112
104
  "@types/cors": "^2.8.7",
113
105
  "@types/dotenv": "^6.1.1",
114
- "@types/jest": "^27.4.1",
106
+ "@types/jest": "^29.5.14",
115
107
  "@types/js-yaml": "^3.12.5",
116
108
  "@types/mime-types": "^2.1.0",
117
109
  "@types/supertest": "^2.0.10",
118
110
  "@typescript-eslint/eslint-plugin": "^5.15.0",
119
111
  "@typescript-eslint/parser": "^5.15.0",
112
+ "deepmerge": "file:./scripts/deepmerge-safe",
120
113
  "eslint": "^8.11.0",
121
114
  "eslint-config-prettier": "^8.5.0",
122
115
  "eslint-plugin-prettier": "^4.0.0",
123
- "gh-pages": "^2.2.0",
124
- "husky": "^2.2.0",
125
- "jest": "^27.5.1",
126
- "lint-staged": "^13.1.0",
116
+ "jest": "^29.7.0",
127
117
  "prettier": "^2.6.0",
128
118
  "superagent": "^5.3.1",
129
119
  "supertest": "^4.0.2",
130
- "ts-jest": "^27.1.3",
131
- "ts-node": "^8.10.2",
132
- "ttypescript": "^1.5.15",
133
- "typedoc": "^0.15.8",
120
+ "ts-jest": "^29.4.15",
134
121
  "typescript": "^4.6.2"
135
122
  },
123
+ "overrides": {
124
+ "deepmerge": "$deepmerge"
125
+ },
136
126
  "private": false,
137
127
  "repository": {
138
128
  "type": "git",
@@ -146,5 +136,8 @@
146
136
  "bugs": {
147
137
  "url": "https://github.com/lemoncloud-io/lemon-model/issues"
148
138
  },
149
- "homepage": "https://github.com/lemoncloud-io/lemon-model#readme"
139
+ "homepage": "https://github.com/lemoncloud-io/lemon-model#readme",
140
+ "allowScripts": {
141
+ "fsevents@2.3.3": true
142
+ }
150
143
  }