@floegence/redevplugin-contracts 0.0.0-dev
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/dist/contracts.gen.d.ts +595 -0
- package/dist/contracts.gen.js +706 -0
- package/dist/index.d.ts +310 -0
- package/dist/index.js +33 -0
- package/dist/release-signing.d.ts +434 -0
- package/dist/release-signing.js +1152 -0
- package/package.json +32 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import { generatedContractArtifacts, generatedRegistryContract } from "./contracts.gen.js";
|
|
2
|
+
export * from "./release-signing.js";
|
|
3
|
+
export type ContractID = (typeof generatedContractArtifacts)[number]["id"] | typeof generatedRegistryContract.id;
|
|
4
|
+
export type Contract = Readonly<{
|
|
5
|
+
id: ContractID;
|
|
6
|
+
path: string;
|
|
7
|
+
version: string;
|
|
8
|
+
sha256: string;
|
|
9
|
+
body: string;
|
|
10
|
+
}>;
|
|
11
|
+
export declare class UnknownContractError extends RangeError {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
constructor(id: string);
|
|
14
|
+
}
|
|
15
|
+
export declare const contractArtifacts: readonly Contract[];
|
|
16
|
+
export declare const registryContract: Contract;
|
|
17
|
+
export declare const contractRegistry: {
|
|
18
|
+
readonly schema_version: "redevplugin.contract_registry.v2";
|
|
19
|
+
readonly registry_version: "contract-registry-v2";
|
|
20
|
+
readonly artifacts: readonly [{
|
|
21
|
+
readonly id: "compatibility-manifest-schema";
|
|
22
|
+
readonly path: "spec/plugin/compatibility-manifest-v8.schema.json";
|
|
23
|
+
readonly version: "compatibility-manifest-v8";
|
|
24
|
+
readonly sha256: "a1831e0ae9a1b47d92e7ad9879b1ca4e3510ebc212b87360595b672e8b87bc79";
|
|
25
|
+
}, {
|
|
26
|
+
readonly id: "contract-registry-schema";
|
|
27
|
+
readonly path: "spec/plugin/contract-registry-v2.schema.json";
|
|
28
|
+
readonly version: "contract-registry-v2";
|
|
29
|
+
readonly sha256: "d516b3565158ac1b0d5e9f86b91b13ac19321ab3ff54468be41951b68d7085ac";
|
|
30
|
+
}, {
|
|
31
|
+
readonly id: "error-codes-schema";
|
|
32
|
+
readonly path: "spec/plugin/error-codes-v6.schema.json";
|
|
33
|
+
readonly version: "error-codes-v6";
|
|
34
|
+
readonly sha256: "094cb980156c17af4866942b51e6a1032ea7d1ae0675b329d59a765223ccda28";
|
|
35
|
+
}, {
|
|
36
|
+
readonly id: "host-capability-compatibility-schema";
|
|
37
|
+
readonly path: "spec/plugin/host-capability-compatibility-v1.schema.json";
|
|
38
|
+
readonly version: "host-capability-compatibility-v1";
|
|
39
|
+
readonly sha256: "361ebbf7009aeb66c763ecde46427b17b6cf7d2307c01886c5987a1f4f1762de";
|
|
40
|
+
}, {
|
|
41
|
+
readonly id: "host-capability-contract-schema";
|
|
42
|
+
readonly path: "spec/plugin/host-capability-contract-v1.schema.json";
|
|
43
|
+
readonly version: "host-capability-contract-v1";
|
|
44
|
+
readonly sha256: "0a653e36d44104f1d16b06ee424648086c146f23c907b176bdf470ae73025485";
|
|
45
|
+
}, {
|
|
46
|
+
readonly id: "host-capability-manifest-schema";
|
|
47
|
+
readonly path: "spec/plugin/host-capability-manifest-v1.schema.json";
|
|
48
|
+
readonly version: "host-capability-manifest-v1";
|
|
49
|
+
readonly sha256: "5f13a8e5f918378b9cba9fdc133a9a75ba3a8311c30cb6a02ca0aba09035110e";
|
|
50
|
+
}, {
|
|
51
|
+
readonly id: "host-capability-notices-schema";
|
|
52
|
+
readonly path: "spec/plugin/host-capability-notices-v1.schema.json";
|
|
53
|
+
readonly version: "host-capability-notices-v1";
|
|
54
|
+
readonly sha256: "6affd5d0ae90239f6fd08cbeddae4eef393efa2838c9e4935874ba3dc0e05948";
|
|
55
|
+
}, {
|
|
56
|
+
readonly id: "host-capability-pin-schema";
|
|
57
|
+
readonly path: "spec/plugin/host-capability-pin-v1.schema.json";
|
|
58
|
+
readonly version: "host-capability-pin-v1";
|
|
59
|
+
readonly sha256: "20526a5934f0d85a3db7882492487266f09de5bcd176e2c7936f05d0b7fe0338";
|
|
60
|
+
}, {
|
|
61
|
+
readonly id: "host-capability-signature-schema";
|
|
62
|
+
readonly path: "spec/plugin/host-capability-signature-v1.schema.json";
|
|
63
|
+
readonly version: "host-capability-signature-v1";
|
|
64
|
+
readonly sha256: "88cbc1d63afb7e289ca4f8b7c76f702b8d20156f7722c1b71f3ab9138a240a5e";
|
|
65
|
+
}, {
|
|
66
|
+
readonly id: "iframe-bridge-schema";
|
|
67
|
+
readonly path: "spec/plugin/bridge-v5.schema.json";
|
|
68
|
+
readonly version: "bridge-v5";
|
|
69
|
+
readonly sha256: "ad8ccc7e1900ecb871432f07296dd681ae6faea9377e52f5ddca90300c04f4da";
|
|
70
|
+
}, {
|
|
71
|
+
readonly id: "manifest-schema";
|
|
72
|
+
readonly path: "spec/plugin/manifest-v5.schema.json";
|
|
73
|
+
readonly version: "manifest-v5";
|
|
74
|
+
readonly sha256: "9695f6163aa539b9e3a933367c98850257c6d7bb8d61b36fd5f83b3ab61746f7";
|
|
75
|
+
}, {
|
|
76
|
+
readonly id: "network-grant-schema";
|
|
77
|
+
readonly path: "spec/plugin/network-grant-v2.schema.json";
|
|
78
|
+
readonly version: "network-grant-v2";
|
|
79
|
+
readonly sha256: "5fc1cfc3469a992e551fd392fab982abb6f95e456a1cb768ceca137f7c693abc";
|
|
80
|
+
}, {
|
|
81
|
+
readonly id: "opaque-surface-document-schema";
|
|
82
|
+
readonly path: "spec/plugin/opaque-surface-document-v3.schema.json";
|
|
83
|
+
readonly version: "opaque-surface-document-v3";
|
|
84
|
+
readonly sha256: "63419ff5b5a8890e14f97ca29aaae175b93daff61d4567c5bdff7f6e6a9e7450";
|
|
85
|
+
}, {
|
|
86
|
+
readonly id: "opaque-surface-transport-schema";
|
|
87
|
+
readonly path: "spec/plugin/opaque-surface-transport-v4.schema.json";
|
|
88
|
+
readonly version: "opaque-surface-transport-v4";
|
|
89
|
+
readonly sha256: "70a32dc8bf281cea2c92492c466fd477070c62156a3f593d45eb460cde62dca2";
|
|
90
|
+
}, {
|
|
91
|
+
readonly id: "owner-scope-inventory-registry";
|
|
92
|
+
readonly path: "spec/plugin/owner-scope-inventories-v1.json";
|
|
93
|
+
readonly version: "owner-scope-inventory-registry-v1";
|
|
94
|
+
readonly sha256: "92a2d6ed3a9038e95285faa108e2186cf9d0df343854741c551f8c4039f91217";
|
|
95
|
+
}, {
|
|
96
|
+
readonly id: "owner-scope-inventory-schema";
|
|
97
|
+
readonly path: "spec/plugin/owner-scope-inventory-v1.schema.json";
|
|
98
|
+
readonly version: "owner-scope-inventory-v1";
|
|
99
|
+
readonly sha256: "972e4fe3cc74339c211ba8a50951ad0f4ae4265d3d34b20f03d0e4888638e254";
|
|
100
|
+
}, {
|
|
101
|
+
readonly id: "owner-scope-migration-schema";
|
|
102
|
+
readonly path: "spec/plugin/owner-scope-migration-v1.schema.json";
|
|
103
|
+
readonly version: "owner-scope-migration-v1";
|
|
104
|
+
readonly sha256: "e73443813e19e4cfb05748eb75d5cf04f43db3bed9d2be0c893c13bda88a5993";
|
|
105
|
+
}, {
|
|
106
|
+
readonly id: "package-signature-schema";
|
|
107
|
+
readonly path: "spec/plugin/package-signature-v1.schema.json";
|
|
108
|
+
readonly version: "package-signature-v1";
|
|
109
|
+
readonly sha256: "13951c0f6831ba28647774368c76a817868aeb7984628e2cf3dc4ad1b54f8284";
|
|
110
|
+
}, {
|
|
111
|
+
readonly id: "performance-contract";
|
|
112
|
+
readonly path: "spec/plugin/performance-contract-v3.json";
|
|
113
|
+
readonly version: "performance-contract-v3";
|
|
114
|
+
readonly sha256: "a4e1a099dc16f2b0a4d6bdc5fdf8f6ce622948ffec40f70bfc2743286a2b816b";
|
|
115
|
+
}, {
|
|
116
|
+
readonly id: "performance-evidence-schema";
|
|
117
|
+
readonly path: "spec/plugin/performance-evidence-v3.schema.json";
|
|
118
|
+
readonly version: "performance-evidence-v3";
|
|
119
|
+
readonly sha256: "a2f5e94071bb09a9327fc55ad3f6c39052b01c3e54cceb8b974dc244667a0326";
|
|
120
|
+
}, {
|
|
121
|
+
readonly id: "platform-package-publication-schema";
|
|
122
|
+
readonly path: "spec/plugin/platform-package-publication-v1.schema.json";
|
|
123
|
+
readonly version: "platform-package-publication-v1";
|
|
124
|
+
readonly sha256: "20450b516c34d5a122020f4064ddfa03ffcb97ffea661e0868cd09760b3f08b0";
|
|
125
|
+
}, {
|
|
126
|
+
readonly id: "platform-package-set-schema";
|
|
127
|
+
readonly path: "spec/plugin/platform-package-set-v1.schema.json";
|
|
128
|
+
readonly version: "platform-package-set-v1";
|
|
129
|
+
readonly sha256: "4d9979f5205ec047895b64c995312c588d998bb1c1448f6c9c559f1b7ab0d796";
|
|
130
|
+
}, {
|
|
131
|
+
readonly id: "plugin-platform-openapi";
|
|
132
|
+
readonly path: "spec/openapi/plugin-platform-v8.yaml";
|
|
133
|
+
readonly version: "plugin-platform-v8";
|
|
134
|
+
readonly sha256: "290883ff79b74badbf9f6feddb4dfbef820a4ef4622a7e3fca815e3abb2c4eac";
|
|
135
|
+
}, {
|
|
136
|
+
readonly id: "process-containment-schema";
|
|
137
|
+
readonly path: "spec/plugin/process-containment-v1.schema.json";
|
|
138
|
+
readonly version: "process-containment-v1";
|
|
139
|
+
readonly sha256: "930ea44b1f62361706e994649e84f62af0a6418b77a661ae9bf9c10f1398e3fc";
|
|
140
|
+
}, {
|
|
141
|
+
readonly id: "quarantine-cleanup-schema";
|
|
142
|
+
readonly path: "spec/plugin/quarantine-cleanup-v1.schema.json";
|
|
143
|
+
readonly version: "quarantine-cleanup-v1";
|
|
144
|
+
readonly sha256: "0aced01a8d409953d5075a799ac273cae79e285ac82debe93ac4d8b706571ad1";
|
|
145
|
+
}, {
|
|
146
|
+
readonly id: "release-metadata-schema";
|
|
147
|
+
readonly path: "spec/plugin/release-metadata-v5.schema.json";
|
|
148
|
+
readonly version: "release-metadata-v5";
|
|
149
|
+
readonly sha256: "255ef3deb7d2758a43e69e533a08aa28106f8edc2e7385ab0aec0d50c1ef3d7a";
|
|
150
|
+
}, {
|
|
151
|
+
readonly id: "release-revocation-pointer-schema";
|
|
152
|
+
readonly path: "spec/plugin/release-revocation-pointer-v1.schema.json";
|
|
153
|
+
readonly version: "release-revocation-pointer-v1";
|
|
154
|
+
readonly sha256: "a9b7b64cb2dbf89500f0d191a6b2b9ab42eb806a452eb8338895a48ec7d7551e";
|
|
155
|
+
}, {
|
|
156
|
+
readonly id: "release-revocation-schema";
|
|
157
|
+
readonly path: "spec/plugin/release-revocation-v2.schema.json";
|
|
158
|
+
readonly version: "release-revocation-v2";
|
|
159
|
+
readonly sha256: "c3b40c05bc0dea422a272ee62ca45d0efb6456278b0707c5a12f39b004b84cb4";
|
|
160
|
+
}, {
|
|
161
|
+
readonly id: "release-root-delegation-schema";
|
|
162
|
+
readonly path: "spec/plugin/release-root-delegation-v1.schema.json";
|
|
163
|
+
readonly version: "release-root-delegation-v1";
|
|
164
|
+
readonly sha256: "c1adbb13eaeeca145d5ee787ff43777e60a5f329e460d20b8db358e4f5fc4825";
|
|
165
|
+
}, {
|
|
166
|
+
readonly id: "release-signature-envelope-schema";
|
|
167
|
+
readonly path: "spec/plugin/release-signature-envelope-v1.schema.json";
|
|
168
|
+
readonly version: "release-signature-envelope-v1";
|
|
169
|
+
readonly sha256: "7df9afd22bfdebfa89dc3bdb46ecdbe22a91ecce35fa46c492dd9795c66fae29";
|
|
170
|
+
}, {
|
|
171
|
+
readonly id: "release-signing-ledger-evidence-schema";
|
|
172
|
+
readonly path: "spec/plugin/release-signing-ledger-evidence-v1.schema.json";
|
|
173
|
+
readonly version: "release-signing-ledger-evidence-v1";
|
|
174
|
+
readonly sha256: "9ab8b7f65dedcd119d578debb4f6ff97fc35f4c7ac95c0e5435f8b0959bc1a5c";
|
|
175
|
+
}, {
|
|
176
|
+
readonly id: "release-signing-ledger-receipt-schema";
|
|
177
|
+
readonly path: "spec/plugin/release-signing-ledger-receipt-v1.schema.json";
|
|
178
|
+
readonly version: "release-signing-ledger-receipt-v1";
|
|
179
|
+
readonly sha256: "29210cfefd967017c5c74bcf8489bd50511c5c9f36d17b0200056ccb90c30561";
|
|
180
|
+
}, {
|
|
181
|
+
readonly id: "release-signing-ledger-schema";
|
|
182
|
+
readonly path: "spec/plugin/release-signing-ledger-v1.schema.json";
|
|
183
|
+
readonly version: "release-signing-ledger-v1";
|
|
184
|
+
readonly sha256: "0c72b30bfd6b857b9809e48e1b7eaaeb7134d5afd6a935aa8373465054403765";
|
|
185
|
+
}, {
|
|
186
|
+
readonly id: "release-signing-subject-schema";
|
|
187
|
+
readonly path: "spec/plugin/release-signing-subject-v1.schema.json";
|
|
188
|
+
readonly version: "release-signing-subject-v1";
|
|
189
|
+
readonly sha256: "876b1459824f90042bd141e96bfea4633333bdf2a227e15b6e25c72db1179c8e";
|
|
190
|
+
}, {
|
|
191
|
+
readonly id: "release-source-policy-pointer-schema";
|
|
192
|
+
readonly path: "spec/plugin/release-source-policy-pointer-v1.schema.json";
|
|
193
|
+
readonly version: "release-source-policy-pointer-v1";
|
|
194
|
+
readonly sha256: "1a78cc3897ffbcdb605d2e9265d765207a4647d3f53fa5736aec65bf5f54e81c";
|
|
195
|
+
}, {
|
|
196
|
+
readonly id: "release-source-policy-schema";
|
|
197
|
+
readonly path: "spec/plugin/release-source-policy-v2.schema.json";
|
|
198
|
+
readonly version: "release-source-policy-v2";
|
|
199
|
+
readonly sha256: "6a5a5eab317a86beea925a611ca8a7a2d937547c039ce147b5993f69a5611237";
|
|
200
|
+
}, {
|
|
201
|
+
readonly id: "release-trust-state-schema";
|
|
202
|
+
readonly path: "spec/plugin/release-trust-state-v1.schema.json";
|
|
203
|
+
readonly version: "release-trust-state-v1";
|
|
204
|
+
readonly sha256: "19ffa182932a22401a33ee4c9921e957c67895c2d8b041c9a27ee3530bdfb2d2";
|
|
205
|
+
}, {
|
|
206
|
+
readonly id: "resource-scope-schema";
|
|
207
|
+
readonly path: "spec/plugin/resource-scope-v1.schema.json";
|
|
208
|
+
readonly version: "resource-scope-v1";
|
|
209
|
+
readonly sha256: "e6021bd576c7220ad5536645a7ad8e57ee7aeb9901c31a89444fa6b695d8dc6f";
|
|
210
|
+
}, {
|
|
211
|
+
readonly id: "runtime-admission-schema";
|
|
212
|
+
readonly path: "spec/plugin/runtime-admission-v1.schema.json";
|
|
213
|
+
readonly version: "runtime-admission-v1";
|
|
214
|
+
readonly sha256: "bee7b149876447d663a4099dbd71e71fa97f8ff80ddf4e12cbfba951a47c4beb";
|
|
215
|
+
}, {
|
|
216
|
+
readonly id: "runtime-descriptor-schema";
|
|
217
|
+
readonly path: "spec/plugin/runtime-descriptor-v2.schema.json";
|
|
218
|
+
readonly version: "runtime-descriptor-v2";
|
|
219
|
+
readonly sha256: "2ba59f6fb70d4ad757f60aca5541f4a44886542525e5bf76c393cd2368188351";
|
|
220
|
+
}, {
|
|
221
|
+
readonly id: "runtime-exec-journal-schema";
|
|
222
|
+
readonly path: "spec/plugin/runtime-exec-journal-v1.schema.json";
|
|
223
|
+
readonly version: "runtime-exec-journal-v1";
|
|
224
|
+
readonly sha256: "2bddbba383843b8ebc1554009909f0bb25e98616be763826a697cb0f408870d2";
|
|
225
|
+
}, {
|
|
226
|
+
readonly id: "rust-ipc-schema";
|
|
227
|
+
readonly path: "spec/plugin/ipc-v6.schema.json";
|
|
228
|
+
readonly version: "rust-ipc-v6";
|
|
229
|
+
readonly sha256: "9814ca091ac2e4e8435c1ab553e248e9d2e792de93ce9fd27bd030486774837f";
|
|
230
|
+
}, {
|
|
231
|
+
readonly id: "session-scope-schema";
|
|
232
|
+
readonly path: "spec/plugin/session-scope-v1.schema.json";
|
|
233
|
+
readonly version: "session-scope-v1";
|
|
234
|
+
readonly sha256: "3df0084264f0aff9fe2261c237cea439adb5cdc2534bfaaa0488d5992d4a7d2e";
|
|
235
|
+
}, {
|
|
236
|
+
readonly id: "target-classifier-fixture";
|
|
237
|
+
readonly path: "spec/plugin/target-classifier-v2.json";
|
|
238
|
+
readonly version: "target-classifier-v2";
|
|
239
|
+
readonly sha256: "ae7336cce77a2e820f96f1cc309b93f8442c932dcebec25e3890d31cd098e2d1";
|
|
240
|
+
}, {
|
|
241
|
+
readonly id: "token-ticket-schema";
|
|
242
|
+
readonly path: "spec/plugin/token-ticket-v4.schema.json";
|
|
243
|
+
readonly version: "token-ticket-v4";
|
|
244
|
+
readonly sha256: "5cf365b5b52a331ac0d3ad35a98be3c2ce668804ae88fdeaf9679a44db14feb1";
|
|
245
|
+
}, {
|
|
246
|
+
readonly id: "trusted-time-evidence-schema";
|
|
247
|
+
readonly path: "spec/plugin/trusted-time-evidence-v1.schema.json";
|
|
248
|
+
readonly version: "trusted-time-evidence-v1";
|
|
249
|
+
readonly sha256: "4398cbd2a3eea42a85008ee16a69d7adb265673e6749b1f13a4f1610f36e5e38";
|
|
250
|
+
}, {
|
|
251
|
+
readonly id: "trusted-time-leaf-schema";
|
|
252
|
+
readonly path: "spec/plugin/trusted-time-leaf-v1.schema.json";
|
|
253
|
+
readonly version: "trusted-time-leaf-v1";
|
|
254
|
+
readonly sha256: "1c25eb0040800eef145aa2bb4c0e1ae197ae584d365e9595ab89037e26fe5ddb";
|
|
255
|
+
}, {
|
|
256
|
+
readonly id: "wasm-worker-schema";
|
|
257
|
+
readonly path: "spec/plugin/wasm-worker-v2.schema.json";
|
|
258
|
+
readonly version: "redevplugin-wasm-worker-v2";
|
|
259
|
+
readonly sha256: "00bf123f3a9ed932de4b71c180e2a5c34af0f82050defb271fedec42cf217902";
|
|
260
|
+
}, {
|
|
261
|
+
readonly id: "worker-invocation-schema";
|
|
262
|
+
readonly path: "spec/plugin/worker-invocation-v3.schema.json";
|
|
263
|
+
readonly version: "worker-invocation-v3";
|
|
264
|
+
readonly sha256: "f08af491cbf5e7b71d1aeafbeac9ae581ee5fc3bcb76184daec369f94bab3927";
|
|
265
|
+
}];
|
|
266
|
+
};
|
|
267
|
+
export declare const packageSet: {
|
|
268
|
+
readonly schema_version: "redevplugin.platform_package_set.v1";
|
|
269
|
+
readonly platform_version: "0.6.5";
|
|
270
|
+
readonly go_module: {
|
|
271
|
+
readonly module: "github.com/floegence/redevplugin";
|
|
272
|
+
readonly version: "v0.6.5";
|
|
273
|
+
};
|
|
274
|
+
readonly npm_packages: readonly [{
|
|
275
|
+
readonly name: "@floegence/redevplugin-contracts";
|
|
276
|
+
readonly version: "0.6.5";
|
|
277
|
+
}, {
|
|
278
|
+
readonly name: "@floegence/redevplugin-ui";
|
|
279
|
+
readonly version: "0.6.5";
|
|
280
|
+
}];
|
|
281
|
+
readonly rust_crates: readonly [{
|
|
282
|
+
readonly name: "redevplugin-contracts";
|
|
283
|
+
readonly version: "0.6.5";
|
|
284
|
+
readonly role: "contracts";
|
|
285
|
+
}, {
|
|
286
|
+
readonly name: "redevplugin-ipc";
|
|
287
|
+
readonly version: "0.6.5";
|
|
288
|
+
readonly role: "ipc";
|
|
289
|
+
}, {
|
|
290
|
+
readonly name: "redevplugin-wasm-abi";
|
|
291
|
+
readonly version: "0.6.5";
|
|
292
|
+
readonly role: "wasm_abi";
|
|
293
|
+
}, {
|
|
294
|
+
readonly name: "redevplugin-target-classifier";
|
|
295
|
+
readonly version: "0.6.5";
|
|
296
|
+
readonly role: "target_classifier";
|
|
297
|
+
}, {
|
|
298
|
+
readonly name: "redevplugin-worker-sdk";
|
|
299
|
+
readonly version: "0.6.5";
|
|
300
|
+
readonly role: "worker_sdk";
|
|
301
|
+
}, {
|
|
302
|
+
readonly name: "redevplugin-runtime";
|
|
303
|
+
readonly version: "0.6.5";
|
|
304
|
+
readonly role: "runtime";
|
|
305
|
+
}];
|
|
306
|
+
readonly contract_registry_version: "contract-registry-v2";
|
|
307
|
+
readonly contract_set_sha256: "42768632672d3beef6410f0b87f53c8b124f1e56746bcc78beba52b6fd7da737";
|
|
308
|
+
};
|
|
309
|
+
export declare const contractSetSHA256: "42768632672d3beef6410f0b87f53c8b124f1e56746bcc78beba52b6fd7da737";
|
|
310
|
+
export declare function getContract(id: ContractID): Contract;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { generatedContractArtifacts, generatedContractRegistry, generatedContractSetSHA256, generatedPackageSet, generatedRegistryContract, } from "./contracts.gen.js";
|
|
2
|
+
export * from "./release-signing.js";
|
|
3
|
+
export class UnknownContractError extends RangeError {
|
|
4
|
+
id;
|
|
5
|
+
constructor(id) {
|
|
6
|
+
super(`contract id ${JSON.stringify(id)} is unknown`);
|
|
7
|
+
this.name = "UnknownContractError";
|
|
8
|
+
this.id = id;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function deepFreeze(value) {
|
|
12
|
+
if (value !== null && typeof value === "object" && !Object.isFrozen(value)) {
|
|
13
|
+
for (const nested of Object.values(value))
|
|
14
|
+
deepFreeze(nested);
|
|
15
|
+
Object.freeze(value);
|
|
16
|
+
}
|
|
17
|
+
return value;
|
|
18
|
+
}
|
|
19
|
+
export const contractArtifacts = deepFreeze(generatedContractArtifacts);
|
|
20
|
+
export const registryContract = deepFreeze(generatedRegistryContract);
|
|
21
|
+
export const contractRegistry = deepFreeze(generatedContractRegistry);
|
|
22
|
+
export const packageSet = deepFreeze(generatedPackageSet);
|
|
23
|
+
export const contractSetSHA256 = generatedContractSetSHA256;
|
|
24
|
+
const contractsByID = new Map();
|
|
25
|
+
for (const contract of contractArtifacts)
|
|
26
|
+
contractsByID.set(contract.id, contract);
|
|
27
|
+
contractsByID.set(registryContract.id, registryContract);
|
|
28
|
+
export function getContract(id) {
|
|
29
|
+
const contract = contractsByID.get(id);
|
|
30
|
+
if (contract === undefined)
|
|
31
|
+
throw new UnknownContractError(id);
|
|
32
|
+
return contract;
|
|
33
|
+
}
|