@spinajs/email-verification-orm 0.0.0-stage → 3.0.8
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 +8 -2
- package/lib/cjs/connection.d.ts +3 -0
- package/lib/cjs/connection.d.ts.map +1 -0
- package/lib/cjs/connection.js +12 -0
- package/lib/cjs/connection.js.map +1 -0
- package/lib/cjs/index.d.ts +5 -0
- package/lib/cjs/index.d.ts.map +1 -0
- package/lib/cjs/index.js +21 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/migrations/EmailVerification_2026_10_21_00_00_00.d.ts +11 -0
- package/lib/cjs/migrations/EmailVerification_2026_10_21_00_00_00.d.ts.map +1 -0
- package/lib/cjs/migrations/EmailVerification_2026_10_21_00_00_00.js +56 -0
- package/lib/cjs/migrations/EmailVerification_2026_10_21_00_00_00.js.map +1 -0
- package/lib/cjs/package.json +1 -0
- package/lib/cjs/store.d.ts +49 -0
- package/lib/cjs/store.d.ts.map +1 -0
- package/lib/cjs/store.js +300 -0
- package/lib/cjs/store.js.map +1 -0
- package/lib/cjs/tables.d.ts +5 -0
- package/lib/cjs/tables.d.ts.map +1 -0
- package/lib/cjs/tables.js +8 -0
- package/lib/cjs/tables.js.map +1 -0
- package/lib/mjs/connection.d.ts +3 -0
- package/lib/mjs/connection.d.ts.map +1 -0
- package/lib/mjs/connection.js +8 -0
- package/lib/mjs/connection.js.map +1 -0
- package/lib/mjs/index.d.ts +5 -0
- package/lib/mjs/index.d.ts.map +1 -0
- package/lib/mjs/index.js +5 -0
- package/lib/mjs/index.js.map +1 -0
- package/lib/mjs/migrations/EmailVerification_2026_10_21_00_00_00.d.ts +11 -0
- package/lib/mjs/migrations/EmailVerification_2026_10_21_00_00_00.d.ts.map +1 -0
- package/lib/mjs/migrations/EmailVerification_2026_10_21_00_00_00.js +53 -0
- package/lib/mjs/migrations/EmailVerification_2026_10_21_00_00_00.js.map +1 -0
- package/lib/mjs/package.json +1 -0
- package/lib/mjs/store.d.ts +49 -0
- package/lib/mjs/store.d.ts.map +1 -0
- package/lib/mjs/store.js +297 -0
- package/lib/mjs/store.js.map +1 -0
- package/lib/mjs/tables.d.ts +5 -0
- package/lib/mjs/tables.d.ts.map +1 -0
- package/lib/mjs/tables.js +5 -0
- package/lib/mjs/tables.js.map +1 -0
- package/lib/tsconfig.cjs.tsbuildinfo +1 -0
- package/lib/tsconfig.mjs.tsbuildinfo +1 -0
- package/package.json +69 -4
package/README.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@spinajs/email-verification-orm`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Relational-database store for `@spinajs/email-verification`. Select it with
|
|
4
|
+
`emailVerification.store: 'OrmEmailVerificationStore'`. Its migration runs on the connection named by
|
|
5
|
+
`emailVerification.orm.connection` (default `email-verification-connection`).
|
|
6
|
+
|
|
7
|
+
## Documentation
|
|
8
|
+
|
|
9
|
+
- [Package overview](../../docs/email-verification-orm/README.md)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/connection.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,kCAAkC,CAAC;AAEtE,wBAAgB,aAAa,IAAI,MAAM,CAGtC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_ORM_CONNECTION = void 0;
|
|
4
|
+
exports.ormConnection = ormConnection;
|
|
5
|
+
const configuration_1 = require("@spinajs/configuration");
|
|
6
|
+
const di_1 = require("@spinajs/di");
|
|
7
|
+
exports.DEFAULT_ORM_CONNECTION = 'email-verification-connection';
|
|
8
|
+
function ormConnection() {
|
|
9
|
+
const cfg = di_1.DI.get(configuration_1.Configuration);
|
|
10
|
+
return cfg?.get('emailVerification.orm.connection') ?? exports.DEFAULT_ORM_CONNECTION;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=connection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../src/connection.ts"],"names":[],"mappings":";;;;AAAA,0DAAuD;AACvD,oCAAiC;AAEpB,QAAA,sBAAsB,GAAG,+BAA+B,CAAC;AAEtE;IACE,MAAM,GAAG,GAAG,OAAE,CAAC,GAAG,CAAC,6BAAa,CAA8B,CAAC;IAC/D,OAAO,GAAG,EAAE,GAAG,CAAS,kCAAkC,CAAC,IAAI,QAAA,sBAAsB,CAAC;AACxF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,uDAAuD,CAAC"}
|
package/lib/cjs/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./connection.js"), exports);
|
|
18
|
+
__exportStar(require("./tables.js"), exports);
|
|
19
|
+
__exportStar(require("./store.js"), exports);
|
|
20
|
+
__exportStar(require("./migrations/EmailVerification_2026_10_21_00_00_00.js"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,8CAA4B;AAC5B,6CAA2B;AAC3B,wFAAsE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OrmMigration } from '@spinajs/orm';
|
|
2
|
+
import type { OrmDriver } from '@spinajs/orm';
|
|
3
|
+
/**
|
|
4
|
+
* Lists are stored as generations: a source row points at its live `gen`, and a write
|
|
5
|
+
* fills a new generation before it moves the pointer (OrmEmailVerificationStore).
|
|
6
|
+
*/
|
|
7
|
+
export declare class EmailVerification_2026_10_21_00_00_00 extends OrmMigration {
|
|
8
|
+
up(connection: OrmDriver): Promise<void>;
|
|
9
|
+
down(connection: OrmDriver): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=EmailVerification_2026_10_21_00_00_00.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmailVerification_2026_10_21_00_00_00.d.ts","sourceRoot":"","sources":["../../../src/migrations/EmailVerification_2026_10_21_00_00_00.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,YAAY,EAA8B,MAAM,cAAc,CAAC;AACnF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAK9C;;;GAGG;AACH,qBACa,qCAAsC,SAAQ,YAAY;IACxD,EAAE,CAAC,UAAU,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CA6BpD;IAEY,IAAI,CAAC,UAAU,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAEtD;CACF"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.EmailVerification_2026_10_21_00_00_00 = void 0;
|
|
10
|
+
const orm_1 = require("@spinajs/orm");
|
|
11
|
+
const connection_js_1 = require("../connection.js");
|
|
12
|
+
const tables_js_1 = require("../tables.js");
|
|
13
|
+
/**
|
|
14
|
+
* Lists are stored as generations: a source row points at its live `gen`, and a write
|
|
15
|
+
* fills a new generation before it moves the pointer (OrmEmailVerificationStore).
|
|
16
|
+
*/
|
|
17
|
+
let EmailVerification_2026_10_21_00_00_00 = class EmailVerification_2026_10_21_00_00_00 extends orm_1.OrmMigration {
|
|
18
|
+
async up(connection) {
|
|
19
|
+
await connection.schema().createTable(tables_js_1.VERDICTS_TABLE, (t) => {
|
|
20
|
+
t.string('key', 300).notNull().primaryKey().exact();
|
|
21
|
+
t.string('result', 8).notNull();
|
|
22
|
+
t.string('reason', 64);
|
|
23
|
+
t.string('source', 80);
|
|
24
|
+
t.bigint('checked_at').notNull();
|
|
25
|
+
t.bigint('expires_at').notNull();
|
|
26
|
+
});
|
|
27
|
+
await connection.index().table(tables_js_1.VERDICTS_TABLE).name('ev_verdicts_expires').columns(['expires_at']);
|
|
28
|
+
await connection.schema().createTable(tables_js_1.SOURCES_TABLE, (t) => {
|
|
29
|
+
t.string('key', 80).notNull().primaryKey().exact();
|
|
30
|
+
t.string('gen', 36).notNull().exact();
|
|
31
|
+
});
|
|
32
|
+
await connection.schema().createTable(tables_js_1.ENTRIES_TABLE, (t) => {
|
|
33
|
+
t.string('key', 300).notNull().primaryKey().exact();
|
|
34
|
+
t.string('gen', 36).notNull().exact();
|
|
35
|
+
t.string('domain', 253).notNull().exact();
|
|
36
|
+
t.bigint('created_at').notNull();
|
|
37
|
+
});
|
|
38
|
+
// Serves the per-generation reads and deletes, and the cleanup's MAX(created_at) ... GROUP BY gen.
|
|
39
|
+
await connection.index().table(tables_js_1.ENTRIES_TABLE).name('ev_entries_gen_created').columns(['gen', 'created_at']);
|
|
40
|
+
await connection.schema().createTable(tables_js_1.META_TABLE, (t) => {
|
|
41
|
+
t.string('key', 128).notNull().primaryKey().exact();
|
|
42
|
+
t.text('value').notNull();
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
async down(connection) {
|
|
46
|
+
for (const table of [tables_js_1.VERDICTS_TABLE, tables_js_1.SOURCES_TABLE, tables_js_1.ENTRIES_TABLE, tables_js_1.META_TABLE])
|
|
47
|
+
await connection.schema().dropTable(table);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
exports.EmailVerification_2026_10_21_00_00_00 = EmailVerification_2026_10_21_00_00_00;
|
|
51
|
+
exports.EmailVerification_2026_10_21_00_00_00 = EmailVerification_2026_10_21_00_00_00 = __decorate([
|
|
52
|
+
(0, orm_1.Migration)(connection_js_1.DEFAULT_ORM_CONNECTION)
|
|
53
|
+
], EmailVerification_2026_10_21_00_00_00);
|
|
54
|
+
// Read when the migrations run, so the tables land on the connection the store uses.
|
|
55
|
+
Object.defineProperty((0, orm_1.extractMigrationDescriptor)(EmailVerification_2026_10_21_00_00_00), 'Connection', { get: () => (0, connection_js_1.ormConnection)(), enumerable: true, configurable: true });
|
|
56
|
+
//# sourceMappingURL=EmailVerification_2026_10_21_00_00_00.js.map
|
|
@@ -0,0 +1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,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC7H,CAAC;CACF,CAAA;;gDAnCY,qCAAqC;IADjD,IAAA,eAAS,EAAC,sCAAsB,CAAC;GACrB,qCAAqC,CAmCjD;AAED,qFAAqF;AACrF,MAAM,CAAC,cAAc,CAAC,IAAA,gCAA0B,EAAC,qCAAqC,CAAE,EAAE,YAAY,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,IAAA,6BAAa,GAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { EmailVerificationStore } from '@spinajs/email-verification';
|
|
2
|
+
import type { CachedVerdict, ListEntry, ListKind, OrmStoreOptions } from '@spinajs/email-verification';
|
|
3
|
+
import { Log } from '@spinajs/log';
|
|
4
|
+
import type { IWhereBuilder, OrmDriver } from '@spinajs/orm';
|
|
5
|
+
interface SourceRow {
|
|
6
|
+
key: string;
|
|
7
|
+
gen: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Each list source points at a generation of entry rows. A write fills a new generation,
|
|
11
|
+
* moves the pointer with a compare-and-set, then drops the old rows. A read checks that
|
|
12
|
+
* no pointer moved while it read, so it never returns a half-replaced source.
|
|
13
|
+
*/
|
|
14
|
+
export declare class OrmEmailVerificationStore extends EmailVerificationStore {
|
|
15
|
+
protected Options: OrmStoreOptions;
|
|
16
|
+
protected Log: Log;
|
|
17
|
+
protected CleanupTimer: ReturnType<typeof setInterval> | undefined;
|
|
18
|
+
protected CleanupRunning: boolean;
|
|
19
|
+
resolve(): Promise<void>;
|
|
20
|
+
dispose(): Promise<void>;
|
|
21
|
+
/** A tick that finds the previous cleanup still running is skipped. */
|
|
22
|
+
protected runCleanup(): Promise<void>;
|
|
23
|
+
/** Deletes expired verdicts and the entries of generations no source points at (left by failed writes). */
|
|
24
|
+
cleanupExpired(): Promise<number>;
|
|
25
|
+
protected deleteDeadGenerations(d: OrmDriver, createdBefore: number): Promise<number>;
|
|
26
|
+
protected deleteInBatches(d: OrmDriver, table: string, filter: (q: IWhereBuilder<unknown>) => unknown): Promise<number>;
|
|
27
|
+
getVerdict(verifier: string, domain: string): Promise<CachedVerdict | null>;
|
|
28
|
+
setVerdict(verifier: string, domain: string, verdict: CachedVerdict, ttlSeconds: number): Promise<void>;
|
|
29
|
+
getMeta(key: string): Promise<string | null>;
|
|
30
|
+
setMeta(key: string, value: string): Promise<void>;
|
|
31
|
+
listVersion(): Promise<string>;
|
|
32
|
+
loadLists(): Promise<ListEntry[]>;
|
|
33
|
+
upsertEntries(entries: readonly ListEntry[]): Promise<void>;
|
|
34
|
+
removeEntries(kind: ListKind, domains: readonly string[], source: string): Promise<void>;
|
|
35
|
+
replaceSource(source: string, kind: ListKind, domains: readonly string[]): Promise<void>;
|
|
36
|
+
protected mutateSource(kind: ListKind, source: string, change: (current: Set<string>) => Set<string>, readCurrent?: boolean): Promise<void>;
|
|
37
|
+
/** Points `key` at a new generation holding `domains`; false when another writer moved it first. */
|
|
38
|
+
protected swap(d: OrmDriver, key: string, oldGen: string | undefined, domains: string[]): Promise<boolean>;
|
|
39
|
+
/** Best effort: a generation no source points at is reclaimed by the cleanup anyway. */
|
|
40
|
+
protected dropGeneration(d: OrmDriver, gen: string, failure: string): Promise<void>;
|
|
41
|
+
protected insertSource(d: OrmDriver, key: string, gen: string): Promise<boolean>;
|
|
42
|
+
protected upsert(table: string, key: string, values: Record<string, unknown>): Promise<void>;
|
|
43
|
+
protected sourceRow(d: OrmDriver, key: string): Promise<SourceRow | undefined>;
|
|
44
|
+
protected sourceRows(d: OrmDriver): Promise<SourceRow[]>;
|
|
45
|
+
protected domainsOf(d: OrmDriver, gen: string): Promise<string[]>;
|
|
46
|
+
protected driver(): Promise<OrmDriver>;
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceM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,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAmC/G;IAED,wFAAwF;IACxF,UAAgB,cAAc,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMxF;IAED,UAAgB,YAAY,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAUrF;IAED,UAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjG;IAED,UAAgB,SAAS,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAEnF;IAED,UAAgB,UAAU,CAAC,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAE7D;IAED,UAAgB,SAAS,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAEtE;IAED,UAAgB,MAAM,IAAI,OAAO,CAAC,SAAS,CAAC,CAO3C;CACF"}
|
package/lib/cjs/store.js
ADDED
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.OrmEmailVerificationStore = void 0;
|
|
13
|
+
const node_crypto_1 = require("node:crypto");
|
|
14
|
+
const configuration_1 = require("@spinajs/configuration");
|
|
15
|
+
const di_1 = require("@spinajs/di");
|
|
16
|
+
const email_verification_1 = require("@spinajs/email-verification");
|
|
17
|
+
const exceptions_1 = require("@spinajs/exceptions");
|
|
18
|
+
const log_1 = require("@spinajs/log");
|
|
19
|
+
const orm_1 = require("@spinajs/orm");
|
|
20
|
+
const util_1 = require("@spinajs/util");
|
|
21
|
+
const tables_js_1 = require("./tables.js");
|
|
22
|
+
const MAX_ATTEMPTS = 5;
|
|
23
|
+
// 200 rows x 4 columns stays under the bound-parameter limits of sqlite (999) and MSSQL (2100).
|
|
24
|
+
const INSERT_CHUNK = 200;
|
|
25
|
+
const CLEANUP_BATCH = 500;
|
|
26
|
+
// A writer fills its generation before it points a source at it; younger unreferenced rows may be in flight.
|
|
27
|
+
// A writer that stalls longer than this can lose its generation to the sweep; all nodes' clocks must agree within it.
|
|
28
|
+
const DEAD_GENERATION_GRACE_MS = 60 * 60 * 1000;
|
|
29
|
+
const LIST_VERSION = 'listVersion';
|
|
30
|
+
const rowsAffected = (result) => result?.RowsAffected ?? 0;
|
|
31
|
+
const sourceKey = (kind, source) => `${kind}|${source}`;
|
|
32
|
+
const splitSourceKey = (key) => {
|
|
33
|
+
const at = key.indexOf('|');
|
|
34
|
+
return [key.slice(0, at), key.slice(at + 1)];
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Each list source points at a generation of entry rows. A write fills a new generation,
|
|
38
|
+
* moves the pointer with a compare-and-set, then drops the old rows. A read checks that
|
|
39
|
+
* no pointer moved while it read, so it never returns a half-replaced source.
|
|
40
|
+
*/
|
|
41
|
+
let OrmEmailVerificationStore = class OrmEmailVerificationStore extends email_verification_1.EmailVerificationStore {
|
|
42
|
+
constructor() {
|
|
43
|
+
super(...arguments);
|
|
44
|
+
this.CleanupRunning = false;
|
|
45
|
+
}
|
|
46
|
+
async resolve() {
|
|
47
|
+
this.CleanupTimer = setInterval(() => void this.runCleanup(), this.Options.cleanupIntervalMs);
|
|
48
|
+
this.CleanupTimer.unref?.();
|
|
49
|
+
await super.resolve();
|
|
50
|
+
}
|
|
51
|
+
async dispose() {
|
|
52
|
+
clearInterval(this.CleanupTimer);
|
|
53
|
+
this.CleanupTimer = undefined;
|
|
54
|
+
}
|
|
55
|
+
/** A tick that finds the previous cleanup still running is skipped. */
|
|
56
|
+
async runCleanup() {
|
|
57
|
+
if (this.CleanupRunning)
|
|
58
|
+
return;
|
|
59
|
+
this.CleanupRunning = true;
|
|
60
|
+
try {
|
|
61
|
+
await this.cleanupExpired();
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
this.Log.error(err, 'Email verification cleanup failed');
|
|
65
|
+
}
|
|
66
|
+
finally {
|
|
67
|
+
this.CleanupRunning = false;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/** Deletes expired verdicts and the entries of generations no source points at (left by failed writes). */
|
|
71
|
+
async cleanupExpired() {
|
|
72
|
+
const d = await this.driver();
|
|
73
|
+
const now = Date.now();
|
|
74
|
+
const verdicts = await this.deleteInBatches(d, tables_js_1.VERDICTS_TABLE, (q) => q.where('expires_at', '<=', now));
|
|
75
|
+
return verdicts + (await this.deleteDeadGenerations(d, now - DEAD_GENERATION_GRACE_MS));
|
|
76
|
+
}
|
|
77
|
+
async deleteDeadGenerations(d, createdBefore) {
|
|
78
|
+
const gens = (await d.select().from(tables_js_1.ENTRIES_TABLE).columns(['gen']).max('created_at', 'newest').groupBy('gen'));
|
|
79
|
+
// Read after the generations, so a pointer moved in between still protects its generation.
|
|
80
|
+
const live = new Set((await this.sourceRows(d)).map((r) => r.gen));
|
|
81
|
+
let removed = 0;
|
|
82
|
+
for (const { gen, newest } of gens) {
|
|
83
|
+
if (!live.has(gen) && Number(newest) < createdBefore)
|
|
84
|
+
removed += await this.deleteInBatches(d, tables_js_1.ENTRIES_TABLE, (q) => q.where({ gen }));
|
|
85
|
+
}
|
|
86
|
+
return removed;
|
|
87
|
+
}
|
|
88
|
+
async deleteInBatches(d, table, filter) {
|
|
89
|
+
let removed = 0;
|
|
90
|
+
for (;;) {
|
|
91
|
+
const select = d.select().from(table).columns(['key']).orderBy('key').take(CLEANUP_BATCH);
|
|
92
|
+
filter(select);
|
|
93
|
+
const keys = (await select).map((r) => r.key);
|
|
94
|
+
if (keys.length === 0)
|
|
95
|
+
break;
|
|
96
|
+
// The filter is applied again so a row refreshed since the select survives.
|
|
97
|
+
const del = d.del().from(table).whereIn('key', keys);
|
|
98
|
+
filter(del);
|
|
99
|
+
const deleted = rowsAffected(await del);
|
|
100
|
+
removed += deleted;
|
|
101
|
+
if (keys.length < CLEANUP_BATCH || deleted === 0)
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
return removed;
|
|
105
|
+
}
|
|
106
|
+
async getVerdict(verifier, domain) {
|
|
107
|
+
const rows = (await (await this.driver()).select().from(tables_js_1.VERDICTS_TABLE).where({ key: `${verifier}:${domain}` }));
|
|
108
|
+
const row = rows[0];
|
|
109
|
+
if (!row || Number(row.expires_at) <= Date.now())
|
|
110
|
+
return null;
|
|
111
|
+
return {
|
|
112
|
+
result: row.result,
|
|
113
|
+
checkedAt: Number(row.checked_at),
|
|
114
|
+
...(row.reason === null ? {} : { reason: row.reason }),
|
|
115
|
+
...(row.source === null ? {} : { source: row.source }),
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
async setVerdict(verifier, domain, verdict, ttlSeconds) {
|
|
119
|
+
if (ttlSeconds <= 0)
|
|
120
|
+
return;
|
|
121
|
+
const values = {
|
|
122
|
+
result: verdict.result,
|
|
123
|
+
reason: verdict.reason ?? null,
|
|
124
|
+
source: verdict.source ?? null,
|
|
125
|
+
checked_at: verdict.checkedAt,
|
|
126
|
+
expires_at: Date.now() + ttlSeconds * 1000,
|
|
127
|
+
};
|
|
128
|
+
await this.upsert(tables_js_1.VERDICTS_TABLE, `${verifier}:${domain}`, values);
|
|
129
|
+
}
|
|
130
|
+
async getMeta(key) {
|
|
131
|
+
const rows = (await (await this.driver()).select().from(tables_js_1.META_TABLE).where({ key }));
|
|
132
|
+
return rows[0]?.value ?? null;
|
|
133
|
+
}
|
|
134
|
+
async setMeta(key, value) {
|
|
135
|
+
await this.upsert(tables_js_1.META_TABLE, key, { value });
|
|
136
|
+
}
|
|
137
|
+
async listVersion() {
|
|
138
|
+
return (await this.getMeta(LIST_VERSION)) ?? '0';
|
|
139
|
+
}
|
|
140
|
+
async loadLists() {
|
|
141
|
+
const d = await this.driver();
|
|
142
|
+
for (let attempt = 0; attempt < MAX_ATTEMPTS; attempt++) {
|
|
143
|
+
const before = await this.sourceRows(d);
|
|
144
|
+
const entries = [];
|
|
145
|
+
for (const row of before) {
|
|
146
|
+
const [kind, source] = splitSourceKey(row.key);
|
|
147
|
+
for (const domain of await this.domainsOf(d, row.gen))
|
|
148
|
+
entries.push({ domain, kind, source });
|
|
149
|
+
}
|
|
150
|
+
const after = await this.sourceRows(d);
|
|
151
|
+
if (samePointers(before, after))
|
|
152
|
+
return entries;
|
|
153
|
+
}
|
|
154
|
+
throw new exceptions_1.InvalidOperation(`email domain lists kept changing during ${MAX_ATTEMPTS} reads`);
|
|
155
|
+
}
|
|
156
|
+
async upsertEntries(entries) {
|
|
157
|
+
for (const [key, domains] of groupBySource(entries)) {
|
|
158
|
+
const [kind, source] = splitSourceKey(key);
|
|
159
|
+
await this.mutateSource(kind, source, (current) => new Set([...current, ...domains]));
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
async removeEntries(kind, domains, source) {
|
|
163
|
+
await this.mutateSource(kind, source, (current) => {
|
|
164
|
+
domains.forEach((d) => current.delete(d));
|
|
165
|
+
return current;
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
async replaceSource(source, kind, domains) {
|
|
169
|
+
await this.mutateSource(kind, source, () => new Set(domains), false);
|
|
170
|
+
}
|
|
171
|
+
async mutateSource(kind, source, change, readCurrent = true) {
|
|
172
|
+
const d = await this.driver();
|
|
173
|
+
const key = sourceKey(kind, source);
|
|
174
|
+
for (let attempt = 0; attempt < MAX_ATTEMPTS; attempt++) {
|
|
175
|
+
const old = await this.sourceRow(d, key);
|
|
176
|
+
const current = new Set(old && readCurrent ? await this.domainsOf(d, old.gen) : []);
|
|
177
|
+
if (await this.swap(d, key, old?.gen, [...change(current)])) {
|
|
178
|
+
try {
|
|
179
|
+
await this.setMeta(LIST_VERSION, (0, node_crypto_1.randomUUID)());
|
|
180
|
+
}
|
|
181
|
+
finally {
|
|
182
|
+
if (old)
|
|
183
|
+
await this.dropGeneration(d, old.gen, 'Cannot drop an old email domain list generation; the cleanup will reclaim it');
|
|
184
|
+
}
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
throw new exceptions_1.InvalidOperation(`email domain list ${key} kept changing during ${MAX_ATTEMPTS} writes`);
|
|
189
|
+
}
|
|
190
|
+
/** Points `key` at a new generation holding `domains`; false when another writer moved it first. */
|
|
191
|
+
async swap(d, key, oldGen, domains) {
|
|
192
|
+
if (domains.length === 0) {
|
|
193
|
+
if (oldGen === undefined)
|
|
194
|
+
return true;
|
|
195
|
+
try {
|
|
196
|
+
return rowsAffected(await d.del().from(tables_js_1.SOURCES_TABLE).where({ key, gen: oldGen })) === 1;
|
|
197
|
+
}
|
|
198
|
+
catch (err) {
|
|
199
|
+
// The delete may have landed before the client saw the error.
|
|
200
|
+
const gone = await this.sourceRow(d, key).then((row) => row === undefined, () => false);
|
|
201
|
+
if (gone)
|
|
202
|
+
return true;
|
|
203
|
+
throw err;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
const gen = (0, node_crypto_1.randomUUID)();
|
|
207
|
+
const createdAt = Date.now();
|
|
208
|
+
try {
|
|
209
|
+
for (const part of (0, util_1.chunk)(domains, INSERT_CHUNK)) {
|
|
210
|
+
await d.insert().into(tables_js_1.ENTRIES_TABLE).values(part.map((domain) => ({ key: `${gen}|${domain}`, gen, domain, created_at: createdAt })));
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
catch (err) {
|
|
214
|
+
await this.dropGeneration(d, gen, 'Cannot drop an unfinished email domain list generation; the cleanup will reclaim it');
|
|
215
|
+
throw err;
|
|
216
|
+
}
|
|
217
|
+
let moved;
|
|
218
|
+
try {
|
|
219
|
+
moved = oldGen === undefined ? await this.insertSource(d, key, gen) : rowsAffected(await d.update().in(tables_js_1.SOURCES_TABLE).update({ gen }).where({ key, gen: oldGen })) === 1;
|
|
220
|
+
}
|
|
221
|
+
catch (err) {
|
|
222
|
+
// The pointer may still move to `gen` after the error, so its rows are left to the sweep, which waits out the grace period.
|
|
223
|
+
if ((await this.sourceRow(d, key).catch(() => undefined))?.gen === gen)
|
|
224
|
+
return true;
|
|
225
|
+
throw err;
|
|
226
|
+
}
|
|
227
|
+
if (!moved)
|
|
228
|
+
await this.dropGeneration(d, gen, 'Cannot drop an unused email domain list generation; the cleanup will reclaim it');
|
|
229
|
+
return moved;
|
|
230
|
+
}
|
|
231
|
+
/** Best effort: a generation no source points at is reclaimed by the cleanup anyway. */
|
|
232
|
+
async dropGeneration(d, gen, failure) {
|
|
233
|
+
try {
|
|
234
|
+
await d.del().from(tables_js_1.ENTRIES_TABLE).where({ gen });
|
|
235
|
+
}
|
|
236
|
+
catch (err) {
|
|
237
|
+
this.Log.warn(err, failure);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
async insertSource(d, key, gen) {
|
|
241
|
+
try {
|
|
242
|
+
await d.insert().into(tables_js_1.SOURCES_TABLE).values({ key, gen });
|
|
243
|
+
return true;
|
|
244
|
+
}
|
|
245
|
+
catch (err) {
|
|
246
|
+
const row = await this.sourceRow(d, key).catch(() => undefined);
|
|
247
|
+
if (row === undefined)
|
|
248
|
+
throw err;
|
|
249
|
+
// Our insert may have committed even though the client saw an error.
|
|
250
|
+
return row.gen === gen;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
async upsert(table, key, values) {
|
|
254
|
+
await (await this.driver()).insert().into(table).values({ key, ...values }).onDuplicate('key').update(Object.keys(values));
|
|
255
|
+
}
|
|
256
|
+
async sourceRow(d, key) {
|
|
257
|
+
return (await d.select().from(tables_js_1.SOURCES_TABLE).where({ key }))[0];
|
|
258
|
+
}
|
|
259
|
+
async sourceRows(d) {
|
|
260
|
+
return (await d.select().from(tables_js_1.SOURCES_TABLE));
|
|
261
|
+
}
|
|
262
|
+
async domainsOf(d, gen) {
|
|
263
|
+
return (await d.select().from(tables_js_1.ENTRIES_TABLE).where({ gen })).map((r) => r.domain);
|
|
264
|
+
}
|
|
265
|
+
async driver() {
|
|
266
|
+
const orm = await di_1.DI.resolve(orm_1.Orm);
|
|
267
|
+
const driver = orm.Connections.get(this.Options.connection);
|
|
268
|
+
if (!driver) {
|
|
269
|
+
throw new exceptions_1.InvalidOperation(`emailVerification.orm.connection names ${this.Options.connection}, which the ORM does not have (connections: ${[...orm.Connections.keys()].join(', ') || 'none'})`);
|
|
270
|
+
}
|
|
271
|
+
return driver;
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
exports.OrmEmailVerificationStore = OrmEmailVerificationStore;
|
|
275
|
+
__decorate([
|
|
276
|
+
(0, configuration_1.Config)('emailVerification.orm'),
|
|
277
|
+
__metadata("design:type", Object)
|
|
278
|
+
], OrmEmailVerificationStore.prototype, "Options", void 0);
|
|
279
|
+
__decorate([
|
|
280
|
+
(0, log_1.Logger)('email-verification'),
|
|
281
|
+
__metadata("design:type", log_1.Log)
|
|
282
|
+
], OrmEmailVerificationStore.prototype, "Log", void 0);
|
|
283
|
+
exports.OrmEmailVerificationStore = OrmEmailVerificationStore = __decorate([
|
|
284
|
+
(0, di_1.Injectable)(email_verification_1.EmailVerificationStore)
|
|
285
|
+
], OrmEmailVerificationStore);
|
|
286
|
+
function samePointers(a, b) {
|
|
287
|
+
if (a.length !== b.length)
|
|
288
|
+
return false;
|
|
289
|
+
const gens = new Map(a.map((r) => [r.key, r.gen]));
|
|
290
|
+
return b.every((r) => gens.get(r.key) === r.gen);
|
|
291
|
+
}
|
|
292
|
+
function groupBySource(entries) {
|
|
293
|
+
const groups = new Map();
|
|
294
|
+
for (const e of entries) {
|
|
295
|
+
const key = sourceKey(e.kind, e.source);
|
|
296
|
+
groups.set(key, [...(groups.get(key) ?? []), e.domain]);
|
|
297
|
+
}
|
|
298
|
+
return groups;
|
|
299
|
+
}
|
|
300
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/store.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAyC;AACzC,0DAAgD;AAChD,oCAA6C;AAC7C,oEAAqE;AAErE,oDAAuD;AACvD,sCAA2C;AAC3C,sCAAmC;AAEnC,wCAAsC;AAEtC,2CAAuF;AAgBvF,MAAM,YAAY,GAAG,CAAC,CAAC;AACvB,gGAAgG;AAChG,MAAM,YAAY,GAAG,GAAG,CAAC;AACzB,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,6GAA6G;AAC7G,sHAAsH;AACtH,MAAM,wBAAwB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAChD,MAAM,YAAY,GAAG,aAAa,CAAC;AAEnC,MAAM,YAAY,GAAG,CAAC,MAAe,EAAE,EAAE,CAAE,MAAoC,EAAE,YAAY,IAAI,CAAC,CAAC;AACnG,MAAM,SAAS,GAAG,CAAC,IAAc,EAAE,MAAc,EAAE,EAAE,CAAC,GAAG,IAAI,IAAI,M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,GAAG,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;QACxC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const VERDICTS_TABLE = "email_verification_verdicts";
|
|
2
|
+
export declare const SOURCES_TABLE = "email_verification_sources";
|
|
3
|
+
export declare const ENTRIES_TABLE = "email_verification_entries";
|
|
4
|
+
export declare const META_TABLE = "email_verification_meta";
|
|
5
|
+
//# sourceMappingURL=tables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tables.d.ts","sourceRoot":"","sources":["../../src/tables.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,gCAAgC,CAAC;AAC5D,eAAO,MAAM,aAAa,+BAA+B,CAAC;AAC1D,eAAO,MAAM,aAAa,+BAA+B,CAAC;AAC1D,eAAO,MAAM,UAAU,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.META_TABLE = exports.ENTRIES_TABLE = exports.SOURCES_TABLE = exports.VERDICTS_TABLE = void 0;
|
|
4
|
+
exports.VERDICTS_TABLE = 'email_verification_verdicts';
|
|
5
|
+
exports.SOURCES_TABLE = 'email_verification_sources';
|
|
6
|
+
exports.ENTRIES_TABLE = 'email_verification_entries';
|
|
7
|
+
exports.META_TABLE = 'email_verification_meta';
|
|
8
|
+
//# sourceMappingURL=tables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tables.js","sourceRoot":"","sources":["../../src/tables.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG,6BAA6B,CAAC;AAC/C,QAAA,aAAa,GAAG,4BAA4B,CAAC;AAC7C,QAAA,aAAa,GAAG,4BAA4B,CAAC;AAC7C,QAAA,UAAU,GAAG,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/connection.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,kCAAkC,CAAC;AAEtE,wBAAgB,aAAa,IAAI,MAAM,CAGtC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Configuration } from '@spinajs/configuration';
|
|
2
|
+
import { DI } from '@spinajs/di';
|
|
3
|
+
export const DEFAULT_ORM_CONNECTION = 'email-verification-connection';
|
|
4
|
+
export function ormConnection() {
|
|
5
|
+
const cfg = DI.get(Configuration);
|
|
6
|
+
return cfg?.get('emailVerification.orm.connection') ?? DEFAULT_ORM_CONNECTION;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=connection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../src/connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC,MAAM,CAAC,MAAM,sBAAsB,GAAG,+BAA+B,CAAC;AAEtE,MAAM,UAAU,aAAa;IAC3B,MAAM,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,aAAa,CAA8B,CAAC;IAC/D,OAAO,GAAG,EAAE,GAAG,CAAS,kCAAkC,CAAC,IAAI,sBAAsB,CAAC;AACxF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,uDAAuD,CAAC"}
|
package/lib/mjs/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,uDAAuD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OrmMigration } from '@spinajs/orm';
|
|
2
|
+
import type { OrmDriver } from '@spinajs/orm';
|
|
3
|
+
/**
|
|
4
|
+
* Lists are stored as generations: a source row points at its live `gen`, and a write
|
|
5
|
+
* fills a new generation before it moves the pointer (OrmEmailVerificationStore).
|
|
6
|
+
*/
|
|
7
|
+
export declare class EmailVerification_2026_10_21_00_00_00 extends OrmMigration {
|
|
8
|
+
up(connection: OrmDriver): Promise<void>;
|
|
9
|
+
down(connection: OrmDriver): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=EmailVerification_2026_10_21_00_00_00.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmailVerification_2026_10_21_00_00_00.d.ts","sourceRoot":"","sources":["../../../src/migrations/EmailVerification_2026_10_21_00_00_00.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,YAAY,EAA8B,MAAM,cAAc,CAAC;AACnF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAK9C;;;GAGG;AACH,qBACa,qCAAsC,SAAQ,YAAY;IACxD,EAAE,CAAC,UAAU,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CA6BpD;IAEY,IAAI,CAAC,UAAU,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAEtD;CACF"}
|