@verana-labs/vs-agent-sdk 2.0.0-dev.64 → 2.0.0-dev.66
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/build/adminApi/index.d.ts +1 -0
- package/build/adminApi/index.js +1 -0
- package/build/adminApi/index.js.map +1 -1
- package/build/adminApi/pagination/PageDto.d.ts +7 -0
- package/build/adminApi/pagination/PageDto.js +50 -0
- package/build/adminApi/pagination/PageDto.js.map +1 -0
- package/build/adminApi/pagination/PaginationQueryDto.d.ts +11 -0
- package/build/adminApi/pagination/PaginationQueryDto.js +46 -0
- package/build/adminApi/pagination/PaginationQueryDto.js.map +1 -0
- package/build/adminApi/pagination/cursor.d.ts +28 -0
- package/build/adminApi/pagination/cursor.js +64 -0
- package/build/adminApi/pagination/cursor.js.map +1 -0
- package/build/adminApi/pagination/index.d.ts +4 -0
- package/build/adminApi/pagination/index.js +21 -0
- package/build/adminApi/pagination/index.js.map +1 -0
- package/build/adminApi/pagination/paginate.d.ts +27 -0
- package/build/adminApi/pagination/paginate.js +77 -0
- package/build/adminApi/pagination/paginate.js.map +1 -0
- package/build/agent/VsAgent.d.ts +0 -1
- package/build/agent/createVsAgent.d.ts +0 -1
- package/build/agent/createVsAgent.js.map +1 -1
- package/build/plugins/setupBaseDidComm.js +2 -1
- package/build/plugins/setupBaseDidComm.js.map +1 -1
- package/build/types.d.ts +2 -0
- package/build/types.js.map +1 -1
- package/package.json +7 -3
package/build/adminApi/index.js
CHANGED
|
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./AdminApiError"), exports);
|
|
18
18
|
__exportStar(require("./didcommModules"), exports);
|
|
19
19
|
__exportStar(require("./moduleEndpoint"), exports);
|
|
20
|
+
__exportStar(require("./pagination"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/adminApi/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA+B;AAC/B,mDAAgC;AAChC,mDAAgC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/adminApi/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA+B;AAC/B,mDAAgC;AAChC,mDAAgC;AAChC,+CAA4B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Type } from '@nestjs/common';
|
|
2
|
+
import { Page } from './paginate';
|
|
3
|
+
/**
|
|
4
|
+
* Makes the OpenAPI model of a page of `ItemDto`. Swagger reads a schema off a class, so a
|
|
5
|
+
* generic `Page<T>` needs one cached class for each record type.
|
|
6
|
+
*/
|
|
7
|
+
export declare function PageDto<T>(ItemDto: Type<T>): Type<Page<T>>;
|
|
@@ -0,0 +1,50 @@
|
|
|
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.PageDto = PageDto;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const models = new Map();
|
|
15
|
+
const names = new Map();
|
|
16
|
+
/**
|
|
17
|
+
* Makes the OpenAPI model of a page of `ItemDto`. Swagger reads a schema off a class, so a
|
|
18
|
+
* generic `Page<T>` needs one cached class for each record type.
|
|
19
|
+
*/
|
|
20
|
+
function PageDto(ItemDto) {
|
|
21
|
+
const known = models.get(ItemDto);
|
|
22
|
+
if (known)
|
|
23
|
+
return known;
|
|
24
|
+
class GeneratedPageDto {
|
|
25
|
+
}
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, swagger_1.ApiProperty)({ type: [ItemDto], description: 'The records of this page.' }),
|
|
28
|
+
__metadata("design:type", Array)
|
|
29
|
+
], GeneratedPageDto.prototype, "items", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, swagger_1.ApiProperty)({
|
|
32
|
+
type: String,
|
|
33
|
+
nullable: true,
|
|
34
|
+
description: 'Cursor of the next page. The agent sets it to null on the last page.',
|
|
35
|
+
}),
|
|
36
|
+
__metadata("design:type", Object)
|
|
37
|
+
], GeneratedPageDto.prototype, "nextCursor", void 0);
|
|
38
|
+
// Swagger names each schema after its class, and every generated class shares one source name.
|
|
39
|
+
const name = `${ItemDto.name.replace(/Dto$/, '')}PageDto`;
|
|
40
|
+
Object.defineProperty(GeneratedPageDto, 'name', { value: name });
|
|
41
|
+
// Two models of one name would collapse into one schema, and the document would show the
|
|
42
|
+
// wrong records for one of them.
|
|
43
|
+
const taken = names.get(name);
|
|
44
|
+
if (taken)
|
|
45
|
+
throw new Error(`${taken.name} and ${ItemDto.name} both map to the page model "${name}"`);
|
|
46
|
+
names.set(name, ItemDto);
|
|
47
|
+
models.set(ItemDto, GeneratedPageDto);
|
|
48
|
+
return GeneratedPageDto;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=PageDto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageDto.js","sourceRoot":"","sources":["../../../src/adminApi/pagination/PageDto.ts"],"names":[],"mappings":";;;;;;;;;;;AAYA,0BA4BC;AAvCD,6CAA6C;AAI7C,MAAM,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
|
|
3
|
+
export declare const PAGE_LIMIT_MAX = 500;
|
|
4
|
+
/**
|
|
5
|
+
* Pagination parameters of a collection method. A method with filters extends this class, and
|
|
6
|
+
* must put those filters in the page scope.
|
|
7
|
+
*/
|
|
8
|
+
export declare class PaginationQueryDto {
|
|
9
|
+
limit?: number;
|
|
10
|
+
cursor?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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.PaginationQueryDto = exports.PAGE_LIMIT_MAX = exports.PAGE_LIMIT_DEFAULT = exports.PAGE_LIMIT_MIN = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const class_validator_1 = require("class-validator");
|
|
16
|
+
exports.PAGE_LIMIT_MIN = 1;
|
|
17
|
+
exports.PAGE_LIMIT_DEFAULT = 100;
|
|
18
|
+
exports.PAGE_LIMIT_MAX = 500;
|
|
19
|
+
/**
|
|
20
|
+
* Pagination parameters of a collection method. A method with filters extends this class, and
|
|
21
|
+
* must put those filters in the page scope.
|
|
22
|
+
*/
|
|
23
|
+
class PaginationQueryDto {
|
|
24
|
+
}
|
|
25
|
+
exports.PaginationQueryDto = PaginationQueryDto;
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
28
|
+
minimum: exports.PAGE_LIMIT_MIN,
|
|
29
|
+
maximum: exports.PAGE_LIMIT_MAX,
|
|
30
|
+
default: exports.PAGE_LIMIT_DEFAULT,
|
|
31
|
+
description: 'Number of records in one page.',
|
|
32
|
+
}),
|
|
33
|
+
(0, class_validator_1.IsOptional)(),
|
|
34
|
+
(0, class_transformer_1.Type)(() => Number),
|
|
35
|
+
(0, class_validator_1.IsInt)(),
|
|
36
|
+
(0, class_validator_1.Min)(exports.PAGE_LIMIT_MIN),
|
|
37
|
+
(0, class_validator_1.Max)(exports.PAGE_LIMIT_MAX),
|
|
38
|
+
__metadata("design:type", Number)
|
|
39
|
+
], PaginationQueryDto.prototype, "limit", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Opaque cursor returned by the previous call.' }),
|
|
42
|
+
(0, class_validator_1.IsOptional)(),
|
|
43
|
+
(0, class_validator_1.IsString)(),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], PaginationQueryDto.prototype, "cursor", void 0);
|
|
46
|
+
//# sourceMappingURL=PaginationQueryDto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaginationQueryDto.js","sourceRoot":"","sources":["../../../src/adminApi/pagination/PaginationQueryDto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAqD;AACrD,yDAAwC;AACxC,qDAAuE;AAE1D,QAAA,cAAc,GAAG,CAAC,CAAA;AAClB,QAAA,kBAAkB,GAAG,GAAG,CAAA;AACxB,QAAA,cAAc,GAAG,GAAG,CAAA;AAEjC;;;GAGG;AACH,MAAa,kBAAkB;CAkB9B;AAlBD,gDAkBC;AANC;IAXC,IAAA,6BAAmB,EAAC;QACnB,OAAO,EAAE,sBAAc;QACvB,OAAO,EAAE,sBAAc;QACvB,OAAO,EAAE,0BAAkB;QAC3B,WAAW,EAAE,gCAAgC;KAC9C,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAClB,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAG,EAAC,sBAAc,CAAC;IACnB,IAAA,qBAAG,EAAC,sBAAc,CAAC;;iDACN;AAKd;IAHC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,8CAA8C,EAAE,CAAC;IACpF,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;kDACI"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Increase it when the encoded fields change. The agent then refuses each cursor of an
|
|
3
|
+
* earlier format.
|
|
4
|
+
*/
|
|
5
|
+
export declare const CURSOR_FORMAT_VERSION = 1;
|
|
6
|
+
/**
|
|
7
|
+
* The method and filter set that mint a cursor. Put in `filters` what the caller asked for,
|
|
8
|
+
* not what the data store received: only the first one is stable between calls.
|
|
9
|
+
*/
|
|
10
|
+
export interface PageScope {
|
|
11
|
+
method: string;
|
|
12
|
+
filters?: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Fingerprints a page scope. It ignores an absent filter, and the order of the filters, so
|
|
16
|
+
* two calls that ask for the same records agree.
|
|
17
|
+
*/
|
|
18
|
+
export declare function hashScope(scope: PageScope): string;
|
|
19
|
+
/**
|
|
20
|
+
* Encodes the key of the last record of a page. The agent keeps no cursor state: the cursor
|
|
21
|
+
* holds all that the next call needs.
|
|
22
|
+
*/
|
|
23
|
+
export declare function encodeCursor(scopeHash: string, key: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Reads the key out of a cursor. It refuses the cursor in three cases only: the cursor is
|
|
26
|
+
* malformed, an earlier format minted it, or the caller replayed it against another scope.
|
|
27
|
+
*/
|
|
28
|
+
export declare function decodeCursor(cursor: string, scopeHash: string): string;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CURSOR_FORMAT_VERSION = void 0;
|
|
4
|
+
exports.hashScope = hashScope;
|
|
5
|
+
exports.encodeCursor = encodeCursor;
|
|
6
|
+
exports.decodeCursor = decodeCursor;
|
|
7
|
+
const crypto_1 = require("crypto");
|
|
8
|
+
const common_1 = require("@nestjs/common");
|
|
9
|
+
const AdminApiError_1 = require("../AdminApiError");
|
|
10
|
+
/**
|
|
11
|
+
* Increase it when the encoded fields change. The agent then refuses each cursor of an
|
|
12
|
+
* earlier format.
|
|
13
|
+
*/
|
|
14
|
+
exports.CURSOR_FORMAT_VERSION = 1;
|
|
15
|
+
/**
|
|
16
|
+
* Fingerprints a page scope. It ignores an absent filter, and the order of the filters, so
|
|
17
|
+
* two calls that ask for the same records agree.
|
|
18
|
+
*/
|
|
19
|
+
function hashScope(scope) {
|
|
20
|
+
var _a;
|
|
21
|
+
const filters = Object.entries((_a = scope.filters) !== null && _a !== void 0 ? _a : {})
|
|
22
|
+
.filter(([, value]) => value !== undefined)
|
|
23
|
+
.sort(([a], [b]) => a.localeCompare(b));
|
|
24
|
+
return (0, crypto_1.createHash)('sha256')
|
|
25
|
+
.update(JSON.stringify([scope.method, filters]))
|
|
26
|
+
.digest('hex')
|
|
27
|
+
.slice(0, 16);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Encodes the key of the last record of a page. The agent keeps no cursor state: the cursor
|
|
31
|
+
* holds all that the next call needs.
|
|
32
|
+
*/
|
|
33
|
+
function encodeCursor(scopeHash, key) {
|
|
34
|
+
const payload = { v: exports.CURSOR_FORMAT_VERSION, s: scopeHash, k: key };
|
|
35
|
+
return Buffer.from(JSON.stringify(payload)).toString('base64url');
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Reads the key out of a cursor. It refuses the cursor in three cases only: the cursor is
|
|
39
|
+
* malformed, an earlier format minted it, or the caller replayed it against another scope.
|
|
40
|
+
*/
|
|
41
|
+
function decodeCursor(cursor, scopeHash) {
|
|
42
|
+
let parsed;
|
|
43
|
+
try {
|
|
44
|
+
parsed = JSON.parse(Buffer.from(cursor, 'base64url').toString('utf8'));
|
|
45
|
+
}
|
|
46
|
+
catch (_a) {
|
|
47
|
+
throw invalidCursor('the cursor is malformed');
|
|
48
|
+
}
|
|
49
|
+
const { v, s, k } = (parsed !== null && parsed !== void 0 ? parsed : {});
|
|
50
|
+
if (typeof v !== 'number' || typeof s !== 'string' || typeof k !== 'string') {
|
|
51
|
+
throw invalidCursor('the cursor is malformed');
|
|
52
|
+
}
|
|
53
|
+
if (v !== exports.CURSOR_FORMAT_VERSION) {
|
|
54
|
+
throw invalidCursor('the cursor uses a cursor format that this agent no longer accepts');
|
|
55
|
+
}
|
|
56
|
+
if (s !== scopeHash) {
|
|
57
|
+
throw invalidCursor('the cursor was minted by another method or filter set');
|
|
58
|
+
}
|
|
59
|
+
return k;
|
|
60
|
+
}
|
|
61
|
+
function invalidCursor(message) {
|
|
62
|
+
return new AdminApiError_1.AdminApiError(AdminApiError_1.AdminApiErrorCode.InvalidCursor, common_1.HttpStatus.BAD_REQUEST, message);
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=cursor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../src/adminApi/pagination/cursor.ts"],"names":[],"mappings":";;;AA+BA,8BAQC;AAMD,oCAGC;AAMD,oCAoBC;AA1ED,mCAAmC;AAEnC,2CAA2C;AAE3C,oDAAmE;AAEnE;;;GAGG;AACU,QAAA,qBAAqB,GAAG,CAAC,CAAA;AAiBtC;;;GAGG;AACH,SAAgB,SAAS,CAAC,KAAgB;;IACxC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAA,KAAK,CAAC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O,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC5E,MAAM,aAAa,CAAC,yBAAyB,CAAC,CAAA;IAChD,CAAC;IACD,IAAI,CAAC,KAAK,6BAAqB,EAAE,CAAC;QAChC,MAAM,aAAa,CAAC,mEAAmE,CAAC,CAAA;IAC1F,CAAC;IACD,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QACpB,MAAM,aAAa,CAAC,uDAAuD,CAAC,CAAA;IAC9E,CAAC;IAED,OAAO,CAAC,CAAA;AACV,CAAC;AAED,SAAS,aAAa,CAAC,OAAe;IACpC,OAAO,IAAI,6BAAa,CAAC,iCAAiB,CAAC,aAAa,EAAE,mBAAU,CAAC,WAAW,EAAE,OAAO,CAAC,CAAA;AAC5F,CAAC"}
|
|
@@ -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("./cursor"), exports);
|
|
18
|
+
__exportStar(require("./PageDto"), exports);
|
|
19
|
+
__exportStar(require("./paginate"), exports);
|
|
20
|
+
__exportStar(require("./PaginationQueryDto"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adminApi/pagination/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,4CAAyB;AACzB,6CAA0B;AAC1B,uDAAoC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PageScope } from './cursor';
|
|
2
|
+
import { PaginationQueryDto } from './PaginationQueryDto';
|
|
3
|
+
/** One page of a collection. `nextCursor` is null on the last page. */
|
|
4
|
+
export interface Page<T> {
|
|
5
|
+
items: T[];
|
|
6
|
+
nextCursor: string | null;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Cuts a page out of a collection with a keyset cursor. `keyOf` must give a unique key that
|
|
10
|
+
* does not change, for example `createdAtKey`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function paginate<T>(items: readonly T[], query: PaginationQueryDto, scope: PageScope, keyOf: (item: T) => string): Page<T>;
|
|
13
|
+
/**
|
|
14
|
+
* Pagination key of a record that carries a creation timestamp and an id. The timestamp orders
|
|
15
|
+
* the records, and the id keeps the key unique when two records share a timestamp.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createdAtKey(record: {
|
|
18
|
+
createdAt: Date;
|
|
19
|
+
id: string;
|
|
20
|
+
}): string;
|
|
21
|
+
/**
|
|
22
|
+
* Maps the records of one page. Paginate the records first, then map, when a record costs a
|
|
23
|
+
* store read to become a DTO: the method then reads one page instead of the collection.
|
|
24
|
+
*/
|
|
25
|
+
export declare function mapPage<T, U>(page: Page<T>, map: (item: T) => U): Page<U>;
|
|
26
|
+
/** `mapPage` for a mapping that reads the store. */
|
|
27
|
+
export declare function mapPageAsync<T, U>(page: Page<T>, map: (item: T) => Promise<U>): Promise<Page<U>>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.paginate = paginate;
|
|
4
|
+
exports.createdAtKey = createdAtKey;
|
|
5
|
+
exports.mapPage = mapPage;
|
|
6
|
+
exports.mapPageAsync = mapPageAsync;
|
|
7
|
+
const common_1 = require("@nestjs/common");
|
|
8
|
+
const AdminApiError_1 = require("../AdminApiError");
|
|
9
|
+
const cursor_1 = require("./cursor");
|
|
10
|
+
const PaginationQueryDto_1 = require("./PaginationQueryDto");
|
|
11
|
+
/**
|
|
12
|
+
* Cuts a page out of a collection with a keyset cursor. `keyOf` must give a unique key that
|
|
13
|
+
* does not change, for example `createdAtKey`.
|
|
14
|
+
*/
|
|
15
|
+
function paginate(items, query, scope, keyOf) {
|
|
16
|
+
const limit = limitOf(query.limit);
|
|
17
|
+
const scopeHash = (0, cursor_1.hashScope)(scope);
|
|
18
|
+
// Key each record once: a comparison sort calls `keyOf` many times for each record.
|
|
19
|
+
const keyed = items.map(item => ({ key: keyOf(item), item }));
|
|
20
|
+
keyed.sort((a, b) => (a.key < b.key ? -1 : a.key > b.key ? 1 : 0));
|
|
21
|
+
assertUniqueKeys(keyed, scope.method);
|
|
22
|
+
// Scan for the first key after the anchor, so a deleted anchor still starts the page correctly.
|
|
23
|
+
let start = 0;
|
|
24
|
+
if (query.cursor !== undefined) {
|
|
25
|
+
const anchorKey = (0, cursor_1.decodeCursor)(query.cursor, scopeHash);
|
|
26
|
+
const index = keyed.findIndex(entry => entry.key > anchorKey);
|
|
27
|
+
start = index === -1 ? keyed.length : index;
|
|
28
|
+
}
|
|
29
|
+
const page = keyed.slice(start, start + limit);
|
|
30
|
+
const hasMore = start + limit < keyed.length;
|
|
31
|
+
return {
|
|
32
|
+
items: page.map(entry => entry.item),
|
|
33
|
+
nextCursor: hasMore && page.length > 0 ? (0, cursor_1.encodeCursor)(scopeHash, page[page.length - 1].key) : null,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Pagination key of a record that carries a creation timestamp and an id. The timestamp orders
|
|
38
|
+
* the records, and the id keeps the key unique when two records share a timestamp.
|
|
39
|
+
*/
|
|
40
|
+
function createdAtKey(record) {
|
|
41
|
+
return `${record.createdAt.toISOString()}|${record.id}`;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Maps the records of one page. Paginate the records first, then map, when a record costs a
|
|
45
|
+
* store read to become a DTO: the method then reads one page instead of the collection.
|
|
46
|
+
*/
|
|
47
|
+
function mapPage(page, map) {
|
|
48
|
+
return { items: page.items.map(map), nextCursor: page.nextCursor };
|
|
49
|
+
}
|
|
50
|
+
/** `mapPage` for a mapping that reads the store. */
|
|
51
|
+
async function mapPageAsync(page, map) {
|
|
52
|
+
return { items: await Promise.all(page.items.map(map)), nextCursor: page.nextCursor };
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Refuses a repeated key. The anchor scan would step over each record after the first one that
|
|
56
|
+
* holds the key, and the method would drop those records without an error.
|
|
57
|
+
*/
|
|
58
|
+
function assertUniqueKeys(keyed, method) {
|
|
59
|
+
for (let index = 1; index < keyed.length; index++) {
|
|
60
|
+
if (keyed[index].key !== keyed[index - 1].key)
|
|
61
|
+
continue;
|
|
62
|
+
throw new AdminApiError_1.AdminApiError(AdminApiError_1.AdminApiErrorCode.Internal, common_1.HttpStatus.INTERNAL_SERVER_ERROR, `${method} gave two records the pagination key "${keyed[index].key}"`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Clamps the limit. The value is `unknown` because Nest hands the handler the raw query string,
|
|
67
|
+
* and because an internal caller can pass a raw object that no DTO validated.
|
|
68
|
+
*/
|
|
69
|
+
function limitOf(limit) {
|
|
70
|
+
if (limit === undefined)
|
|
71
|
+
return PaginationQueryDto_1.PAGE_LIMIT_DEFAULT;
|
|
72
|
+
const value = Number(limit);
|
|
73
|
+
if (!Number.isFinite(value))
|
|
74
|
+
return PaginationQueryDto_1.PAGE_LIMIT_DEFAULT;
|
|
75
|
+
return Math.min(Math.max(Math.trunc(value), PaginationQueryDto_1.PAGE_LIMIT_MIN), PaginationQueryDto_1.PAGE_LIMIT_MAX);
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=paginate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paginate.js","sourceRoot":"","sources":["../../../src/adminApi/pagination/paginate.ts"],"names":[],"mappings":";;AAiBA,4BA8BC;AAMD,oCAEC;AAMD,0BAEC;AAGD,oCAEC;AApED,2CAA2C;AAE3C,oDAAmE;AAEnE,qCAA2E;AAC3E,6DAA6G;AAQ7G;;;GAGG;AACH,SAAgB,QAAQ,CACtB,KAAmB,EACnB,KAAyB,EACzB,KAAgB,EAChB,KAA0B;IAE1B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IAClC,MAAM,SAAS,GAAG,IAAA,kBAAS,EAAC,KAAK,CAAC,CAAA;IAElC,oFAAoF;IACpF,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAC7D,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAElE,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAErC,gGAAgG;IAChG,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,E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F,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAA;AACvF,CAAC;AAED;;;GAGG;AACH,SAAS,gBAAgB,CAAC,KAAiC,EAAE,MAAc;IACzE,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;QAClD,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG;YAAE,SAAQ;QAEvD,MAAM,IAAI,6BAAa,CACrB,iCAAiB,CAAC,QAAQ,EAC1B,mBAAU,CAAC,qBAAqB,EAChC,GAAG,MAAM,yCAAyC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CACtE,CAAA;IACH,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,OAAO,CAAC,KAAc;IAC7B,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,uCAAkB,CAAA;IAElD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;IAC3B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,uCAAkB,CAAA;IAEtD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,mCAAc,CAAC,EAAE,mCAAc,CAAC,CAAA;AAC9E,CAAC"}
|
package/build/agent/VsAgent.d.ts
CHANGED
|
@@ -19,7 +19,6 @@ export interface CreateVsAgentOptions<T extends Plugin[]> {
|
|
|
19
19
|
did?: string;
|
|
20
20
|
publicApiBaseUrl: string;
|
|
21
21
|
adminApiServiceEndpoint?: string;
|
|
22
|
-
masterListCscaLocation?: string;
|
|
23
22
|
autoUpdateStorageOnStartup?: boolean;
|
|
24
23
|
dependencies: AgentDependencies;
|
|
25
24
|
logLevel?: LogLevel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createVsAgent.js","sourceRoot":"","sources":["../../src/agent/createVsAgent.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"createVsAgent.js","sourceRoot":"","sources":["../../src/agent/createVsAgent.ts"],"names":[],"mappings":";;AAiEA,sCAyBC;AAhFD,uCAAqD;AAgCrD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAgB,aAAa,CAC3B,OAAgC;IAEhC,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAC1C,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,iCAAM,GAAG,GAAK,MAAM,CAAC,OAAO,EAAG,EAChD,EAA6B,CACV,CAAA;IAErB,OAAO,IAAI,iBAAO,CAAmB;QACnC,MAAM,kCACD,OAAO,CAAC,MAAM,KACjB,0BAA0B,EAAE,OAAO,CAAC,0BAA0B,GAC/D;QACD,OAAO,EAAE,aAAa;QACtB,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;QAC1C,uBAAuB,EAAE,OAAO,CAAC,uBAAuB;QACxD,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;QAClD,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;QAClD,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;KAC3C,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -75,7 +75,8 @@ function setupBaseDidComm(options) {
|
|
|
75
75
|
],
|
|
76
76
|
}),
|
|
77
77
|
dids: new core_1.DidsModule({
|
|
78
|
-
|
|
78
|
+
// Credo appends only PeerDidResolver and KeyDidResolver to a supplied list, so did:jwk needs one.
|
|
79
|
+
resolvers: [new CachedWebDidResolver_1.CachedWebDidResolver(), new webvh_1.WebVhDidResolver(), new core_1.JwkDidResolver()],
|
|
79
80
|
registrars: [new WebDidRegistrar_1.WebDidRegistrar(), new webvh_1.WebVhDidRegistrar()],
|
|
80
81
|
}),
|
|
81
82
|
w3cCredentials: new core_1.W3cCredentialsModule({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupBaseDidComm.js","sourceRoot":"","sources":["../../src/plugins/setupBaseDidComm.ts"],"names":[],"mappings":";;AAgDA,
|
|
1
|
+
{"version":3,"file":"setupBaseDidComm.js","sourceRoot":"","sources":["../../src/plugins/setupBaseDidComm.ts"],"names":[],"mappings":";;AAgDA,4CAgEC;AA9GD,mDAI4B;AAC5B,2CAA4E;AAC5E,yCAAiF;AACjF,+CAQ0B;AAC1B,2CAA6F;AAC7F,oEAAyD;AACzD,sEAA2D;AAC3D,oFAAoG;AACpG,yEAAmE;AAGnE,kFAA8E;AAC9E,8EAA0E;AAC1E,sEAAmE;AACnE,sEAAkE;AAClE,4DAAwD;AACxD,yFAAqF;AAcrF;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,OAAiC;;IAChE,MAAM,eAAe,GAAG,MAAA,OAAO,CAAC,eAAe,mCAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAC/D,OAAO;QACL,OAAO,EAAE;YACP,OAAO,EAAE,IAAI,uBAAa,CAAC;gBACzB,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,eAAe;gBACf,2FAA2F;gBAC3F,aAAa,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE;gBAC7C,UAAU,EAAE;oBACV,QAAQ,EAAE,CAAC,IAAI,sCAA4B,EAAE,EAAE,IAAI,uDAA0B,EAAE,CAAC;iBACjF;gBACD,WAAW,EAAE;oBACX,qBAAqB,EAAE,IAAI;oBAC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,EAAE,IAAI,2BAAoB,CAAC;gBACvC,cAAc,EAAE,4CAAqB;aACtC,CAAC;YACF,MAAM,EAAE,IAAI,uCAAY,mBAAM,OAAO,CAAC,MAAM,EAAG;SAChD;KACF,CAAA;AACH,CAAC"}
|
package/build/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BaseAgentModules, VsAgent } from './agent/VsAgent';
|
|
2
2
|
import type { IBaseMessage, MessageType } from '@verana-labs/vs-agent-model';
|
|
3
|
+
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
3
4
|
import { BaseLogger } from '@credo-ts/core';
|
|
4
5
|
import { DidCommConnectionRecord } from '@credo-ts/didcomm';
|
|
5
6
|
export declare const MESSAGE_HANDLERS = "MESSAGE_HANDLERS";
|
|
@@ -22,6 +23,7 @@ export interface DidcommModule {
|
|
|
22
23
|
export interface VsAgentNestPlugin {
|
|
23
24
|
name: string;
|
|
24
25
|
credoPlugin?: Plugin;
|
|
26
|
+
publicMiddleware?: (request: IncomingMessage, response: ServerResponse, next: (error?: unknown) => void) => void;
|
|
25
27
|
controllers?: (new (...args: any[]) => any)[];
|
|
26
28
|
providers?: any[];
|
|
27
29
|
messageHandlers?: (new (...args: any[]) => MessageHandler)[];
|
package/build/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAOa,QAAA,gBAAgB,GAAG,kBAAkB,CAAA;AAoCrC,QAAA,uBAAuB,GAAG,CAAC,CAAA;AAC3B,QAAA,yBAAyB,GAAG,CAAC,CAAA;AAC7B,QAAA,+BAA+B,GAAG,CAAC,CAAA;AACnC,QAAA,iCAAiC,GAAG,CAAC,CAAA;AACrC,QAAA,uBAAuB,GAAG,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"default": "./build/index.js"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
|
-
"version": "2.0.0-dev.
|
|
12
|
+
"version": "2.0.0-dev.66",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
15
|
"url": "https://github.com/verana-labs/vs-agent"
|
|
@@ -35,18 +35,22 @@
|
|
|
35
35
|
"@credo-ts/didcomm": "0.7.1-pr-2704-20260909134930",
|
|
36
36
|
"@credo-ts/webvh": "0.7.1-pr-2704-20260909134930",
|
|
37
37
|
"@hyperledger/anoncreds-nodejs": "^0.4.0",
|
|
38
|
+
"@nestjs/common": "^10.0.0",
|
|
39
|
+
"@nestjs/swagger": "^8.0.7",
|
|
38
40
|
"@openwallet-foundation/askar-nodejs": "^0.6.0",
|
|
39
41
|
"@verana-labs/verana-types": "0.10.2",
|
|
40
42
|
"@verana-labs/verre": "0.4.2-dev.1",
|
|
41
43
|
"ajv": "^8.17.1",
|
|
42
44
|
"ajv-formats": "^3.0.1",
|
|
43
45
|
"axios": "^1.7.9",
|
|
46
|
+
"class-transformer": "0.5.1",
|
|
47
|
+
"class-validator": "0.14.1",
|
|
44
48
|
"credo-ts-didweb-anoncreds": "0.0.2-alpha.5",
|
|
45
49
|
"didwebvh-ts": "^2.8.0",
|
|
46
50
|
"express": "^4.18.1",
|
|
47
51
|
"tsyringe": "4.8.0",
|
|
48
|
-
"@verana-labs/
|
|
49
|
-
"@verana-labs/
|
|
52
|
+
"@verana-labs/credo-ts-didcomm-vt-flow": "2.0.0-dev.66",
|
|
53
|
+
"@verana-labs/vs-agent-model": "2.0.0-dev.66"
|
|
50
54
|
},
|
|
51
55
|
"peerDependencies": {
|
|
52
56
|
"@credo-ts/core": "0.7.1-pr-2704-20260909134930",
|