lemon-model 5.0.0 → 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,6 +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 B14: `NextContext.channel` and `NextContext.trace` (`NextTrace`).
|
|
14
|
+
* @date 2026-10-30 v5 B15: `NextIdentity.cid` and `NextIdentity.aid`.
|
|
13
15
|
*
|
|
14
16
|
* @copyright (C) lemoncloud.io 2019 - All Rights Reserved.
|
|
15
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-types.js","sourceRoot":"","sources":["../../../src/types/core-types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"core-types.js","sourceRoot":"","sources":["../../../src/types/core-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}
|
|
@@ -10,6 +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 B14: `NextContext.channel` and `NextContext.trace` (`NextTrace`).
|
|
14
|
+
* @date 2026-10-30 v5 B15: `NextIdentity.cid` and `NextIdentity.aid`.
|
|
13
15
|
*
|
|
14
16
|
* @copyright (C) lemoncloud.io 2019 - All Rights Reserved.
|
|
15
17
|
*/
|
|
@@ -82,6 +84,17 @@ export interface NextIdentity<T = any> {
|
|
|
82
84
|
* @since ver2.2.3 2020/JUL/15
|
|
83
85
|
*/
|
|
84
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;
|
|
85
98
|
/**
|
|
86
99
|
* (optional) internal last-error message
|
|
87
100
|
* - if this is not empty, then DO NOT use this object.
|
|
@@ -224,7 +237,8 @@ export interface NextContext<T extends NextIdentity = NextIdentity> {
|
|
|
224
237
|
*/
|
|
225
238
|
requestId?: string;
|
|
226
239
|
/**
|
|
227
|
-
* id of aws account number
|
|
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).
|
|
228
242
|
*/
|
|
229
243
|
accountId?: string;
|
|
230
244
|
/**
|
|
@@ -253,6 +267,43 @@ export interface NextContext<T extends NextIdentity = NextIdentity> {
|
|
|
253
267
|
* calling depth for every handler. ( automatically increased from lambda-handler )
|
|
254
268
|
*/
|
|
255
269
|
depth?: number;
|
|
270
|
+
/**
|
|
271
|
+
* (optional) the channel of this request, set once by the receiving entry (v5 B14).
|
|
272
|
+
* - `external`: a web request with a `host` header (API Gateway, ALB, Function URL).
|
|
273
|
+
* - `internal`: a host-less web event (direct invoke) or a protocol call (relay, SNS, SQS).
|
|
274
|
+
* - `local`: the local express harness (local mode).
|
|
275
|
+
*/
|
|
276
|
+
channel?: 'external' | 'internal' | 'local';
|
|
277
|
+
/**
|
|
278
|
+
* (optional) the trace of the call chain, set by the receiving entry (v5 B14).
|
|
279
|
+
*/
|
|
280
|
+
trace?: NextTrace;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* type: `NextTrace`
|
|
284
|
+
* - the trace of a call chain across internal hops (v5 B14).
|
|
285
|
+
*/
|
|
286
|
+
export interface NextTrace {
|
|
287
|
+
/**
|
|
288
|
+
* trace id: the requestId of the first entry of the chain.
|
|
289
|
+
*/
|
|
290
|
+
tid: string;
|
|
291
|
+
/**
|
|
292
|
+
* hop count from the first entry (the first entry is `0`).
|
|
293
|
+
*/
|
|
294
|
+
hop: number;
|
|
295
|
+
/**
|
|
296
|
+
* (optional) service uri of the direct caller (the previous hop).
|
|
297
|
+
*/
|
|
298
|
+
via?: string;
|
|
299
|
+
/**
|
|
300
|
+
* (optional) requestId of the direct caller (the previous hop).
|
|
301
|
+
*/
|
|
302
|
+
pid?: string;
|
|
303
|
+
/**
|
|
304
|
+
* (optional) the first request path uri of the chain (like `context.source`).
|
|
305
|
+
*/
|
|
306
|
+
src?: string;
|
|
256
307
|
}
|
|
257
308
|
/**
|
|
258
309
|
* type: `NextHandler`
|
package/dist/types/core-types.js
CHANGED
|
@@ -11,6 +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 B14: `NextContext.channel` and `NextContext.trace` (`NextTrace`).
|
|
15
|
+
* @date 2026-10-30 v5 B15: `NextIdentity.cid` and `NextIdentity.aid`.
|
|
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
|
|
1
|
+
{"version":3,"file":"core-types.js","sourceRoot":"","sources":["../../src/types/core-types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG"}
|