@odatano/core 1.11.0 → 2.0.0-rc.10
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/@cds-models/CardanoAgentService/index.d.ts +255 -0
- package/@cds-models/CardanoAgentService/index.js +36 -0
- package/@cds-models/CardanoIndexerService/index.d.ts +177 -0
- package/@cds-models/CardanoIndexerService/index.js +27 -0
- package/@cds-models/CardanoODataService/index.d.ts +693 -2172
- package/@cds-models/CardanoODataService/index.js +88 -390
- package/@cds-models/CardanoSignService/index.d.ts +448 -1576
- package/@cds-models/CardanoSignService/index.js +62 -293
- package/@cds-models/CardanoTransactionService/index.d.ts +437 -1494
- package/@cds-models/CardanoTransactionService/index.js +60 -271
- package/@cds-models/CardanoWorkerService/index.d.ts +224 -0
- package/@cds-models/CardanoWorkerService/index.js +32 -0
- package/@cds-models/_/index.d.ts +70 -40
- package/@cds-models/_/index.js +17 -32
- package/@cds-models/cds/outbox/index.d.ts +28 -0
- package/@cds-models/index.d.ts +225 -522
- package/@cds-models/index.js +35 -218
- package/@cds-models/odatano/cardano/index.d.ts +919 -2884
- package/@cds-models/odatano/cardano/index.js +115 -536
- package/@cds-models/sap/common/index.d.ts +196 -600
- package/@cds-models/sap/common/index.js +28 -269
- package/README.md +194 -102
- package/db/schema.cds +388 -1
- package/db/types.cds +48 -0
- package/package.json +48 -33
- package/src/index.d.ts +7 -1
- package/src/index.js +30 -2
- package/src/plugin.js +33 -20
- package/srv/blockchain/backends/blockfrost-backend.d.ts +21 -2
- package/srv/blockchain/backends/blockfrost-backend.js +69 -25
- package/srv/blockchain/backends/cardano-backend.d.ts +69 -0
- package/srv/blockchain/backends/cardano-backend.js +13 -0
- package/srv/blockchain/backends/koios-backend.d.ts +26 -2
- package/srv/blockchain/backends/koios-backend.js +148 -25
- package/srv/blockchain/backends/ogmios-backend.d.ts +60 -9
- package/srv/blockchain/backends/ogmios-backend.js +326 -10
- package/srv/blockchain/cardano-client.d.ts +19 -0
- package/srv/blockchain/cardano-client.js +36 -0
- package/srv/blockchain/cardano-indexer.d.ts +50 -1
- package/srv/blockchain/cardano-indexer.js +193 -0
- package/srv/blockchain/crawler/crawler.d.ts +176 -0
- package/srv/blockchain/crawler/crawler.js +744 -0
- package/srv/blockchain/crawler/hooks.d.ts +43 -0
- package/srv/blockchain/crawler/hooks.js +62 -0
- package/srv/blockchain/crawler/index.d.ts +35 -0
- package/srv/blockchain/crawler/index.js +168 -0
- package/srv/blockchain/crawler/sync-state.d.ts +106 -0
- package/srv/blockchain/crawler/sync-state.js +287 -0
- package/srv/blockchain/signing/hsm-signer.d.ts +45 -0
- package/srv/blockchain/signing/hsm-signer.js +8 -1
- package/srv/blockchain/transaction-building/buildooor-tx.d.ts +20 -0
- package/srv/blockchain/transaction-building/buildooor-tx.js +104 -20
- package/srv/blockchain/wallet-worker/build-request.d.ts +26 -0
- package/srv/blockchain/wallet-worker/build-request.js +370 -0
- package/srv/blockchain/wallet-worker/confirmation-tracker.d.ts +117 -0
- package/srv/blockchain/wallet-worker/confirmation-tracker.js +290 -0
- package/srv/blockchain/wallet-worker/index.d.ts +14 -0
- package/srv/blockchain/wallet-worker/index.js +80 -0
- package/srv/blockchain/wallet-worker/job-store.d.ts +272 -0
- package/srv/blockchain/wallet-worker/job-store.js +597 -0
- package/srv/blockchain/wallet-worker/lease-heartbeat.d.ts +43 -0
- package/srv/blockchain/wallet-worker/lease-heartbeat.js +99 -0
- package/srv/blockchain/wallet-worker/signers.d.ts +57 -0
- package/srv/blockchain/wallet-worker/signers.js +131 -0
- package/srv/blockchain/wallet-worker/wallet-worker.d.ts +145 -0
- package/srv/blockchain/wallet-worker/wallet-worker.js +542 -0
- package/srv/cardano-agent-service.cds +150 -0
- package/srv/cardano-agent-service.d.ts +2 -0
- package/srv/cardano-agent-service.js +16 -0
- package/srv/cardano-indexer-service.cds +106 -0
- package/srv/cardano-indexer-service.d.ts +2 -0
- package/srv/cardano-indexer-service.js +79 -0
- package/srv/cardano-service.js +79 -4
- package/srv/cardano-sign-service.cds +200 -180
- package/srv/cardano-tx-service.cds +32 -26
- package/srv/cardano-tx-service.d.ts +1 -11
- package/srv/cardano-tx-service.js +107 -200
- package/srv/cardano-worker-service.cds +125 -0
- package/srv/cardano-worker-service.d.ts +2 -0
- package/srv/cardano-worker-service.js +199 -0
- package/srv/server.d.ts +34 -2
- package/srv/server.js +246 -36
- package/srv/utils/agent-grants-config.d.ts +65 -0
- package/srv/utils/agent-grants-config.js +148 -0
- package/srv/utils/agent-grants.d.ts +314 -0
- package/srv/utils/agent-grants.js +821 -0
- package/srv/utils/agent-token-auth.d.ts +19 -0
- package/srv/utils/agent-token-auth.js +81 -0
- package/srv/utils/collections.d.ts +13 -0
- package/srv/utils/collections.js +24 -0
- package/srv/utils/crypto.d.ts +16 -0
- package/srv/utils/crypto.js +75 -0
- package/srv/utils/db-sanitize.d.ts +40 -0
- package/srv/utils/db-sanitize.js +98 -0
- package/srv/utils/error-codes.d.ts +6 -0
- package/srv/utils/error-codes.js +6 -0
- package/srv/utils/errors.d.ts +12 -0
- package/srv/utils/errors.js +45 -0
- package/srv/utils/liveness.d.ts +23 -0
- package/srv/utils/liveness.js +49 -0
- package/srv/utils/mappers.d.ts +27 -0
- package/srv/utils/mappers.js +80 -10
- package/srv/utils/rate-limiter.d.ts +57 -0
- package/srv/utils/rate-limiter.js +126 -0
- package/srv/utils/service-events.d.ts +26 -0
- package/srv/utils/service-events.js +46 -0
- package/srv/utils/tx-request-parsers.d.ts +71 -0
- package/srv/utils/tx-request-parsers.js +202 -0
- package/srv/utils/tx-utils.d.ts +2 -1
- package/srv/utils/tx-utils.js +3 -2
- package/srv/utils/types.d.ts +17 -1
- package/@cds-models/CardanoODataService/index.d.ts.map +0 -1
- package/@cds-models/CardanoODataService/index.js.map +0 -1
- package/@cds-models/CardanoODataService/index.ts +0 -776
- package/@cds-models/CardanoSignService/index.d.ts.map +0 -1
- package/@cds-models/CardanoSignService/index.js.map +0 -1
- package/@cds-models/CardanoSignService/index.ts +0 -569
- package/@cds-models/CardanoTransactionService/index.d.ts.map +0 -1
- package/@cds-models/CardanoTransactionService/index.js.map +0 -1
- package/@cds-models/CardanoTransactionService/index.ts +0 -526
- package/@cds-models/_/index.d.ts.map +0 -1
- package/@cds-models/_/index.js.map +0 -1
- package/@cds-models/_/index.ts +0 -96
- package/@cds-models/cds/outbox/index.ts +0 -27
- package/@cds-models/index.d.ts.map +0 -1
- package/@cds-models/index.js.map +0 -1
- package/@cds-models/index.ts +0 -245
- package/@cds-models/odatano/cardano/index.d.ts.map +0 -1
- package/@cds-models/odatano/cardano/index.js.map +0 -1
- package/@cds-models/odatano/cardano/index.ts +0 -789
- package/@cds-models/sap/common/index.d.ts.map +0 -1
- package/@cds-models/sap/common/index.js.map +0 -1
- package/@cds-models/sap/common/index.ts +0 -249
package/@cds-models/_/index.d.ts
CHANGED
|
@@ -1,47 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
// This is an automatically generated file. Please do not change its contents manually!
|
|
2
|
+
import cds from '@sap/cds'
|
|
3
|
+
import { type } from '@sap/cds'
|
|
4
|
+
|
|
5
|
+
export type ElementsOf<T> = {[name in keyof Required<T>]: type }
|
|
6
|
+
|
|
7
|
+
export namespace Association {
|
|
8
|
+
export type to <T> = T;
|
|
9
|
+
export namespace to {
|
|
10
|
+
export type many <T extends readonly any[]> = T;
|
|
9
11
|
}
|
|
10
12
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
|
|
14
|
+
export namespace Composition {
|
|
15
|
+
export type of <T> = T;
|
|
16
|
+
export namespace of {
|
|
17
|
+
export type many <T extends readonly any[]> = T;
|
|
15
18
|
}
|
|
16
19
|
}
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
|
|
21
|
+
export class Entity {
|
|
22
|
+
static data<T extends Entity> (this:T, _input:Object) : T {
|
|
23
|
+
return {} as T // mock
|
|
24
|
+
}
|
|
19
25
|
}
|
|
26
|
+
|
|
20
27
|
export type EntitySet<T> = T[] & {
|
|
21
|
-
data(input:
|
|
22
|
-
data(input:
|
|
28
|
+
data (input:object[]) : T[]
|
|
29
|
+
data (input:object) : T
|
|
23
30
|
};
|
|
31
|
+
|
|
24
32
|
export type DraftEntity<T> = T & {
|
|
25
|
-
IsActiveEntity?: boolean | null
|
|
26
|
-
HasActiveEntity?: boolean | null
|
|
27
|
-
HasDraftEntity?: boolean | null
|
|
28
|
-
DraftAdministrativeData_DraftUUID?: string | null
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
export type DeepRequired<T> = {
|
|
35
|
-
[K in keyof T]: DeepRequired<Unkey<T[K]
|
|
33
|
+
IsActiveEntity?: boolean | null
|
|
34
|
+
HasActiveEntity?: boolean | null
|
|
35
|
+
HasDraftEntity?: boolean | null
|
|
36
|
+
DraftAdministrativeData_DraftUUID?: string | null
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type DraftOf<T> = { new(...args: any[]): DraftEntity<T> }
|
|
40
|
+
export type DraftsOf<T> = typeof Array<DraftEntity<T>>
|
|
41
|
+
|
|
42
|
+
export type DeepRequired<T> = {
|
|
43
|
+
[K in keyof T]: DeepRequired<Unkey<T[K]>>
|
|
36
44
|
} & Exclude<Required<T>, null>;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
|
|
46
|
+
const key = Symbol('key') // to avoid .key showing up in IDE's auto-completion
|
|
47
|
+
export type Key<T> = T & {[key]?: true}
|
|
48
|
+
|
|
41
49
|
export type KeysOf<T> = {
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
50
|
+
[K in keyof T as NonNullable<T[K]> extends Key<unknown> ? K : never]-?: Key<{}> // T[K]
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export type Unkey<T> = T extends Key<infer U> ? U : T
|
|
54
|
+
|
|
45
55
|
/**
|
|
46
56
|
* Dates and timestamps are strings during runtime, so cds-typer represents them as such.
|
|
47
57
|
*/
|
|
@@ -58,9 +68,29 @@ export type CdsTime = `${number}${number}:${number}${number}:${number}${number}`
|
|
|
58
68
|
* @see {@link CdsDate}
|
|
59
69
|
*/
|
|
60
70
|
export type CdsTimestamp = string;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
export {}
|
|
66
|
-
|
|
71
|
+
|
|
72
|
+
export type CdsMap = { [key: string]: unknown };
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
export const createEntityProxy = function (fqParts: any, opts = {}) {
|
|
76
|
+
const { target, customProps } = { target: {}, customProps: [] as any[], ...opts }
|
|
77
|
+
const fq = fqParts.filter((p: any) => !!p).join('.')
|
|
78
|
+
return new Proxy(target, {
|
|
79
|
+
get: function (target:any, prop:any) {
|
|
80
|
+
if (cds.entities) {
|
|
81
|
+
target.__proto__ = cds.entities(fqParts[0])[fqParts[1]]
|
|
82
|
+
// overwrite/simplify getter after cds.entities is accessible
|
|
83
|
+
this.get = (target, prop) => target[prop]
|
|
84
|
+
return target[prop]
|
|
85
|
+
}
|
|
86
|
+
// we already know the name so we skip the cds.entities proxy access
|
|
87
|
+
if (prop === 'name') return fq
|
|
88
|
+
// custom properties access on 'target' as well as cached _entity property access goes here
|
|
89
|
+
if (Object.hasOwn(target, prop)) return target[prop]
|
|
90
|
+
// inline enums have to be caught here for first time access, as they do not exist on the entity
|
|
91
|
+
if (customProps.includes(prop as never)) return target[prop]
|
|
92
|
+
// last but not least we pass the property access to cds.entities
|
|
93
|
+
throw new Error(`Property ${prop} does not exist on entity '${fq}' or cds.entities is not yet defined. Ensure the CDS runtime is fully booted before accessing properties.`)
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
}
|
package/@cds-models/_/index.js
CHANGED
|
@@ -1,42 +1,27 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createEntityProxy = exports.Entity = void 0;
|
|
7
1
|
// This is an automatically generated file. Please do not change its contents manually!
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.Entity = Entity;
|
|
15
|
-
const key = Symbol('key'); // to avoid .key showing up in IDE's auto-completion
|
|
16
|
-
const createEntityProxy = function (fqParts, opts = {}) {
|
|
17
|
-
const { target, customProps } = { target: {}, customProps: [], ...opts };
|
|
18
|
-
const fq = fqParts.filter((p) => !!p).join('.');
|
|
2
|
+
const cds = require('@sap/cds')
|
|
3
|
+
module.exports.createEntityProxy = function (fqParts, opts = {}) {
|
|
4
|
+
const { target, customProps } = { target: {}, customProps: [], ...opts }
|
|
5
|
+
const fq = fqParts.filter(p => !!p).join('.')
|
|
19
6
|
return new Proxy(target, {
|
|
20
7
|
get: function (target, prop) {
|
|
21
|
-
if (
|
|
22
|
-
target.__proto__ =
|
|
8
|
+
if (cds.entities) {
|
|
9
|
+
target.__proto__ = cds.entities(fqParts[0])[fqParts[1]]
|
|
23
10
|
// overwrite/simplify getter after cds.entities is accessible
|
|
24
|
-
this.get = (target, prop) => target[prop]
|
|
25
|
-
return target[prop]
|
|
11
|
+
this.get = (target, prop) => target[prop]
|
|
12
|
+
return target[prop]
|
|
26
13
|
}
|
|
27
14
|
// we already know the name so we skip the cds.entities proxy access
|
|
28
|
-
if (prop === 'name')
|
|
29
|
-
return fq;
|
|
15
|
+
if (prop === 'name') return fq
|
|
30
16
|
// custom properties access on 'target' as well as cached _entity property access goes here
|
|
31
|
-
if (Object.hasOwn(target, prop))
|
|
32
|
-
return target[prop];
|
|
17
|
+
if (Object.hasOwn(target, prop)) return target[prop]
|
|
33
18
|
// inline enums have to be caught here for first time access, as they do not exist on the entity
|
|
34
|
-
if (customProps.includes(prop))
|
|
35
|
-
return target[prop];
|
|
19
|
+
if (customProps.includes(prop)) return target[prop]
|
|
36
20
|
// last but not least we pass the property access to cds.entities
|
|
37
|
-
throw new Error(`Property ${prop} does not exist on entity '${fq}' or cds.entities is not yet defined. Ensure the CDS runtime is fully booted before accessing properties.`)
|
|
21
|
+
throw new Error(`Property ${prop} does not exist on entity '${fq}' or cds.entities is not yet defined. Ensure the CDS runtime is fully booted before accessing properties.`)
|
|
38
22
|
}
|
|
39
|
-
})
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
// events
|
|
26
|
+
// actions
|
|
27
|
+
// enums
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// This is an automatically generated file. Please do not change its contents manually!
|
|
2
|
+
import * as __ from './../../_';
|
|
3
|
+
|
|
4
|
+
// entity 'Message'
|
|
5
|
+
export declare function _MessageAspect<TBase extends new (...args: any[]) => object>(Base: TBase): {
|
|
6
|
+
new (...args: any[]): {
|
|
7
|
+
ID?: __.Key<string>
|
|
8
|
+
timestamp?: __.CdsTimestamp | null
|
|
9
|
+
target?: string | null
|
|
10
|
+
msg?: string | null
|
|
11
|
+
attempts?: number | null
|
|
12
|
+
partition?: number | null
|
|
13
|
+
lastError?: string | null
|
|
14
|
+
lastAttemptTimestamp?: __.CdsTimestamp | null
|
|
15
|
+
status?: string | null
|
|
16
|
+
task?: string | null
|
|
17
|
+
appid?: string | null
|
|
18
|
+
} & InstanceType<TBase>
|
|
19
|
+
readonly kind: 'entity';
|
|
20
|
+
readonly keys: __.KeysOf<Message>;
|
|
21
|
+
readonly elements: __.ElementsOf<Message>;
|
|
22
|
+
readonly actions: globalThis.Record<never, never>;
|
|
23
|
+
};
|
|
24
|
+
export class Message extends _MessageAspect(__.Entity) {
|
|
25
|
+
}
|
|
26
|
+
export class Messages extends Array<Message> {
|
|
27
|
+
$count?: number
|
|
28
|
+
}
|