@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.
Files changed (133) hide show
  1. package/@cds-models/CardanoAgentService/index.d.ts +255 -0
  2. package/@cds-models/CardanoAgentService/index.js +36 -0
  3. package/@cds-models/CardanoIndexerService/index.d.ts +177 -0
  4. package/@cds-models/CardanoIndexerService/index.js +27 -0
  5. package/@cds-models/CardanoODataService/index.d.ts +693 -2172
  6. package/@cds-models/CardanoODataService/index.js +88 -390
  7. package/@cds-models/CardanoSignService/index.d.ts +448 -1576
  8. package/@cds-models/CardanoSignService/index.js +62 -293
  9. package/@cds-models/CardanoTransactionService/index.d.ts +437 -1494
  10. package/@cds-models/CardanoTransactionService/index.js +60 -271
  11. package/@cds-models/CardanoWorkerService/index.d.ts +224 -0
  12. package/@cds-models/CardanoWorkerService/index.js +32 -0
  13. package/@cds-models/_/index.d.ts +70 -40
  14. package/@cds-models/_/index.js +17 -32
  15. package/@cds-models/cds/outbox/index.d.ts +28 -0
  16. package/@cds-models/index.d.ts +225 -522
  17. package/@cds-models/index.js +35 -218
  18. package/@cds-models/odatano/cardano/index.d.ts +919 -2884
  19. package/@cds-models/odatano/cardano/index.js +115 -536
  20. package/@cds-models/sap/common/index.d.ts +196 -600
  21. package/@cds-models/sap/common/index.js +28 -269
  22. package/README.md +194 -102
  23. package/db/schema.cds +388 -1
  24. package/db/types.cds +48 -0
  25. package/package.json +48 -33
  26. package/src/index.d.ts +7 -1
  27. package/src/index.js +30 -2
  28. package/src/plugin.js +33 -20
  29. package/srv/blockchain/backends/blockfrost-backend.d.ts +21 -2
  30. package/srv/blockchain/backends/blockfrost-backend.js +69 -25
  31. package/srv/blockchain/backends/cardano-backend.d.ts +69 -0
  32. package/srv/blockchain/backends/cardano-backend.js +13 -0
  33. package/srv/blockchain/backends/koios-backend.d.ts +26 -2
  34. package/srv/blockchain/backends/koios-backend.js +148 -25
  35. package/srv/blockchain/backends/ogmios-backend.d.ts +60 -9
  36. package/srv/blockchain/backends/ogmios-backend.js +326 -10
  37. package/srv/blockchain/cardano-client.d.ts +19 -0
  38. package/srv/blockchain/cardano-client.js +36 -0
  39. package/srv/blockchain/cardano-indexer.d.ts +50 -1
  40. package/srv/blockchain/cardano-indexer.js +193 -0
  41. package/srv/blockchain/crawler/crawler.d.ts +176 -0
  42. package/srv/blockchain/crawler/crawler.js +744 -0
  43. package/srv/blockchain/crawler/hooks.d.ts +43 -0
  44. package/srv/blockchain/crawler/hooks.js +62 -0
  45. package/srv/blockchain/crawler/index.d.ts +35 -0
  46. package/srv/blockchain/crawler/index.js +168 -0
  47. package/srv/blockchain/crawler/sync-state.d.ts +106 -0
  48. package/srv/blockchain/crawler/sync-state.js +287 -0
  49. package/srv/blockchain/signing/hsm-signer.d.ts +45 -0
  50. package/srv/blockchain/signing/hsm-signer.js +8 -1
  51. package/srv/blockchain/transaction-building/buildooor-tx.d.ts +20 -0
  52. package/srv/blockchain/transaction-building/buildooor-tx.js +104 -20
  53. package/srv/blockchain/wallet-worker/build-request.d.ts +26 -0
  54. package/srv/blockchain/wallet-worker/build-request.js +370 -0
  55. package/srv/blockchain/wallet-worker/confirmation-tracker.d.ts +117 -0
  56. package/srv/blockchain/wallet-worker/confirmation-tracker.js +290 -0
  57. package/srv/blockchain/wallet-worker/index.d.ts +14 -0
  58. package/srv/blockchain/wallet-worker/index.js +80 -0
  59. package/srv/blockchain/wallet-worker/job-store.d.ts +272 -0
  60. package/srv/blockchain/wallet-worker/job-store.js +597 -0
  61. package/srv/blockchain/wallet-worker/lease-heartbeat.d.ts +43 -0
  62. package/srv/blockchain/wallet-worker/lease-heartbeat.js +99 -0
  63. package/srv/blockchain/wallet-worker/signers.d.ts +57 -0
  64. package/srv/blockchain/wallet-worker/signers.js +131 -0
  65. package/srv/blockchain/wallet-worker/wallet-worker.d.ts +145 -0
  66. package/srv/blockchain/wallet-worker/wallet-worker.js +542 -0
  67. package/srv/cardano-agent-service.cds +150 -0
  68. package/srv/cardano-agent-service.d.ts +2 -0
  69. package/srv/cardano-agent-service.js +16 -0
  70. package/srv/cardano-indexer-service.cds +106 -0
  71. package/srv/cardano-indexer-service.d.ts +2 -0
  72. package/srv/cardano-indexer-service.js +79 -0
  73. package/srv/cardano-service.js +79 -4
  74. package/srv/cardano-sign-service.cds +200 -180
  75. package/srv/cardano-tx-service.cds +32 -26
  76. package/srv/cardano-tx-service.d.ts +1 -11
  77. package/srv/cardano-tx-service.js +107 -200
  78. package/srv/cardano-worker-service.cds +125 -0
  79. package/srv/cardano-worker-service.d.ts +2 -0
  80. package/srv/cardano-worker-service.js +199 -0
  81. package/srv/server.d.ts +34 -2
  82. package/srv/server.js +246 -36
  83. package/srv/utils/agent-grants-config.d.ts +65 -0
  84. package/srv/utils/agent-grants-config.js +148 -0
  85. package/srv/utils/agent-grants.d.ts +314 -0
  86. package/srv/utils/agent-grants.js +821 -0
  87. package/srv/utils/agent-token-auth.d.ts +19 -0
  88. package/srv/utils/agent-token-auth.js +81 -0
  89. package/srv/utils/collections.d.ts +13 -0
  90. package/srv/utils/collections.js +24 -0
  91. package/srv/utils/crypto.d.ts +16 -0
  92. package/srv/utils/crypto.js +75 -0
  93. package/srv/utils/db-sanitize.d.ts +40 -0
  94. package/srv/utils/db-sanitize.js +98 -0
  95. package/srv/utils/error-codes.d.ts +6 -0
  96. package/srv/utils/error-codes.js +6 -0
  97. package/srv/utils/errors.d.ts +12 -0
  98. package/srv/utils/errors.js +45 -0
  99. package/srv/utils/liveness.d.ts +23 -0
  100. package/srv/utils/liveness.js +49 -0
  101. package/srv/utils/mappers.d.ts +27 -0
  102. package/srv/utils/mappers.js +80 -10
  103. package/srv/utils/rate-limiter.d.ts +57 -0
  104. package/srv/utils/rate-limiter.js +126 -0
  105. package/srv/utils/service-events.d.ts +26 -0
  106. package/srv/utils/service-events.js +46 -0
  107. package/srv/utils/tx-request-parsers.d.ts +71 -0
  108. package/srv/utils/tx-request-parsers.js +202 -0
  109. package/srv/utils/tx-utils.d.ts +2 -1
  110. package/srv/utils/tx-utils.js +3 -2
  111. package/srv/utils/types.d.ts +17 -1
  112. package/@cds-models/CardanoODataService/index.d.ts.map +0 -1
  113. package/@cds-models/CardanoODataService/index.js.map +0 -1
  114. package/@cds-models/CardanoODataService/index.ts +0 -776
  115. package/@cds-models/CardanoSignService/index.d.ts.map +0 -1
  116. package/@cds-models/CardanoSignService/index.js.map +0 -1
  117. package/@cds-models/CardanoSignService/index.ts +0 -569
  118. package/@cds-models/CardanoTransactionService/index.d.ts.map +0 -1
  119. package/@cds-models/CardanoTransactionService/index.js.map +0 -1
  120. package/@cds-models/CardanoTransactionService/index.ts +0 -526
  121. package/@cds-models/_/index.d.ts.map +0 -1
  122. package/@cds-models/_/index.js.map +0 -1
  123. package/@cds-models/_/index.ts +0 -96
  124. package/@cds-models/cds/outbox/index.ts +0 -27
  125. package/@cds-models/index.d.ts.map +0 -1
  126. package/@cds-models/index.js.map +0 -1
  127. package/@cds-models/index.ts +0 -245
  128. package/@cds-models/odatano/cardano/index.d.ts.map +0 -1
  129. package/@cds-models/odatano/cardano/index.js.map +0 -1
  130. package/@cds-models/odatano/cardano/index.ts +0 -789
  131. package/@cds-models/sap/common/index.d.ts.map +0 -1
  132. package/@cds-models/sap/common/index.js.map +0 -1
  133. package/@cds-models/sap/common/index.ts +0 -249
@@ -1,47 +1,57 @@
1
- import { type } from '@sap/cds';
2
- export type ElementsOf<T> = {
3
- [name in keyof Required<T>]: type;
4
- };
5
- export declare namespace Association {
6
- type to<T> = T;
7
- namespace to {
8
- type many<T extends readonly any[]> = T;
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
- export declare namespace Composition {
12
- type of<T> = T;
13
- namespace of {
14
- type many<T extends readonly any[]> = T;
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
- export declare class Entity {
18
- static data<T extends Entity>(this: T, _input: Object): T;
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: object[]): T[];
22
- data(input: object): T;
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
- export type DraftOf<T> = {
31
- new (...args: any[]): DraftEntity<T>;
32
- };
33
- export type DraftsOf<T> = typeof Array<DraftEntity<T>>;
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
- declare const key: unique symbol;
38
- export type Key<T> = T & {
39
- [key]?: true;
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
- [K in keyof T as NonNullable<T[K]> extends Key<unknown> ? K : never]-?: Key<{}>;
43
- };
44
- export type Unkey<T> = T extends Key<infer U> ? U : T;
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
- export type CdsMap = {
62
- [key: string]: unknown;
63
- };
64
- export declare const createEntityProxy: (fqParts: any, opts?: {}) => any;
65
- export {};
66
- //# sourceMappingURL=index.d.ts.map
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
+ }
@@ -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 cds_1 = __importDefault(require("@sap/cds"));
9
- class Entity {
10
- static data(_input) {
11
- return {}; // mock
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 (cds_1.default.entities) {
22
- target.__proto__ = cds_1.default.entities(fqParts[0])[fqParts[1]];
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
- exports.createEntityProxy = createEntityProxy;
42
- //# sourceMappingURL=index.js.map
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
+ }