@odatano/core 2.0.0-rc.2 → 2.0.0-rc.20
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 +251 -0
- package/@cds-models/CardanoAgentService/index.js +36 -0
- package/@cds-models/CardanoIndexerService/index.d.ts +139 -2
- package/@cds-models/CardanoIndexerService/index.js +18 -0
- package/@cds-models/CardanoODataService/index.d.ts +224 -0
- package/@cds-models/CardanoODataService/index.js +27 -0
- package/@cds-models/CardanoSignService/index.d.ts +5 -2
- package/@cds-models/CardanoTransactionService/index.d.ts +9 -9
- package/@cds-models/odatano/cardano/index.d.ts +316 -0
- package/@cds-models/odatano/cardano/index.js +33 -0
- package/README.md +195 -136
- package/db/schema.cds +2121 -1633
- package/package.json +179 -173
- package/src/index.d.ts +10 -10
- package/src/index.js +24 -14
- package/src/plugin.js +39 -52
- package/srv/blockchain/backends/blockfrost-backend.d.ts +29 -131
- package/srv/blockchain/backends/blockfrost-backend.js +45 -158
- package/srv/blockchain/backends/cardano-backend.d.ts +78 -158
- package/srv/blockchain/backends/cardano-backend.js +14 -5
- package/srv/blockchain/backends/koios-backend.d.ts +126 -60
- package/srv/blockchain/backends/koios-backend.js +292 -202
- package/srv/blockchain/backends/ogmios-backend.d.ts +59 -96
- package/srv/blockchain/backends/ogmios-backend.js +241 -153
- package/srv/blockchain/backends/ogmios-frame-guard.d.ts +32 -0
- package/srv/blockchain/backends/ogmios-frame-guard.js +142 -0
- package/srv/blockchain/cardano-client.d.ts +50 -205
- package/srv/blockchain/cardano-client.js +80 -224
- package/srv/blockchain/cardano-indexer.d.ts +146 -244
- package/srv/blockchain/cardano-indexer.js +442 -285
- package/srv/blockchain/cardano-tx-builder.d.ts +19 -84
- package/srv/blockchain/cardano-tx-builder.js +21 -107
- package/srv/blockchain/crawler/certificate-backfill.d.ts +45 -0
- package/srv/blockchain/crawler/certificate-backfill.js +150 -0
- package/srv/blockchain/crawler/crawler.d.ts +121 -53
- package/srv/blockchain/crawler/crawler.js +402 -82
- package/srv/blockchain/crawler/hooks.d.ts +3 -14
- package/srv/blockchain/crawler/index.d.ts +5 -0
- package/srv/blockchain/crawler/index.js +35 -7
- package/srv/blockchain/crawler/sync-state.d.ts +44 -28
- package/srv/blockchain/crawler/sync-state.js +115 -43
- package/srv/blockchain/crawler/utxo-set-import.d.ts +69 -0
- package/srv/blockchain/crawler/utxo-set-import.js +269 -0
- package/srv/blockchain/ledger-state.d.ts +80 -0
- package/srv/blockchain/ledger-state.js +383 -0
- package/srv/blockchain/signing/cose-verifier.d.ts +5 -12
- package/srv/blockchain/signing/cose-verifier.js +6 -12
- package/srv/blockchain/signing/external-signer.d.ts +16 -113
- package/srv/blockchain/signing/external-signer.js +19 -122
- package/srv/blockchain/signing/hsm-signer.d.ts +13 -45
- package/srv/blockchain/signing/hsm-signer.js +23 -63
- package/srv/blockchain/signing/signature-verifier.d.ts +8 -44
- package/srv/blockchain/signing/signature-verifier.js +13 -54
- package/srv/blockchain/signing/submission-finalizer.d.ts +9 -36
- package/srv/blockchain/signing/submission-finalizer.js +16 -48
- package/srv/blockchain/transaction-building/buildooor-tx.d.ts +71 -160
- package/srv/blockchain/transaction-building/buildooor-tx.js +185 -260
- package/srv/blockchain/transaction-building/cardano-tx.d.ts +8 -34
- package/srv/blockchain/wallet-worker/build-request.d.ts +4 -17
- package/srv/blockchain/wallet-worker/build-request.js +39 -23
- package/srv/blockchain/wallet-worker/confirmation-tracker.d.ts +25 -17
- package/srv/blockchain/wallet-worker/confirmation-tracker.js +87 -41
- package/srv/blockchain/wallet-worker/index.js +2 -8
- package/srv/blockchain/wallet-worker/job-store.d.ts +36 -103
- package/srv/blockchain/wallet-worker/job-store.js +0 -0
- package/srv/blockchain/wallet-worker/lease-heartbeat.d.ts +4 -20
- package/srv/blockchain/wallet-worker/lease-heartbeat.js +4 -20
- package/srv/blockchain/wallet-worker/signers.d.ts +6 -19
- package/srv/blockchain/wallet-worker/signers.js +3 -8
- package/srv/blockchain/wallet-worker/wallet-worker.d.ts +15 -71
- package/srv/blockchain/wallet-worker/wallet-worker.js +34 -90
- package/srv/cardano-agent-service.cds +146 -0
- package/srv/cardano-agent-service.d.ts +2 -0
- package/srv/cardano-agent-service.js +12 -0
- package/srv/cardano-indexer-service.cds +164 -73
- package/srv/cardano-indexer-service.js +156 -11
- package/srv/cardano-service.cds +45 -0
- package/srv/cardano-service.js +38 -96
- package/srv/cardano-sign-service.cds +200 -180
- package/srv/cardano-sign-service.js +55 -173
- package/srv/cardano-tx-service.cds +32 -26
- package/srv/cardano-tx-service.js +133 -195
- package/srv/cardano-worker-service.js +7 -15
- package/srv/server.d.ts +28 -86
- package/srv/server.js +95 -128
- package/srv/utils/agent-grants-config.d.ts +37 -0
- package/srv/utils/agent-grants-config.js +138 -0
- package/srv/utils/agent-grants.d.ts +262 -0
- package/srv/utils/agent-grants.js +914 -0
- package/srv/utils/agent-token-auth.d.ts +16 -0
- package/srv/utils/agent-token-auth.js +78 -0
- package/srv/utils/backend-request-handler.d.ts +2 -16
- package/srv/utils/backend-request-handler.js +3 -18
- package/srv/utils/collections.d.ts +4 -8
- package/srv/utils/collections.js +4 -8
- package/srv/utils/const.d.ts +19 -68
- package/srv/utils/const.js +20 -69
- package/srv/utils/crypto.d.ts +3 -12
- package/srv/utils/crypto.js +5 -18
- package/srv/utils/db-indexes.d.ts +25 -0
- package/srv/utils/db-indexes.js +89 -0
- package/srv/utils/db-sanitize.d.ts +27 -0
- package/srv/utils/db-sanitize.js +85 -0
- package/srv/utils/error-codes.d.ts +18 -73
- package/srv/utils/error-codes.js +17 -70
- package/srv/utils/errors.d.ts +34 -178
- package/srv/utils/errors.js +55 -217
- package/srv/utils/liveness.d.ts +16 -0
- package/srv/utils/liveness.js +41 -0
- package/srv/utils/mappers.d.ts +82 -210
- package/srv/utils/mappers.js +272 -293
- package/srv/utils/network-context.js +2 -11
- package/srv/utils/pg-order-nulls.d.ts +14 -0
- package/srv/utils/pg-order-nulls.js +57 -0
- package/srv/utils/plutus-placeholders.d.ts +6 -18
- package/srv/utils/plutus-placeholders.js +6 -20
- package/srv/utils/rate-limiter.d.ts +46 -0
- package/srv/utils/rate-limiter.js +116 -0
- package/srv/utils/service-events.d.ts +2 -22
- package/srv/utils/service-events.js +3 -23
- package/srv/utils/signing-helper.d.ts +3 -18
- package/srv/utils/signing-helper.js +10 -32
- package/srv/utils/tx-build-helper.d.ts +18 -92
- package/srv/utils/tx-build-helper.js +32 -123
- package/srv/utils/tx-request-parsers.d.ts +14 -20
- package/srv/utils/tx-request-parsers.js +33 -20
- package/srv/utils/tx-utils.d.ts +4 -23
- package/srv/utils/tx-utils.js +12 -41
- package/srv/utils/types.d.ts +112 -169
- package/srv/utils/types.js +2 -6
- package/srv/utils/validators.d.ts +19 -89
- package/srv/utils/validators.js +31 -138
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
// This is an automatically generated file. Please do not change its contents manually!
|
|
2
|
+
import * as __ from './../_';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Cardano Agent Service (v2.0)
|
|
6
|
+
*
|
|
7
|
+
* Agent grants: scoped, budgeted bearer capabilities an Admin hands to an agent
|
|
8
|
+
* instead of a full user.
|
|
9
|
+
*
|
|
10
|
+
* - CreateAgentGrant / UpdateAgentGrant / RotateAgentGrantToken / RevokeAgentGrant:
|
|
11
|
+
* Admin-only administration, rate limited per principal per hour
|
|
12
|
+
* (AGENT_GRANT_ADMIN_RATE_LIMIT, default 10). The token is returned ONCE from
|
|
13
|
+
* CreateAgentGrant and RotateAgentGrantToken and stored as SHA-256 only.
|
|
14
|
+
* - AgentGrants: Admin-only projection (no token hash). A request carrying a token
|
|
15
|
+
* runs as the principal `agent:<grantId>` with the role `agent-grant` and sees
|
|
16
|
+
* exactly its own row through the row-level restriction below.
|
|
17
|
+
* - GetGrantStatus: token self-service — what am I allowed to do, how much budget
|
|
18
|
+
* is left, when do I expire. What an MCP tool needs to describe itself honestly.
|
|
19
|
+
* - GetGrantUsage: admitted calls per service and action over a window — an Admin
|
|
20
|
+
* for any grant, a token for its own (a partner usage view, ledger reconciliation).
|
|
21
|
+
*
|
|
22
|
+
* A token request never inherits the operator's roles: `@requires: 'Admin'` on the
|
|
23
|
+
* four actions, on PauseWorker / ResumeWorker / pauseCrawler / resumeCrawler and on
|
|
24
|
+
* every other Admin surface therefore refuses it by construction. The allow list,
|
|
25
|
+
* wallet pinning and daily budget are enforced by a before('*') hook on all six
|
|
26
|
+
* ODATANO services (srv/utils/agent-grants.ts). The `x-agent-token` header only
|
|
27
|
+
* reaches the services when cds.requires.odatano-core.agentGrants.enabled is set
|
|
28
|
+
* (srv/utils/agent-token-auth.ts).
|
|
29
|
+
*/
|
|
30
|
+
export default class {
|
|
31
|
+
static readonly GetGrantStatus: typeof GetGrantStatus;
|
|
32
|
+
static readonly CreateAgentGrant: typeof CreateAgentGrant;
|
|
33
|
+
static readonly RevokeAgentGrant: typeof RevokeAgentGrant;
|
|
34
|
+
static readonly RotateAgentGrantToken: typeof RotateAgentGrantToken;
|
|
35
|
+
static readonly UpdateAgentGrant: typeof UpdateAgentGrant;
|
|
36
|
+
static readonly GetGrantUsage: typeof GetGrantUsage;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// entity 'AgentGrant'
|
|
40
|
+
export declare function _AgentGrantAspect<TBase extends new (...args: any[]) => object>(Base: TBase): {
|
|
41
|
+
new (...args: any[]): {
|
|
42
|
+
ID?: __.Key<string>
|
|
43
|
+
userId?: string
|
|
44
|
+
agentLabel?: string | null
|
|
45
|
+
allowedActions?: string
|
|
46
|
+
walletId?: string | null
|
|
47
|
+
allowedJobKinds?: string | null
|
|
48
|
+
maxJobsPerDay?: number | null
|
|
49
|
+
jobsUsedToday?: number | null
|
|
50
|
+
budgetWindow?: string | null
|
|
51
|
+
validUntil?: __.CdsTimestamp | null
|
|
52
|
+
isActive?: boolean | null
|
|
53
|
+
revokedAt?: __.CdsTimestamp | null
|
|
54
|
+
createdAt?: __.CdsTimestamp | null
|
|
55
|
+
lastUsedAt?: __.CdsTimestamp | null
|
|
56
|
+
} & InstanceType<TBase>
|
|
57
|
+
readonly kind: 'entity';
|
|
58
|
+
readonly keys: __.KeysOf<AgentGrant>;
|
|
59
|
+
readonly elements: __.ElementsOf<AgentGrant>;
|
|
60
|
+
readonly actions: globalThis.Record<never, never>;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Agent grants (v2.0): scoped bearer capabilities an Admin hands to an agent
|
|
64
|
+
* instead of a full user. The token is a capability, not an identity — it is
|
|
65
|
+
* stored as SHA-256 only, and a request carrying it runs as the principal
|
|
66
|
+
* `agent:<ID>` with the role `agent-grant`, never as the operator. Enforcement
|
|
67
|
+
* (allow list, wallet pinning, daily budget) lives in srv/utils/agent-grants.ts;
|
|
68
|
+
* the transport lane that admits `x-agent-token` in srv/utils/agent-token-auth.ts.
|
|
69
|
+
* Admin-only table: creation and revocation happen through CardanoAgentService
|
|
70
|
+
* actions, a token request may read its own row only.
|
|
71
|
+
*/
|
|
72
|
+
export class AgentGrant extends _AgentGrantAspect(__.Entity) {
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Agent grants (v2.0): scoped bearer capabilities an Admin hands to an agent
|
|
76
|
+
* instead of a full user. The token is a capability, not an identity — it is
|
|
77
|
+
* stored as SHA-256 only, and a request carrying it runs as the principal
|
|
78
|
+
* `agent:<ID>` with the role `agent-grant`, never as the operator. Enforcement
|
|
79
|
+
* (allow list, wallet pinning, daily budget) lives in srv/utils/agent-grants.ts;
|
|
80
|
+
* the transport lane that admits `x-agent-token` in srv/utils/agent-token-auth.ts.
|
|
81
|
+
* Admin-only table: creation and revocation happen through CardanoAgentService
|
|
82
|
+
* actions, a token request may read its own row only.
|
|
83
|
+
*/
|
|
84
|
+
export class AgentGrants extends Array<AgentGrant> {
|
|
85
|
+
$count?: number
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// entity 'GrantStatus'
|
|
89
|
+
export declare function _GrantStatusAspect<TBase extends new (...args: any[]) => object>(Base: TBase): {
|
|
90
|
+
new (...args: any[]): {
|
|
91
|
+
grantId?: string | null
|
|
92
|
+
agentLabel?: string | null
|
|
93
|
+
allowedActions?: Array<string>
|
|
94
|
+
walletId?: string | null
|
|
95
|
+
allowedJobKinds?: Array<string>
|
|
96
|
+
maxJobsPerDay?: number | null
|
|
97
|
+
jobsUsedToday?: number | null
|
|
98
|
+
budgetWindow?: string | null
|
|
99
|
+
validUntil?: __.CdsTimestamp | null
|
|
100
|
+
isActive?: boolean | null
|
|
101
|
+
} & InstanceType<TBase>
|
|
102
|
+
readonly kind: 'type';
|
|
103
|
+
readonly keys: __.KeysOf<GrantStatus>;
|
|
104
|
+
readonly elements: __.ElementsOf<GrantStatus>;
|
|
105
|
+
readonly actions: globalThis.Record<never, never>;
|
|
106
|
+
};
|
|
107
|
+
export class GrantStatus extends _GrantStatusAspect(__.Entity) {
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// entity 'IssuedGrant'
|
|
111
|
+
export declare function _IssuedGrantAspect<TBase extends new (...args: any[]) => object>(Base: TBase): {
|
|
112
|
+
new (...args: any[]): {
|
|
113
|
+
grantId?: string | null
|
|
114
|
+
token?: string | null
|
|
115
|
+
allowedActions?: Array<string>
|
|
116
|
+
walletId?: string | null
|
|
117
|
+
allowedJobKinds?: Array<string>
|
|
118
|
+
maxJobsPerDay?: number | null
|
|
119
|
+
validUntil?: __.CdsTimestamp | null
|
|
120
|
+
} & InstanceType<TBase>
|
|
121
|
+
readonly kind: 'type';
|
|
122
|
+
readonly keys: __.KeysOf<IssuedGrant>;
|
|
123
|
+
readonly elements: __.ElementsOf<IssuedGrant>;
|
|
124
|
+
readonly actions: globalThis.Record<never, never>;
|
|
125
|
+
};
|
|
126
|
+
export class IssuedGrant extends _IssuedGrantAspect(__.Entity) {
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// entity 'RotatedGrant'
|
|
130
|
+
export declare function _RotatedGrantAspect<TBase extends new (...args: any[]) => object>(Base: TBase): {
|
|
131
|
+
new (...args: any[]): {
|
|
132
|
+
grantId?: string | null
|
|
133
|
+
token?: string | null
|
|
134
|
+
} & InstanceType<TBase>
|
|
135
|
+
readonly kind: 'type';
|
|
136
|
+
readonly keys: __.KeysOf<RotatedGrant>;
|
|
137
|
+
readonly elements: __.ElementsOf<RotatedGrant>;
|
|
138
|
+
readonly actions: globalThis.Record<never, never>;
|
|
139
|
+
};
|
|
140
|
+
export class RotatedGrant extends _RotatedGrantAspect(__.Entity) {
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// entity 'UpdatedGrant'
|
|
144
|
+
export declare function _UpdatedGrantAspect<TBase extends new (...args: any[]) => object>(Base: TBase): {
|
|
145
|
+
new (...args: any[]): {
|
|
146
|
+
grantId?: string | null
|
|
147
|
+
updated?: Array<string>
|
|
148
|
+
} & InstanceType<TBase>
|
|
149
|
+
readonly kind: 'type';
|
|
150
|
+
readonly keys: __.KeysOf<UpdatedGrant>;
|
|
151
|
+
readonly elements: __.ElementsOf<UpdatedGrant>;
|
|
152
|
+
readonly actions: globalThis.Record<never, never>;
|
|
153
|
+
};
|
|
154
|
+
export class UpdatedGrant extends _UpdatedGrantAspect(__.Entity) {
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// entity 'GrantUsageCall'
|
|
158
|
+
export declare function _GrantUsageCallAspect<TBase extends new (...args: any[]) => object>(Base: TBase): {
|
|
159
|
+
new (...args: any[]): {
|
|
160
|
+
service?: string | null
|
|
161
|
+
action?: string | null
|
|
162
|
+
count?: number | null
|
|
163
|
+
refunded?: number | null
|
|
164
|
+
} & InstanceType<TBase>
|
|
165
|
+
readonly kind: 'type';
|
|
166
|
+
readonly keys: __.KeysOf<GrantUsageCall>;
|
|
167
|
+
readonly elements: __.ElementsOf<GrantUsageCall>;
|
|
168
|
+
readonly actions: globalThis.Record<never, never>;
|
|
169
|
+
};
|
|
170
|
+
export class GrantUsageCall extends _GrantUsageCallAspect(__.Entity) {
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// entity 'GrantUsage'
|
|
174
|
+
export declare function _GrantUsageAspect<TBase extends new (...args: any[]) => object>(Base: TBase): {
|
|
175
|
+
new (...args: any[]): {
|
|
176
|
+
grantId?: string | null
|
|
177
|
+
since?: __.CdsTimestamp | null
|
|
178
|
+
until?: __.CdsTimestamp | null
|
|
179
|
+
calls?: Array<GrantUsageCall>
|
|
180
|
+
total?: number | null
|
|
181
|
+
jobsUsedToday?: number | null
|
|
182
|
+
maxJobsPerDay?: number | null
|
|
183
|
+
} & InstanceType<TBase>
|
|
184
|
+
readonly kind: 'type';
|
|
185
|
+
readonly keys: __.KeysOf<GrantUsage>;
|
|
186
|
+
readonly elements: __.ElementsOf<GrantUsage>;
|
|
187
|
+
readonly actions: globalThis.Record<never, never>;
|
|
188
|
+
};
|
|
189
|
+
export class GrantUsage extends _GrantUsageAspect(__.Entity) {
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
export declare const GetGrantStatus: {
|
|
194
|
+
// positional
|
|
195
|
+
(): globalThis.Promise<GrantStatus | null> | GrantStatus | null
|
|
196
|
+
// named
|
|
197
|
+
({}: globalThis.Record<never, never>): globalThis.Promise<GrantStatus | null> | GrantStatus | null
|
|
198
|
+
// metadata (do not use)
|
|
199
|
+
__parameters: globalThis.Record<never, never>, __returns: globalThis.Promise<GrantStatus | null> | GrantStatus | null, __self: never
|
|
200
|
+
kind: 'function'
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export declare const CreateAgentGrant: {
|
|
204
|
+
// positional
|
|
205
|
+
(allowedActions: Array<string>, walletId: string | null, allowedJobKinds: Array<string>, maxJobsPerDay: number | null, validUntil: __.CdsTimestamp | null, agentLabel: string | null): globalThis.Promise<IssuedGrant | null> | IssuedGrant | null
|
|
206
|
+
// named
|
|
207
|
+
({allowedActions, walletId, allowedJobKinds, maxJobsPerDay, validUntil, agentLabel}: {allowedActions?: Array<string>, walletId?: string | null, allowedJobKinds?: Array<string>, maxJobsPerDay?: number | null, validUntil?: __.CdsTimestamp | null, agentLabel?: string | null}): globalThis.Promise<IssuedGrant | null> | IssuedGrant | null
|
|
208
|
+
// metadata (do not use)
|
|
209
|
+
__parameters: {allowedActions?: Array<string>, walletId?: string | null, allowedJobKinds?: Array<string>, maxJobsPerDay?: number | null, validUntil?: __.CdsTimestamp | null, agentLabel?: string | null}, __returns: globalThis.Promise<IssuedGrant | null> | IssuedGrant | null, __self: never
|
|
210
|
+
kind: 'action'
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export declare const RevokeAgentGrant: {
|
|
214
|
+
// positional
|
|
215
|
+
(grantId: string | null): globalThis.Promise<boolean | null> | boolean | null
|
|
216
|
+
// named
|
|
217
|
+
({grantId}: {grantId?: string | null}): globalThis.Promise<boolean | null> | boolean | null
|
|
218
|
+
// metadata (do not use)
|
|
219
|
+
__parameters: {grantId?: string | null}, __returns: globalThis.Promise<boolean | null> | boolean | null, __self: never
|
|
220
|
+
kind: 'action'
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export declare const RotateAgentGrantToken: {
|
|
224
|
+
// positional
|
|
225
|
+
(grantId: string | null): globalThis.Promise<RotatedGrant | null> | RotatedGrant | null
|
|
226
|
+
// named
|
|
227
|
+
({grantId}: {grantId?: string | null}): globalThis.Promise<RotatedGrant | null> | RotatedGrant | null
|
|
228
|
+
// metadata (do not use)
|
|
229
|
+
__parameters: {grantId?: string | null}, __returns: globalThis.Promise<RotatedGrant | null> | RotatedGrant | null, __self: never
|
|
230
|
+
kind: 'action'
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export declare const UpdateAgentGrant: {
|
|
234
|
+
// positional
|
|
235
|
+
(grantId: string | null, agentLabel: string | null, allowedActions: Array<string>, allowedJobKinds: Array<string>, maxJobsPerDay: number | null, validUntil: __.CdsTimestamp | null): globalThis.Promise<UpdatedGrant | null> | UpdatedGrant | null
|
|
236
|
+
// named
|
|
237
|
+
({grantId, agentLabel, allowedActions, allowedJobKinds, maxJobsPerDay, validUntil}: {grantId?: string | null, agentLabel?: string | null, allowedActions?: Array<string>, allowedJobKinds?: Array<string>, maxJobsPerDay?: number | null, validUntil?: __.CdsTimestamp | null}): globalThis.Promise<UpdatedGrant | null> | UpdatedGrant | null
|
|
238
|
+
// metadata (do not use)
|
|
239
|
+
__parameters: {grantId?: string | null, agentLabel?: string | null, allowedActions?: Array<string>, allowedJobKinds?: Array<string>, maxJobsPerDay?: number | null, validUntil?: __.CdsTimestamp | null}, __returns: globalThis.Promise<UpdatedGrant | null> | UpdatedGrant | null, __self: never
|
|
240
|
+
kind: 'action'
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export declare const GetGrantUsage: {
|
|
244
|
+
// positional
|
|
245
|
+
(grantId: string | null, since: __.CdsTimestamp | null, until: __.CdsTimestamp | null): globalThis.Promise<GrantUsage | null> | GrantUsage | null
|
|
246
|
+
// named
|
|
247
|
+
({grantId, since, until}: {grantId?: string | null, since?: __.CdsTimestamp | null, until?: __.CdsTimestamp | null}): globalThis.Promise<GrantUsage | null> | GrantUsage | null
|
|
248
|
+
// metadata (do not use)
|
|
249
|
+
__parameters: {grantId?: string | null, since?: __.CdsTimestamp | null, until?: __.CdsTimestamp | null}, __returns: globalThis.Promise<GrantUsage | null> | GrantUsage | null, __self: never
|
|
250
|
+
kind: 'function'
|
|
251
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// This is an automatically generated file. Please do not change its contents manually!
|
|
2
|
+
const { createEntityProxy } = require('./../_')
|
|
3
|
+
// service
|
|
4
|
+
const CardanoAgentService = { name: 'CardanoAgentService' }
|
|
5
|
+
module.exports = CardanoAgentService
|
|
6
|
+
module.exports.CardanoAgentService = CardanoAgentService
|
|
7
|
+
// AgentGrants
|
|
8
|
+
module.exports.AgentGrant = createEntityProxy(['CardanoAgentService', 'AgentGrants'], { target: { is_singular: true } })
|
|
9
|
+
module.exports.AgentGrants = createEntityProxy(['CardanoAgentService', 'AgentGrants'], { target: { is_singular: false }})
|
|
10
|
+
// GrantStatus
|
|
11
|
+
module.exports.GrantStatus = createEntityProxy(['CardanoAgentService', 'GrantStatus'], { target: { is_singular: true } })
|
|
12
|
+
module.exports.__Array_GrantStatus_ = createEntityProxy(['CardanoAgentService', 'GrantStatus'], { target: { is_singular: false }})
|
|
13
|
+
// IssuedGrant
|
|
14
|
+
module.exports.IssuedGrant = createEntityProxy(['CardanoAgentService', 'IssuedGrant'], { target: { is_singular: true } })
|
|
15
|
+
module.exports.__Array_IssuedGrant_ = createEntityProxy(['CardanoAgentService', 'IssuedGrant'], { target: { is_singular: false }})
|
|
16
|
+
// RotatedGrant
|
|
17
|
+
module.exports.RotatedGrant = createEntityProxy(['CardanoAgentService', 'RotatedGrant'], { target: { is_singular: true } })
|
|
18
|
+
module.exports.__Array_RotatedGrant_ = createEntityProxy(['CardanoAgentService', 'RotatedGrant'], { target: { is_singular: false }})
|
|
19
|
+
// UpdatedGrant
|
|
20
|
+
module.exports.UpdatedGrant = createEntityProxy(['CardanoAgentService', 'UpdatedGrant'], { target: { is_singular: true } })
|
|
21
|
+
module.exports.__Array_UpdatedGrant_ = createEntityProxy(['CardanoAgentService', 'UpdatedGrant'], { target: { is_singular: false }})
|
|
22
|
+
// GrantUsageCall
|
|
23
|
+
module.exports.GrantUsageCall = createEntityProxy(['CardanoAgentService', 'GrantUsageCall'], { target: { is_singular: true } })
|
|
24
|
+
module.exports.__Array_GrantUsageCall_ = createEntityProxy(['CardanoAgentService', 'GrantUsageCall'], { target: { is_singular: false }})
|
|
25
|
+
// GrantUsage
|
|
26
|
+
module.exports.GrantUsage = createEntityProxy(['CardanoAgentService', 'GrantUsage'], { target: { is_singular: true } })
|
|
27
|
+
module.exports.__Array_GrantUsage_ = createEntityProxy(['CardanoAgentService', 'GrantUsage'], { target: { is_singular: false }})
|
|
28
|
+
// events
|
|
29
|
+
// actions
|
|
30
|
+
module.exports.GetGrantStatus = 'GetGrantStatus'
|
|
31
|
+
module.exports.CreateAgentGrant = 'CreateAgentGrant'
|
|
32
|
+
module.exports.RevokeAgentGrant = 'RevokeAgentGrant'
|
|
33
|
+
module.exports.RotateAgentGrantToken = 'RotateAgentGrantToken'
|
|
34
|
+
module.exports.UpdateAgentGrant = 'UpdateAgentGrant'
|
|
35
|
+
module.exports.GetGrantUsage = 'GetGrantUsage'
|
|
36
|
+
// enums
|
|
@@ -10,13 +10,22 @@ import * as __ from './../_';
|
|
|
10
10
|
* - status function + pause/resume actions delegating to the crawler singleton
|
|
11
11
|
*
|
|
12
12
|
* Security note: see CardanoODataService (cardano-service.cds) for the rationale on
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* auth. pause/resume are operational actions — gate behind a dedicated Admin scope.
|
|
14
|
+
* Read-only status and audit data remain available to authenticated users.
|
|
15
|
+
*
|
|
16
|
+
* Deliberately NO service-level @requires: CAP checks a service-level requirement
|
|
17
|
+
* on every request BEFORE the operation's own annotation, so an operation-level
|
|
18
|
+
* `@requires: 'any'` can never open a single function on an otherwise
|
|
19
|
+
* authenticated service (anonymous callers get the 401 challenge first). The
|
|
20
|
+
* requirement therefore sits on each element, and getLiveness() alone is 'any'.
|
|
15
21
|
*/
|
|
16
22
|
export default class {
|
|
17
23
|
static readonly getStatus: typeof getStatus;
|
|
24
|
+
static readonly getLiveness: typeof getLiveness;
|
|
18
25
|
static readonly pauseCrawler: typeof pauseCrawler;
|
|
19
26
|
static readonly resumeCrawler: typeof resumeCrawler;
|
|
27
|
+
static readonly importUtxoSet: typeof importUtxoSet;
|
|
28
|
+
static readonly backfillCertificates: typeof backfillCertificates;
|
|
20
29
|
}
|
|
21
30
|
|
|
22
31
|
// entity 'SyncState'
|
|
@@ -38,6 +47,12 @@ export declare function _SyncStateAspect<TBase extends new (...args: any[]) => o
|
|
|
38
47
|
consecutiveErrors?: number | null
|
|
39
48
|
desiredRunning?: boolean | null
|
|
40
49
|
leaseOwner?: string | null
|
|
50
|
+
utxoSetStatus?: string | null
|
|
51
|
+
utxoAnchorSlot?: number | null
|
|
52
|
+
utxoAnchorHash?: _.Blake2b256 | null
|
|
53
|
+
utxoSetImportedAt?: __.CdsTimestamp | null
|
|
54
|
+
utxoAppliedSlot?: number | null
|
|
55
|
+
utxoSetError?: string | null
|
|
41
56
|
leaseUntil?: __.CdsTimestamp | null
|
|
42
57
|
} & InstanceType<TBase>
|
|
43
58
|
readonly kind: 'entity';
|
|
@@ -79,11 +94,14 @@ export declare function _CrawlerStatusAspect<TBase extends new (...args: any[])
|
|
|
79
94
|
new (...args: any[]): {
|
|
80
95
|
running?: boolean | null
|
|
81
96
|
syncStatus?: string | null
|
|
97
|
+
source?: string | null
|
|
82
98
|
lastSlot?: string | null
|
|
83
99
|
lastHeight?: string | null
|
|
84
100
|
tipHeight?: string | null
|
|
85
101
|
syncProgress?: string | null
|
|
86
102
|
consecutiveErrors?: number | null
|
|
103
|
+
utxoSet?: UtxoSetStatus | null
|
|
104
|
+
certificateBackfill?: CertificateBackfillStatus | null
|
|
87
105
|
} & InstanceType<TBase>
|
|
88
106
|
readonly kind: 'type';
|
|
89
107
|
readonly keys: __.KeysOf<CrawlerStatus>;
|
|
@@ -93,6 +111,95 @@ export declare function _CrawlerStatusAspect<TBase extends new (...args: any[])
|
|
|
93
111
|
export class CrawlerStatus extends _CrawlerStatusAspect(__.Entity) {
|
|
94
112
|
}
|
|
95
113
|
|
|
114
|
+
// entity 'CertificateBackfillStatus'
|
|
115
|
+
export declare function _CertificateBackfillStatusAspect<TBase extends new (...args: any[]) => object>(Base: TBase): {
|
|
116
|
+
new (...args: any[]): {
|
|
117
|
+
status?: string | null
|
|
118
|
+
fromSlot?: string | null
|
|
119
|
+
toSlot?: string | null
|
|
120
|
+
atSlot?: string | null
|
|
121
|
+
blocks?: number | null
|
|
122
|
+
certificates?: number | null
|
|
123
|
+
withdrawals?: number | null
|
|
124
|
+
startedAt?: __.CdsTimestamp | null
|
|
125
|
+
finishedAt?: __.CdsTimestamp | null
|
|
126
|
+
error?: string | null
|
|
127
|
+
} & InstanceType<TBase>
|
|
128
|
+
readonly kind: 'type';
|
|
129
|
+
readonly keys: __.KeysOf<CertificateBackfillStatus>;
|
|
130
|
+
readonly elements: __.ElementsOf<CertificateBackfillStatus>;
|
|
131
|
+
readonly actions: globalThis.Record<never, never>;
|
|
132
|
+
};
|
|
133
|
+
export class CertificateBackfillStatus extends _CertificateBackfillStatusAspect(__.Entity) {
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// entity 'CertificateBackfillResult'
|
|
137
|
+
export declare function _CertificateBackfillResultAspect<TBase extends new (...args: any[]) => object>(Base: TBase): {
|
|
138
|
+
new (...args: any[]): {
|
|
139
|
+
accepted?: boolean | null
|
|
140
|
+
fromSlot?: string | null
|
|
141
|
+
toSlot?: string | null
|
|
142
|
+
message?: string | null
|
|
143
|
+
} & InstanceType<TBase>
|
|
144
|
+
readonly kind: 'type';
|
|
145
|
+
readonly keys: __.KeysOf<CertificateBackfillResult>;
|
|
146
|
+
readonly elements: __.ElementsOf<CertificateBackfillResult>;
|
|
147
|
+
readonly actions: globalThis.Record<never, never>;
|
|
148
|
+
};
|
|
149
|
+
export class CertificateBackfillResult extends _CertificateBackfillResultAspect(__.Entity) {
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// entity 'UtxoSetStatus'
|
|
153
|
+
export declare function _UtxoSetStatusAspect<TBase extends new (...args: any[]) => object>(Base: TBase): {
|
|
154
|
+
new (...args: any[]): {
|
|
155
|
+
enabled?: boolean | null
|
|
156
|
+
status?: string | null
|
|
157
|
+
anchorSlot?: string | null
|
|
158
|
+
anchorHash?: string | null
|
|
159
|
+
importedAt?: __.CdsTimestamp | null
|
|
160
|
+
error?: string | null
|
|
161
|
+
} & InstanceType<TBase>
|
|
162
|
+
readonly kind: 'type';
|
|
163
|
+
readonly keys: __.KeysOf<UtxoSetStatus>;
|
|
164
|
+
readonly elements: __.ElementsOf<UtxoSetStatus>;
|
|
165
|
+
readonly actions: globalThis.Record<never, never>;
|
|
166
|
+
};
|
|
167
|
+
export class UtxoSetStatus extends _UtxoSetStatusAspect(__.Entity) {
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// entity 'UtxoSetImportResult'
|
|
171
|
+
export declare function _UtxoSetImportResultAspect<TBase extends new (...args: any[]) => object>(Base: TBase): {
|
|
172
|
+
new (...args: any[]): {
|
|
173
|
+
accepted?: boolean | null
|
|
174
|
+
anchorSlot?: string | null
|
|
175
|
+
anchorHash?: string | null
|
|
176
|
+
message?: string | null
|
|
177
|
+
} & InstanceType<TBase>
|
|
178
|
+
readonly kind: 'type';
|
|
179
|
+
readonly keys: __.KeysOf<UtxoSetImportResult>;
|
|
180
|
+
readonly elements: __.ElementsOf<UtxoSetImportResult>;
|
|
181
|
+
readonly actions: globalThis.Record<never, never>;
|
|
182
|
+
};
|
|
183
|
+
export class UtxoSetImportResult extends _UtxoSetImportResultAspect(__.Entity) {
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// entity 'Liveness'
|
|
187
|
+
export declare function _LivenessAspect<TBase extends new (...args: any[]) => object>(Base: TBase): {
|
|
188
|
+
new (...args: any[]): {
|
|
189
|
+
status?: string | null
|
|
190
|
+
timestamp?: __.CdsTimestamp | null
|
|
191
|
+
uptime?: number | null
|
|
192
|
+
version?: string | null
|
|
193
|
+
network?: string | null
|
|
194
|
+
} & InstanceType<TBase>
|
|
195
|
+
readonly kind: 'type';
|
|
196
|
+
readonly keys: __.KeysOf<Liveness>;
|
|
197
|
+
readonly elements: __.ElementsOf<Liveness>;
|
|
198
|
+
readonly actions: globalThis.Record<never, never>;
|
|
199
|
+
};
|
|
200
|
+
export class Liveness extends _LivenessAspect(__.Entity) {
|
|
201
|
+
}
|
|
202
|
+
|
|
96
203
|
// event
|
|
97
204
|
export declare class blockIndexed {
|
|
98
205
|
readonly kind: 'event';
|
|
@@ -121,6 +228,16 @@ export declare const getStatus: {
|
|
|
121
228
|
kind: 'function'
|
|
122
229
|
}
|
|
123
230
|
|
|
231
|
+
export declare const getLiveness: {
|
|
232
|
+
// positional
|
|
233
|
+
(): globalThis.Promise<Liveness | null> | Liveness | null
|
|
234
|
+
// named
|
|
235
|
+
({}: globalThis.Record<never, never>): globalThis.Promise<Liveness | null> | Liveness | null
|
|
236
|
+
// metadata (do not use)
|
|
237
|
+
__parameters: globalThis.Record<never, never>, __returns: globalThis.Promise<Liveness | null> | Liveness | null, __self: never
|
|
238
|
+
kind: 'function'
|
|
239
|
+
}
|
|
240
|
+
|
|
124
241
|
export declare const pauseCrawler: {
|
|
125
242
|
// positional
|
|
126
243
|
(): globalThis.Promise<boolean | null> | boolean | null
|
|
@@ -139,4 +256,24 @@ export declare const resumeCrawler: {
|
|
|
139
256
|
// metadata (do not use)
|
|
140
257
|
__parameters: globalThis.Record<never, never>, __returns: globalThis.Promise<boolean | null> | boolean | null, __self: never
|
|
141
258
|
kind: 'action'
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export declare const importUtxoSet: {
|
|
262
|
+
// positional
|
|
263
|
+
(source: string | null, filePath: string | null, anchorSlot: number | null, anchorHash: string | null): globalThis.Promise<UtxoSetImportResult | null> | UtxoSetImportResult | null
|
|
264
|
+
// named
|
|
265
|
+
({source, filePath, anchorSlot, anchorHash}: {source?: string | null, filePath?: string | null, anchorSlot?: number | null, anchorHash?: string | null}): globalThis.Promise<UtxoSetImportResult | null> | UtxoSetImportResult | null
|
|
266
|
+
// metadata (do not use)
|
|
267
|
+
__parameters: {source?: string | null, filePath?: string | null, anchorSlot?: number | null, anchorHash?: string | null}, __returns: globalThis.Promise<UtxoSetImportResult | null> | UtxoSetImportResult | null, __self: never
|
|
268
|
+
kind: 'action'
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export declare const backfillCertificates: {
|
|
272
|
+
// positional
|
|
273
|
+
(fromSlot: number | null, toSlot: number | null): globalThis.Promise<CertificateBackfillResult | null> | CertificateBackfillResult | null
|
|
274
|
+
// named
|
|
275
|
+
({fromSlot, toSlot}: {fromSlot?: number | null, toSlot?: number | null}): globalThis.Promise<CertificateBackfillResult | null> | CertificateBackfillResult | null
|
|
276
|
+
// metadata (do not use)
|
|
277
|
+
__parameters: {fromSlot?: number | null, toSlot?: number | null}, __returns: globalThis.Promise<CertificateBackfillResult | null> | CertificateBackfillResult | null, __self: never
|
|
278
|
+
kind: 'action'
|
|
142
279
|
}
|
|
@@ -13,11 +13,29 @@ module.exports.ReorgLog_ = createEntityProxy(['CardanoIndexerService', 'ReorgLog
|
|
|
13
13
|
// CrawlerStatus
|
|
14
14
|
module.exports.CrawlerStatus = createEntityProxy(['CardanoIndexerService', 'CrawlerStatus'], { target: { is_singular: true } })
|
|
15
15
|
module.exports.__Array_CrawlerStatus_ = createEntityProxy(['CardanoIndexerService', 'CrawlerStatus'], { target: { is_singular: false }})
|
|
16
|
+
// CertificateBackfillStatus
|
|
17
|
+
module.exports.CertificateBackfillStatus = createEntityProxy(['CardanoIndexerService', 'CertificateBackfillStatus'], { target: { is_singular: true } })
|
|
18
|
+
module.exports.__Array_CertificateBackfillStatus_ = createEntityProxy(['CardanoIndexerService', 'CertificateBackfillStatus'], { target: { is_singular: false }})
|
|
19
|
+
// CertificateBackfillResult
|
|
20
|
+
module.exports.CertificateBackfillResult = createEntityProxy(['CardanoIndexerService', 'CertificateBackfillResult'], { target: { is_singular: true } })
|
|
21
|
+
module.exports.__Array_CertificateBackfillResult_ = createEntityProxy(['CardanoIndexerService', 'CertificateBackfillResult'], { target: { is_singular: false }})
|
|
22
|
+
// UtxoSetStatus
|
|
23
|
+
module.exports.UtxoSetStatus = createEntityProxy(['CardanoIndexerService', 'UtxoSetStatus'], { target: { is_singular: true } })
|
|
24
|
+
module.exports.__Array_UtxoSetStatus_ = createEntityProxy(['CardanoIndexerService', 'UtxoSetStatus'], { target: { is_singular: false }})
|
|
25
|
+
// UtxoSetImportResult
|
|
26
|
+
module.exports.UtxoSetImportResult = createEntityProxy(['CardanoIndexerService', 'UtxoSetImportResult'], { target: { is_singular: true } })
|
|
27
|
+
module.exports.__Array_UtxoSetImportResult_ = createEntityProxy(['CardanoIndexerService', 'UtxoSetImportResult'], { target: { is_singular: false }})
|
|
28
|
+
// Liveness
|
|
29
|
+
module.exports.Liveness = createEntityProxy(['CardanoIndexerService', 'Liveness'], { target: { is_singular: true } })
|
|
30
|
+
module.exports.__Array_Liveness_ = createEntityProxy(['CardanoIndexerService', 'Liveness'], { target: { is_singular: false }})
|
|
16
31
|
// events
|
|
17
32
|
module.exports.blockIndexed = 'CardanoIndexerService.blockIndexed'
|
|
18
33
|
module.exports.reorg = 'CardanoIndexerService.reorg'
|
|
19
34
|
// actions
|
|
20
35
|
module.exports.getStatus = 'getStatus'
|
|
36
|
+
module.exports.getLiveness = 'getLiveness'
|
|
21
37
|
module.exports.pauseCrawler = 'pauseCrawler'
|
|
22
38
|
module.exports.resumeCrawler = 'resumeCrawler'
|
|
39
|
+
module.exports.importUtxoSet = 'importUtxoSet'
|
|
40
|
+
module.exports.backfillCertificates = 'backfillCertificates'
|
|
23
41
|
// enums
|