@pax2pay/model-banking 0.1.430 → 0.1.432
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/Authorization/Creatable.ts +2 -0
- package/Authorization/index.ts +2 -1
- package/Log/Locations.ts +25 -0
- package/Log/Message/Entry.ts +0 -11
- package/Log/index.ts +6 -3
- package/dist/Authorization/Creatable.d.ts +1 -0
- package/dist/Authorization/Creatable.js +1 -0
- package/dist/Authorization/Creatable.js.map +1 -1
- package/dist/Authorization/index.js +1 -0
- package/dist/Authorization/index.js.map +1 -1
- package/dist/Log/Locations.d.ts +10 -0
- package/dist/Log/Locations.js +21 -0
- package/dist/Log/Locations.js.map +1 -0
- package/dist/Log/Message/Entry.d.ts +0 -1
- package/dist/Log/Message/Entry.js +0 -12
- package/dist/Log/Message/Entry.js.map +1 -1
- package/dist/Log/index.d.ts +3 -1
- package/dist/Log/index.js +5 -3
- package/dist/Log/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -14,6 +14,7 @@ export interface Creatable {
|
|
|
14
14
|
acquirer: Acquirer
|
|
15
15
|
reference: string
|
|
16
16
|
description: string
|
|
17
|
+
approvalCode?: string
|
|
17
18
|
}
|
|
18
19
|
export namespace Creatable {
|
|
19
20
|
export const type = isly.object<Creatable>({
|
|
@@ -25,5 +26,6 @@ export namespace Creatable {
|
|
|
25
26
|
acquirer: Acquirer.type,
|
|
26
27
|
reference: isly.string(),
|
|
27
28
|
description: isly.string(),
|
|
29
|
+
approvalCode: isly.string().optional(),
|
|
28
30
|
})
|
|
29
31
|
}
|
package/Authorization/index.ts
CHANGED
|
@@ -71,7 +71,7 @@ export namespace Authorization {
|
|
|
71
71
|
): Authorization {
|
|
72
72
|
const partial: Pick<
|
|
73
73
|
Authorization,
|
|
74
|
-
"created" | "amount" | "merchant" | "acquirer" | "reference" | "description" | "exchange"
|
|
74
|
+
"created" | "amount" | "merchant" | "acquirer" | "reference" | "description" | "exchange" | "approvalCode"
|
|
75
75
|
> = {
|
|
76
76
|
created: isoly.DateTime.now(),
|
|
77
77
|
amount: creatable.amount,
|
|
@@ -80,6 +80,7 @@ export namespace Authorization {
|
|
|
80
80
|
reference: creatable.reference,
|
|
81
81
|
description: creatable.description,
|
|
82
82
|
exchange: creatable.exchange,
|
|
83
|
+
approvalCode: creatable.approvalCode,
|
|
83
84
|
}
|
|
84
85
|
let result: Authorization
|
|
85
86
|
if (gracely.Error.is(transaction))
|
package/Log/Locations.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { isly } from "isly"
|
|
2
|
+
|
|
3
|
+
export interface Locations {
|
|
4
|
+
cfConnectionIp?: string
|
|
5
|
+
cfIpCountry?: string
|
|
6
|
+
datacenter?: string
|
|
7
|
+
country?: string
|
|
8
|
+
}
|
|
9
|
+
export namespace Locations {
|
|
10
|
+
export const type = isly.object<Locations>({
|
|
11
|
+
cfConnectionIp: isly.string().optional(),
|
|
12
|
+
cfIpCountry: isly.string().optional(),
|
|
13
|
+
datacenter: isly.string().optional(),
|
|
14
|
+
country: isly.string().optional(),
|
|
15
|
+
})
|
|
16
|
+
export function getLocations(request: any): Locations | undefined {
|
|
17
|
+
const locations = {
|
|
18
|
+
"cf-connecting-ip": request.headers.get("cf-connecting-ip"),
|
|
19
|
+
"cf-ipcountry": request.headers.get("cf-ipcountry"),
|
|
20
|
+
datacenter: request.cf?.colo,
|
|
21
|
+
country: request.cf?.country,
|
|
22
|
+
}
|
|
23
|
+
return type.is(locations) ? locations : undefined
|
|
24
|
+
}
|
|
25
|
+
}
|
package/Log/Message/Entry.ts
CHANGED
|
@@ -24,15 +24,4 @@ export namespace Entry {
|
|
|
24
24
|
}
|
|
25
25
|
: undefined
|
|
26
26
|
}
|
|
27
|
-
export function getLocationEntry(request: any): Entry {
|
|
28
|
-
return {
|
|
29
|
-
message: "Locations",
|
|
30
|
-
data: {
|
|
31
|
-
"cf-connecting-ip": request.headers["cf-connecting-ip"],
|
|
32
|
-
"cf-ipcountry": request.headers["cf-ipcountry"],
|
|
33
|
-
datacenter: request.cf.colo,
|
|
34
|
-
country: request.cf.country,
|
|
35
|
-
},
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
27
|
}
|
package/Log/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { isly } from "isly"
|
|
|
4
4
|
import { Identifier } from "../Identifier"
|
|
5
5
|
import { Realm } from "../Realm"
|
|
6
6
|
import { Entry as LogEntry } from "./Entry"
|
|
7
|
+
import { Locations as LogLocations } from "./Locations"
|
|
7
8
|
import { Message as LogMessage } from "./Message"
|
|
8
9
|
|
|
9
10
|
export interface Log {
|
|
@@ -18,6 +19,7 @@ export interface Log {
|
|
|
18
19
|
export namespace Log {
|
|
19
20
|
export import Message = LogMessage
|
|
20
21
|
export import Entry = LogEntry
|
|
22
|
+
export import Locations = LogLocations
|
|
21
23
|
export const type = isly.object<Log>({
|
|
22
24
|
id: Identifier.type,
|
|
23
25
|
realm: Realm.type,
|
|
@@ -44,8 +46,6 @@ export namespace Log {
|
|
|
44
46
|
}
|
|
45
47
|
message.resource && (log.resource = message.resource)
|
|
46
48
|
event.scriptName && (log.script = event.scriptName)
|
|
47
|
-
if (event.event && "request" in event.event)
|
|
48
|
-
log.entries.push(Log.Message.Entry.getLocationEntry(event.event.request))
|
|
49
49
|
result.push(log)
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -55,11 +55,14 @@ export namespace Log {
|
|
|
55
55
|
collection: string,
|
|
56
56
|
realm: string | undefined,
|
|
57
57
|
resource?: string,
|
|
58
|
-
requireEntries?: boolean
|
|
58
|
+
requireEntries?: boolean,
|
|
59
|
+
locations?: LogLocations
|
|
59
60
|
): void {
|
|
60
61
|
const configuration = { collection, realm, resource, requireEntries }
|
|
61
62
|
if (Log.Message.Configuration.type.is(configuration))
|
|
62
63
|
console.log(configuration)
|
|
64
|
+
if (Log.Locations.type.is(locations))
|
|
65
|
+
console.log(Log.Entry.Message.to("Locations", locations, resource))
|
|
63
66
|
}
|
|
64
67
|
export function log(message: string, data?: any, resource?: string): void {
|
|
65
68
|
console.log(Log.Entry.Message.to(message, data, resource))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Authorization/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Authorization/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAarC,MAAM,KAAW,SAAS,CAYzB;AAZD,WAAiB,SAAS;IACZ,cAAI,GAAG,IAAI,CAAC,MAAM,CAAY;QAC1C,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;QACnB,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACjC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;QACnF,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE;QAClC,QAAQ,EAAE,QAAQ,CAAC,IAAI;QACvB,QAAQ,EAAE,QAAQ,CAAC,IAAI;QACvB,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE;QACxB,WAAW,EAAE,IAAI,CAAC,MAAM,EAAE;QAC1B,YAAY,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACtC,CAAC,CAAA;AACH,CAAC,EAZgB,SAAS,KAAT,SAAS,QAYzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Authorization/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,SAAS,IAAI,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,EAAE,QAAQ,IAAI,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAC9D,OAAO,EAAE,MAAM,IAAI,mBAAmB,EAAE,MAAM,UAAU,CAAA;AA0BxD,MAAM,KAAW,aAAa,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Authorization/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,QAAQ,EAAE,MA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: string;
|
|
3
|
+
cfIpCountry?: string;
|
|
4
|
+
datacenter?: string;
|
|
5
|
+
country?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare namespace Locations {
|
|
8
|
+
const type: import("isly/dist/cjs/object").IslyObject<Locations, object>;
|
|
9
|
+
function getLocations(request: any): Locations | undefined;
|
|
10
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { isly } from "isly";
|
|
2
|
+
export var Locations;
|
|
3
|
+
(function (Locations) {
|
|
4
|
+
Locations.type = isly.object({
|
|
5
|
+
cfConnectionIp: isly.string().optional(),
|
|
6
|
+
cfIpCountry: isly.string().optional(),
|
|
7
|
+
datacenter: isly.string().optional(),
|
|
8
|
+
country: isly.string().optional(),
|
|
9
|
+
});
|
|
10
|
+
function getLocations(request) {
|
|
11
|
+
const locations = {
|
|
12
|
+
"cf-connecting-ip": request.headers.get("cf-connecting-ip"),
|
|
13
|
+
"cf-ipcountry": request.headers.get("cf-ipcountry"),
|
|
14
|
+
datacenter: request.cf?.colo,
|
|
15
|
+
country: request.cf?.country,
|
|
16
|
+
};
|
|
17
|
+
return Locations.type.is(locations) ? locations : undefined;
|
|
18
|
+
}
|
|
19
|
+
Locations.getLocations = getLocations;
|
|
20
|
+
})(Locations || (Locations = {}));
|
|
21
|
+
//# sourceMappingURL=Locations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Locations.js","sourceRoot":"../","sources":["Log/Locations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAQ3B,MAAM,KAAW,SAAS,CAgBzB;AAhBD,WAAiB,SAAS;IACZ,cAAI,GAAG,IAAI,CAAC,MAAM,CAAY;QAC1C,cAAc,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACxC,WAAW,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACrC,UAAU,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACpC,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACjC,CAAC,CAAA;IACF,SAAgB,YAAY,CAAC,OAAY;QACxC,MAAM,SAAS,GAAG;YACjB,kBAAkB,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;YAC3D,cAAc,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;YACnD,UAAU,EAAE,OAAO,CAAC,EAAE,EAAE,IAAI;YAC5B,OAAO,EAAE,OAAO,CAAC,EAAE,EAAE,OAAO;SAC5B,CAAA;QACD,OAAO,UAAA,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAA;IAClD,CAAC;IARe,sBAAY,eAQ3B,CAAA;AACF,CAAC,EAhBgB,SAAS,KAAT,SAAS,QAgBzB"}
|
|
@@ -18,17 +18,5 @@ export var Entry;
|
|
|
18
18
|
: undefined;
|
|
19
19
|
}
|
|
20
20
|
Entry.fromEventLogs = fromEventLogs;
|
|
21
|
-
function getLocationEntry(request) {
|
|
22
|
-
return {
|
|
23
|
-
message: "Locations",
|
|
24
|
-
data: {
|
|
25
|
-
"cf-connecting-ip": request.headers["cf-connecting-ip"],
|
|
26
|
-
"cf-ipcountry": request.headers["cf-ipcountry"],
|
|
27
|
-
datacenter: request.cf.colo,
|
|
28
|
-
country: request.cf.country,
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
Entry.getLocationEntry = getLocationEntry;
|
|
33
21
|
})(Entry || (Entry = {}));
|
|
34
22
|
//# sourceMappingURL=Entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Entry.js","sourceRoot":"../","sources":["Log/Message/Entry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAQ3B,MAAM,KAAW,KAAK,
|
|
1
|
+
{"version":3,"file":"Entry.js","sourceRoot":"../","sources":["Log/Message/Entry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAQ3B,MAAM,KAAW,KAAK,CAiBrB;AAjBD,WAAiB,KAAK;IACR,UAAI,GAAG,IAAI,CAAC,MAAM,CAAQ;QACtC,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE;QACtB,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAClC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;KAC3B,CAAC,CAAA;IACF,SAAgB,aAAa,CAAC,KAAe;QAC5C,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACrC,CAAC,CAAC;gBACA,KAAK,EAAE;oBACN,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO;oBACjC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI;iBAC3B;gBACD,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ;aAClC;YACH,CAAC,CAAC,SAAS,CAAA;IACb,CAAC;IAVe,mBAAa,gBAU5B,CAAA;AACF,CAAC,EAjBgB,KAAK,KAAL,KAAK,QAiBrB"}
|
package/dist/Log/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { TraceItem } from "@cloudflare/workers-types";
|
|
|
3
3
|
import { Identifier } from "../Identifier";
|
|
4
4
|
import { Realm } from "../Realm";
|
|
5
5
|
import { Entry as LogEntry } from "./Entry";
|
|
6
|
+
import { Locations as LogLocations } from "./Locations";
|
|
6
7
|
import { Message as LogMessage } from "./Message";
|
|
7
8
|
export interface Log {
|
|
8
9
|
id: Identifier;
|
|
@@ -16,9 +17,10 @@ export interface Log {
|
|
|
16
17
|
export declare namespace Log {
|
|
17
18
|
export import Message = LogMessage;
|
|
18
19
|
export import Entry = LogEntry;
|
|
20
|
+
export import Locations = LogLocations;
|
|
19
21
|
const type: import("isly/dist/cjs/object").IslyObject<Log, object>;
|
|
20
22
|
function fromEvents(events: TraceItem[]): Log[];
|
|
21
|
-
function configure(collection: string, realm: string | undefined, resource?: string, requireEntries?: boolean): void;
|
|
23
|
+
function configure(collection: string, realm: string | undefined, resource?: string, requireEntries?: boolean, locations?: LogLocations): void;
|
|
22
24
|
function log(message: string, data?: any, resource?: string): void;
|
|
23
25
|
function warning(message: string, data?: any, resource?: string): void;
|
|
24
26
|
function exception(message: string, data?: any, resource?: string): void;
|
package/dist/Log/index.js
CHANGED
|
@@ -3,11 +3,13 @@ import { isly } from "isly";
|
|
|
3
3
|
import { Identifier } from "../Identifier";
|
|
4
4
|
import { Realm } from "../Realm";
|
|
5
5
|
import { Entry as LogEntry } from "./Entry";
|
|
6
|
+
import { Locations as LogLocations } from "./Locations";
|
|
6
7
|
import { Message as LogMessage } from "./Message";
|
|
7
8
|
export var Log;
|
|
8
9
|
(function (Log) {
|
|
9
10
|
Log.Message = LogMessage;
|
|
10
11
|
Log.Entry = LogEntry;
|
|
12
|
+
Log.Locations = LogLocations;
|
|
11
13
|
Log.type = isly.object({
|
|
12
14
|
id: Identifier.type,
|
|
13
15
|
realm: Realm.type,
|
|
@@ -34,18 +36,18 @@ export var Log;
|
|
|
34
36
|
};
|
|
35
37
|
message.resource && (log.resource = message.resource);
|
|
36
38
|
event.scriptName && (log.script = event.scriptName);
|
|
37
|
-
if (event.event && "request" in event.event)
|
|
38
|
-
log.entries.push(Log.Message.Entry.getLocationEntry(event.event.request));
|
|
39
39
|
result.push(log);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
return result;
|
|
43
43
|
}
|
|
44
44
|
Log.fromEvents = fromEvents;
|
|
45
|
-
function configure(collection, realm, resource, requireEntries) {
|
|
45
|
+
function configure(collection, realm, resource, requireEntries, locations) {
|
|
46
46
|
const configuration = { collection, realm, resource, requireEntries };
|
|
47
47
|
if (Log.Message.Configuration.type.is(configuration))
|
|
48
48
|
console.log(configuration);
|
|
49
|
+
if (Log.Locations.type.is(locations))
|
|
50
|
+
console.log(Log.Entry.Message.to("Locations", locations, resource));
|
|
49
51
|
}
|
|
50
52
|
Log.configure = configure;
|
|
51
53
|
function log(message, data, resource) {
|
package/dist/Log/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Log/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAE7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,WAAW,CAAA;AAWjD,MAAM,KAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Log/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAE7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,SAAS,IAAI,YAAY,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,WAAW,CAAA;AAWjD,MAAM,KAAW,GAAG,CAyDnB;AAzDD,WAAiB,GAAG;IAC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