lemon-model 5.0.1 → 5.0.2

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,7 @@ See [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md)
147
147
 
148
148
  | Version | Description
149
149
  |-- |--
150
+ | 5.0.2 | (Unreleased) v5 B15: `NextIdentity.cid?`, `NextIdentity.aid?`; `NextContext.accountId` doc (receiving service's own account); `channel`/`trace` bundle label B13 -> B14.
150
151
  | 1.0.6 | optimized `SearchBody` with `knn` support.
151
152
  | 1.0.5 | optimized `NextIdentity` with `authorization`.
152
153
  | 1.0.4 | optimized `NextIdentity` with `referer` and `origin`.
@@ -10,7 +10,8 @@
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`.
14
15
  *
15
16
  * @copyright (C) lemoncloud.io 2019 - All Rights Reserved.
16
17
  */
@@ -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;;;;;;;;;;;;;;;;GAgBG"}
@@ -10,7 +10,8 @@
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`.
14
15
  *
15
16
  * @copyright (C) lemoncloud.io 2019 - All Rights Reserved.
16
17
  */
@@ -83,6 +84,17 @@ export interface NextIdentity<T = any> {
83
84
  * @since ver2.2.3 2020/JUL/15
84
85
  */
85
86
  lang?: string;
87
+ /**
88
+ * (optional) cloud-id: the AWS account number of the cloud the identity belongs to (v5 B15).
89
+ * - empty means the same cloud as the receiving service.
90
+ * - a value different from the receiver's `NextContext.accountId` marks a cross-cloud request.
91
+ */
92
+ cid?: string;
93
+ /**
94
+ * (optional) auth-id: the id of the authentication record (`AuthModel`) behind this identity (v5 B15).
95
+ * - not an account id.
96
+ */
97
+ aid?: string;
86
98
  /**
87
99
  * (optional) internal last-error message
88
100
  * - if this is not empty, then DO NOT use this object.
@@ -225,7 +237,8 @@ export interface NextContext<T extends NextIdentity = NextIdentity> {
225
237
  */
226
238
  requestId?: string;
227
239
  /**
228
- * id of aws account number from initial request. (ex: `085403634746` for lemon profile)
240
+ * id of the aws account number of the receiving service itself (from `invokedFunctionArn`).
241
+ * - not the account of the initial request (since lemon-core 5.0.6, v5 B14).
229
242
  */
230
243
  accountId?: string;
231
244
  /**
@@ -255,20 +268,20 @@ export interface NextContext<T extends NextIdentity = NextIdentity> {
255
268
  */
256
269
  depth?: number;
257
270
  /**
258
- * (optional) the channel of this request, set once by the receiving entry (v5 B13).
271
+ * (optional) the channel of this request, set once by the receiving entry (v5 B14).
259
272
  * - `external`: a web request with a `host` header (API Gateway, ALB, Function URL).
260
273
  * - `internal`: a host-less web event (direct invoke) or a protocol call (relay, SNS, SQS).
261
274
  * - `local`: the local express harness (local mode).
262
275
  */
263
276
  channel?: 'external' | 'internal' | 'local';
264
277
  /**
265
- * (optional) the trace of the call chain, set by the receiving entry (v5 B13).
278
+ * (optional) the trace of the call chain, set by the receiving entry (v5 B14).
266
279
  */
267
280
  trace?: NextTrace;
268
281
  }
269
282
  /**
270
283
  * type: `NextTrace`
271
- * - the trace of a call chain across internal hops (v5 B13).
284
+ * - the trace of a call chain across internal hops (v5 B14).
272
285
  */
273
286
  export interface NextTrace {
274
287
  /**
@@ -11,7 +11,8 @@
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`.
15
16
  *
16
17
  * @copyright (C) lemoncloud.io 2019 - All Rights Reserved.
17
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;;;;;;;;;;;;;;;;GAgBG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lemon-model",
3
- "version": "5.0.1",
3
+ "version": "5.0.2",
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",