@misofm/platform 0.25.0 → 0.26.0
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/README.md +144 -45
- package/dist/auth.d.ts +8 -13
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +78 -59
- package/dist/auth.js.map +1 -1
- package/dist/catalog.d.ts +5 -5
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +33 -21
- package/dist/catalog.js.map +1 -1
- package/dist/client.d.ts +17 -30
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +53 -75
- package/dist/client.js.map +1 -1
- package/dist/cover.d.ts +4 -3
- package/dist/cover.d.ts.map +1 -1
- package/dist/cover.js +28 -17
- package/dist/cover.js.map +1 -1
- package/dist/credits.d.ts +12 -10
- package/dist/credits.d.ts.map +1 -1
- package/dist/credits.js +60 -33
- package/dist/credits.js.map +1 -1
- package/dist/deployments.d.ts +21 -13
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +84 -37
- package/dist/deployments.js.map +1 -1
- package/dist/errors.d.ts +91 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +111 -0
- package/dist/errors.js.map +1 -0
- package/dist/execute.d.ts +3 -1
- package/dist/execute.d.ts.map +1 -1
- package/dist/execute.js +9 -4
- package/dist/execute.js.map +1 -1
- package/dist/genre.d.ts +25 -41
- package/dist/genre.d.ts.map +1 -1
- package/dist/genre.js +71 -20
- package/dist/genre.js.map +1 -1
- package/dist/party/client.d.ts +16 -13
- package/dist/party/client.d.ts.map +1 -1
- package/dist/party/client.js +33 -22
- package/dist/party/client.js.map +1 -1
- package/dist/party/extensions/links.d.ts +2 -1
- package/dist/party/extensions/links.d.ts.map +1 -1
- package/dist/party/extensions/links.js +2 -1
- package/dist/party/extensions/links.js.map +1 -1
- package/dist/party/queries.d.ts +12 -11
- package/dist/party/queries.d.ts.map +1 -1
- package/dist/party/queries.js +63 -57
- package/dist/party/queries.js.map +1 -1
- package/dist/party/types.d.ts +31 -20
- package/dist/party/types.d.ts.map +1 -1
- package/dist/party/types.js +82 -1
- package/dist/party/types.js.map +1 -1
- package/dist/pressing.d.ts +55 -35
- package/dist/pressing.d.ts.map +1 -1
- package/dist/pressing.js +99 -76
- package/dist/pressing.js.map +1 -1
- package/dist/queries.d.ts +1 -1
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +5 -4
- package/dist/queries.js.map +1 -1
- package/dist/read/artist.d.ts +6 -4
- package/dist/read/artist.d.ts.map +1 -1
- package/dist/read/artist.js +29 -27
- package/dist/read/artist.js.map +1 -1
- package/dist/read/catalog.d.ts +20 -17
- package/dist/read/catalog.d.ts.map +1 -1
- package/dist/read/catalog.js +120 -141
- package/dist/read/catalog.js.map +1 -1
- package/dist/read/client.d.ts +10 -9
- package/dist/read/client.d.ts.map +1 -1
- package/dist/read/client.js.map +1 -1
- package/dist/read/genres.d.ts +5 -3
- package/dist/read/genres.d.ts.map +1 -1
- package/dist/read/genres.js +18 -15
- package/dist/read/genres.js.map +1 -1
- package/dist/read/index.d.ts.map +1 -1
- package/dist/read/index.js +7 -1
- package/dist/read/index.js.map +1 -1
- package/dist/read/receipts.d.ts +15 -6
- package/dist/read/receipts.d.ts.map +1 -1
- package/dist/read/receipts.js +73 -60
- package/dist/read/receipts.js.map +1 -1
- package/dist/read/wallet.d.ts +11 -9
- package/dist/read/wallet.d.ts.map +1 -1
- package/dist/read/wallet.js +117 -132
- package/dist/read/wallet.js.map +1 -1
- package/dist/read/works.d.ts +9 -16
- package/dist/read/works.d.ts.map +1 -1
- package/dist/read/works.js +48 -117
- package/dist/read/works.js.map +1 -1
- package/dist/recording-extensions.d.ts +8 -7
- package/dist/recording-extensions.d.ts.map +1 -1
- package/dist/recording-extensions.js +30 -63
- package/dist/recording-extensions.js.map +1 -1
- package/dist/release-extensions.d.ts +3 -2
- package/dist/release-extensions.d.ts.map +1 -1
- package/dist/release-extensions.js +9 -10
- package/dist/release-extensions.js.map +1 -1
- package/dist/royalty.d.ts +51 -51
- package/dist/royalty.d.ts.map +1 -1
- package/dist/royalty.js +93 -11
- package/dist/royalty.js.map +1 -1
- package/dist/share.d.ts +7 -6
- package/dist/share.d.ts.map +1 -1
- package/dist/share.js +37 -30
- package/dist/share.js.map +1 -1
- package/dist/vault.d.ts +20 -8
- package/dist/vault.d.ts.map +1 -1
- package/dist/vault.js +31 -15
- package/dist/vault.js.map +1 -1
- package/package.json +11 -4
- package/src/auth.ts +89 -70
- package/src/catalog.ts +33 -49
- package/src/client.ts +117 -97
- package/src/cover.ts +17 -26
- package/src/credits.ts +43 -75
- package/src/deployments.ts +103 -69
- package/src/errors.ts +156 -0
- package/src/execute.ts +10 -6
- package/src/genre.ts +38 -23
- package/src/party/client.ts +35 -23
- package/src/party/extensions/links.ts +3 -2
- package/src/party/queries.ts +77 -65
- package/src/party/types.ts +52 -48
- package/src/pressing.ts +158 -161
- package/src/queries.ts +5 -5
- package/src/read/artist.ts +47 -42
- package/src/read/catalog.ts +200 -223
- package/src/read/client.ts +12 -11
- package/src/read/genres.ts +24 -16
- package/src/read/index.ts +7 -1
- package/src/read/receipts.ts +128 -67
- package/src/read/wallet.ts +194 -162
- package/src/read/works.ts +75 -194
- package/src/recording-extensions.ts +38 -92
- package/src/release-extensions.ts +7 -12
- package/src/royalty.ts +117 -20
- package/src/share.ts +44 -29
- package/src/vault.ts +47 -24
package/dist/deployments.js
CHANGED
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
import { MISO_DEPLOYMENTS } from "@misofm/musicos/deployments";
|
|
4
4
|
import { PARTYOS_DEPLOYMENTS } from "@misofm/partyos/deployments";
|
|
5
5
|
import { normalizeSuiAddress, normalizeSuiObjectId } from "@mysten/sui/utils";
|
|
6
|
+
import { Context, Effect, Layer } from "effect";
|
|
7
|
+
import { DeploymentError } from "@misofm/effect/errors";
|
|
6
8
|
import { immutableSnapshot } from "./internal.js";
|
|
9
|
+
import { MisoPlatformDeploymentInvalidError, OperationsUnavailableError, RecordSalesUnavailableError, } from "./errors.js";
|
|
10
|
+
export { MisoPlatformDeploymentInvalidError, OperationsUnavailableError, RecordSalesUnavailableError, } from "./errors.js";
|
|
7
11
|
/** Every package address a platform deployment must supply, for canonical-id
|
|
8
12
|
* and pairwise-distinctness validation in {@link assertMisoPlatformDeployment}. */
|
|
9
13
|
const REQUIRED_PLATFORM_PACKAGE_KEYS = [
|
|
@@ -43,17 +47,11 @@ const REQUIRED_PARTY_PACKAGE_KEYS = [
|
|
|
43
47
|
"countryCode",
|
|
44
48
|
"languageCode",
|
|
45
49
|
];
|
|
46
|
-
export class RecordSalesUnavailableError extends Error {
|
|
47
|
-
reason;
|
|
48
|
-
name = "RecordSalesUnavailableError";
|
|
49
|
-
constructor(reason) {
|
|
50
|
-
super(`@misofm/platform: Record sales are unavailable: ${reason}`);
|
|
51
|
-
this.reason = reason;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
50
|
export function requireRecordSalesDeployment(deployment) {
|
|
55
51
|
if (!deployment || deployment.status === "unavailable") {
|
|
56
|
-
throw new RecordSalesUnavailableError(
|
|
52
|
+
throw new RecordSalesUnavailableError({
|
|
53
|
+
reason: deployment?.reason ?? "no Record sales deployment was configured",
|
|
54
|
+
});
|
|
57
55
|
}
|
|
58
56
|
const canonicalPackageId = (value) => {
|
|
59
57
|
if (!/^0x[0-9a-f]{64}$/.test(value))
|
|
@@ -67,21 +65,17 @@ export function requireRecordSalesDeployment(deployment) {
|
|
|
67
65
|
};
|
|
68
66
|
if (!canonicalPackageId(deployment.recordPackageId) ||
|
|
69
67
|
!canonicalPackageId(deployment.recordShopPackageId)) {
|
|
70
|
-
throw new RecordSalesUnavailableError(
|
|
68
|
+
throw new RecordSalesUnavailableError({
|
|
69
|
+
reason: "Record and Record Shop package IDs must be canonical 32-byte Sui object IDs",
|
|
70
|
+
});
|
|
71
71
|
}
|
|
72
72
|
if (deployment.recordPackageId === deployment.recordShopPackageId) {
|
|
73
|
-
throw new RecordSalesUnavailableError(
|
|
73
|
+
throw new RecordSalesUnavailableError({
|
|
74
|
+
reason: "Record and Record Shop package IDs must be distinct",
|
|
75
|
+
});
|
|
74
76
|
}
|
|
75
77
|
return deployment;
|
|
76
78
|
}
|
|
77
|
-
export class OperationsUnavailableError extends Error {
|
|
78
|
-
reason;
|
|
79
|
-
name = "OperationsUnavailableError";
|
|
80
|
-
constructor(reason) {
|
|
81
|
-
super(`@misofm/platform: Vault operations are unavailable: ${reason}`);
|
|
82
|
-
this.reason = reason;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
79
|
function canonicalObjectId(value) {
|
|
86
80
|
if (typeof value !== "string" || !/^0x[0-9a-f]{64}$/.test(value)) {
|
|
87
81
|
return false;
|
|
@@ -103,7 +97,9 @@ function canonicalObjectId(value) {
|
|
|
103
97
|
*/
|
|
104
98
|
export function requireOperationsDeployment(deployment) {
|
|
105
99
|
if (!deployment || deployment.status !== "available") {
|
|
106
|
-
throw new OperationsUnavailableError(
|
|
100
|
+
throw new OperationsUnavailableError({
|
|
101
|
+
reason: deployment?.reason ?? "no Vault operations deployment was configured",
|
|
102
|
+
});
|
|
107
103
|
}
|
|
108
104
|
const candidate = deployment;
|
|
109
105
|
const vault = candidate.vault;
|
|
@@ -122,24 +118,27 @@ export function requireOperationsDeployment(deployment) {
|
|
|
122
118
|
];
|
|
123
119
|
for (const [field, id] of packageEntries) {
|
|
124
120
|
if (!canonicalObjectId(id)) {
|
|
125
|
-
throw new OperationsUnavailableError(
|
|
121
|
+
throw new OperationsUnavailableError({
|
|
122
|
+
reason: `${field} must be a canonical 32-byte Sui package ID`,
|
|
123
|
+
});
|
|
126
124
|
}
|
|
127
125
|
}
|
|
128
126
|
if (!canonicalObjectId(vault?.registryId)) {
|
|
129
|
-
throw new OperationsUnavailableError(
|
|
127
|
+
throw new OperationsUnavailableError({
|
|
128
|
+
reason: "vault.registryId must be a canonical 32-byte Sui object ID",
|
|
129
|
+
});
|
|
130
130
|
}
|
|
131
131
|
const identities = [
|
|
132
132
|
...packageEntries.map(([, id]) => id),
|
|
133
133
|
vault.registryId,
|
|
134
134
|
];
|
|
135
135
|
if (new Set(identities).size !== identities.length) {
|
|
136
|
-
throw new OperationsUnavailableError(
|
|
136
|
+
throw new OperationsUnavailableError({
|
|
137
|
+
reason: `the Vault registry object and all ${packageEntries.length} package IDs must be distinct`,
|
|
138
|
+
});
|
|
137
139
|
}
|
|
138
140
|
return deployment;
|
|
139
141
|
}
|
|
140
|
-
export class MisoPlatformDeploymentInvalidError extends Error {
|
|
141
|
-
name = "MisoPlatformDeploymentInvalidError";
|
|
142
|
-
}
|
|
143
142
|
/**
|
|
144
143
|
* Validates the `packages` and `party` package-id sets before any Move target
|
|
145
144
|
* is constructed from them: every required id must be a canonical 32-byte Sui
|
|
@@ -149,20 +148,28 @@ export class MisoPlatformDeploymentInvalidError extends Error {
|
|
|
149
148
|
*/
|
|
150
149
|
export function assertMisoPlatformDeployment(deployment) {
|
|
151
150
|
if (!deployment || typeof deployment !== "object" || Array.isArray(deployment)) {
|
|
152
|
-
throw new MisoPlatformDeploymentInvalidError(
|
|
151
|
+
throw new MisoPlatformDeploymentInvalidError({
|
|
152
|
+
message: "@misofm/platform: deployment must be a complete MisoPlatformDeployment object.",
|
|
153
|
+
});
|
|
153
154
|
}
|
|
154
155
|
const candidate = deployment;
|
|
155
156
|
const packages = candidate.packages;
|
|
156
157
|
const party = candidate.party;
|
|
157
158
|
const partyos = candidate.partyos;
|
|
158
159
|
if (!packages || typeof packages !== "object") {
|
|
159
|
-
throw new MisoPlatformDeploymentInvalidError(
|
|
160
|
+
throw new MisoPlatformDeploymentInvalidError({
|
|
161
|
+
message: "@misofm/platform: deployment is missing its `packages` section.",
|
|
162
|
+
});
|
|
160
163
|
}
|
|
161
164
|
if (!party || typeof party !== "object") {
|
|
162
|
-
throw new MisoPlatformDeploymentInvalidError(
|
|
165
|
+
throw new MisoPlatformDeploymentInvalidError({
|
|
166
|
+
message: "@misofm/platform: deployment is missing its `party` section.",
|
|
167
|
+
});
|
|
163
168
|
}
|
|
164
169
|
if (!partyos || typeof partyos !== "object") {
|
|
165
|
-
throw new MisoPlatformDeploymentInvalidError(
|
|
170
|
+
throw new MisoPlatformDeploymentInvalidError({
|
|
171
|
+
message: "@misofm/platform: deployment is missing its `partyos` section.",
|
|
172
|
+
});
|
|
166
173
|
}
|
|
167
174
|
const seenPackageIds = new Set();
|
|
168
175
|
/** `dedupeOk` lets `party.countryCode`/`party.languageCode` intentionally
|
|
@@ -172,22 +179,30 @@ export function assertMisoPlatformDeployment(deployment) {
|
|
|
172
179
|
* manifest. */
|
|
173
180
|
const checkCanonical = (field, packageId, dedupeOk = false) => {
|
|
174
181
|
if (typeof packageId !== "string") {
|
|
175
|
-
throw new MisoPlatformDeploymentInvalidError(
|
|
182
|
+
throw new MisoPlatformDeploymentInvalidError({
|
|
183
|
+
message: `@misofm/platform: deployment is missing package ID for "${field}".`,
|
|
184
|
+
});
|
|
176
185
|
}
|
|
177
186
|
let normalized;
|
|
178
187
|
try {
|
|
179
188
|
normalized = normalizeSuiAddress(packageId);
|
|
180
189
|
}
|
|
181
190
|
catch {
|
|
182
|
-
throw new MisoPlatformDeploymentInvalidError(
|
|
191
|
+
throw new MisoPlatformDeploymentInvalidError({
|
|
192
|
+
message: `@misofm/platform: deployment package ID for "${field}" is not a valid Sui address.`,
|
|
193
|
+
});
|
|
183
194
|
}
|
|
184
195
|
if (packageId !== normalized) {
|
|
185
|
-
throw new MisoPlatformDeploymentInvalidError(
|
|
196
|
+
throw new MisoPlatformDeploymentInvalidError({
|
|
197
|
+
message: `@misofm/platform: deployment package ID for "${field}" must be normalized (${normalized}).`,
|
|
198
|
+
});
|
|
186
199
|
}
|
|
187
200
|
if (!dedupeOk) {
|
|
188
201
|
if (seenPackageIds.has(packageId)) {
|
|
189
|
-
throw new MisoPlatformDeploymentInvalidError(
|
|
190
|
-
|
|
202
|
+
throw new MisoPlatformDeploymentInvalidError({
|
|
203
|
+
message: `@misofm/platform: deployment package ID for "${field}" duplicates another package. ` +
|
|
204
|
+
"Every package in a deployment manifest must have its own address.",
|
|
205
|
+
});
|
|
191
206
|
}
|
|
192
207
|
seenPackageIds.add(packageId);
|
|
193
208
|
}
|
|
@@ -202,10 +217,14 @@ export function assertMisoPlatformDeployment(deployment) {
|
|
|
202
217
|
checkCanonical(`party.${key}`, party[key], key === "countryCode" || key === "languageCode");
|
|
203
218
|
}
|
|
204
219
|
if (party.countryCode !== packages.countryCode) {
|
|
205
|
-
throw new MisoPlatformDeploymentInvalidError(
|
|
220
|
+
throw new MisoPlatformDeploymentInvalidError({
|
|
221
|
+
message: "@misofm/platform: party.countryCode must match packages.countryCode (the same shared dependency package).",
|
|
222
|
+
});
|
|
206
223
|
}
|
|
207
224
|
if (party.languageCode !== packages.languageCode) {
|
|
208
|
-
throw new MisoPlatformDeploymentInvalidError(
|
|
225
|
+
throw new MisoPlatformDeploymentInvalidError({
|
|
226
|
+
message: "@misofm/platform: party.languageCode must match packages.languageCode (the same shared dependency package).",
|
|
227
|
+
});
|
|
209
228
|
}
|
|
210
229
|
}
|
|
211
230
|
/** Validate and snapshot an untrusted manifest so later caller mutation is inert. */
|
|
@@ -309,4 +328,32 @@ export function getMisoPlatformDeployment(network) {
|
|
|
309
328
|
}
|
|
310
329
|
return deployment;
|
|
311
330
|
}
|
|
331
|
+
/** Effect-returning `assertMisoPlatformDeployment`: validation failure becomes a typed `DeploymentError`. */
|
|
332
|
+
export function validateMisoPlatformDeployment(deployment) {
|
|
333
|
+
return Effect.try({
|
|
334
|
+
try: () => normalizeMisoPlatformDeployment(deployment),
|
|
335
|
+
catch: (cause) => new DeploymentError({
|
|
336
|
+
message: cause instanceof Error ? cause.message : String(cause),
|
|
337
|
+
}),
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* The platform deployment manifest as a service, so the deployment-aware
|
|
342
|
+
* platform reads and PTB builders (notably {@link Genre.derive}, which needs
|
|
343
|
+
* the genre registry + package ids) can declare it in `R` instead of taking it
|
|
344
|
+
* as an explicit parameter. `MisoPlatformClient`/`misoPlatform()` provide this
|
|
345
|
+
* layer internally; a bare read composed from `queries.ts` functions must
|
|
346
|
+
* provide it explicitly, e.g.
|
|
347
|
+
* `program.pipe(Effect.provide(PlatformDeployment.layer(deployment)))`.
|
|
348
|
+
*/
|
|
349
|
+
export class PlatformDeployment extends Context.Service()("@misofm/platform/PlatformDeployment") {
|
|
350
|
+
/** Provides a concrete, already-validated `MisoPlatformDeployment` as the service. */
|
|
351
|
+
static layer(deployment) {
|
|
352
|
+
return Layer.succeed(PlatformDeployment, deployment);
|
|
353
|
+
}
|
|
354
|
+
/** Resolves a bundled deployment for `network` and provides it as the service; fails closed for unknown networks. */
|
|
355
|
+
static fromNetwork(network) {
|
|
356
|
+
return PlatformDeployment.layer(getMisoPlatformDeployment(network));
|
|
357
|
+
}
|
|
358
|
+
}
|
|
312
359
|
//# sourceMappingURL=deployments.js.map
|
package/dist/deployments.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployments.js","sourceRoot":"","sources":["../src/deployments.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AAGtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"deployments.js","sourceRoot":"","sources":["../src/deployments.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AAGtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAA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CAAC;QAChB,MAAM,IAAI,KAAK,CACb,sEAAsE,OAAO,KAAK;YAChF,4DAA4D,CAC/D,CAAC;IACJ,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,6GAA6G;AAC7G,MAAM,UAAU,8BAA8B,CAC5C,UAAmB;IAEnB,OAAO,MAAM,CAAC,GAAG,CAAC;QAChB,GAAG,EAAE,GAAG,EAAE,CAAC,+BAA+B,CAAC,UAAU,CAAC;QACtD,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CACf,IAAI,eAAe,CAAC;YAClB,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;SAChE,CAAC;KACL,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,OAAO,kBAAmB,SAAQ,OAAO,CAAC,OAAO,EAA8C,CACnG,qCAAqC,CACtC;IACC,sFAAsF;IACtF,MAAM,CAAC,KAAK,CAAC,UAAkC;QAC7C,OAAO,KAAK,CAAC,OAAO,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;IACvD,CAAC;IAED,qHAAqH;IACrH,MAAM,CAAC,WAAW,CAAC,OAAe;QAChC,OAAO,kBAAkB,CAAC,KAAK,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC,CAAC;IACtE,CAAC;CACF"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export { BcsDecodeError, DeploymentError, GraphQLUnavailableError, ObjectNotFoundError, ObjectTypeMismatchError, SuiRpcError, TransactionFailedError, type SuiReadError, } from "@misofm/effect/errors";
|
|
3
|
+
declare const RecordSalesUnavailableError_base: Schema.Class<RecordSalesUnavailableError, Schema.TaggedStruct<"RecordSalesUnavailableError", {
|
|
4
|
+
readonly reason: Schema.String;
|
|
5
|
+
}>, import("effect/Cause").YieldableError>;
|
|
6
|
+
/** Record sales (Record + Record Shop) are unavailable on this deployment. */
|
|
7
|
+
export declare class RecordSalesUnavailableError extends RecordSalesUnavailableError_base {
|
|
8
|
+
get message(): string;
|
|
9
|
+
}
|
|
10
|
+
declare const OperationsUnavailableError_base: Schema.Class<OperationsUnavailableError, Schema.TaggedStruct<"OperationsUnavailableError", {
|
|
11
|
+
readonly reason: Schema.String;
|
|
12
|
+
}>, import("effect/Cause").YieldableError>;
|
|
13
|
+
/** Vault/Action/plugin operations are unavailable on this deployment. */
|
|
14
|
+
export declare class OperationsUnavailableError extends OperationsUnavailableError_base {
|
|
15
|
+
get message(): string;
|
|
16
|
+
}
|
|
17
|
+
declare const MisoPlatformDeploymentInvalidError_base: Schema.Class<MisoPlatformDeploymentInvalidError, Schema.TaggedStruct<"MisoPlatformDeploymentInvalidError", {
|
|
18
|
+
readonly message: Schema.String;
|
|
19
|
+
}>, import("effect/Cause").YieldableError>;
|
|
20
|
+
/** A caller-supplied `MisoPlatformDeployment` manifest failed structural validation. */
|
|
21
|
+
export declare class MisoPlatformDeploymentInvalidError extends MisoPlatformDeploymentInvalidError_base {
|
|
22
|
+
}
|
|
23
|
+
declare const MisoNetworkMismatchError_base: Schema.Class<MisoNetworkMismatchError, Schema.TaggedStruct<"MisoNetworkMismatchError", {
|
|
24
|
+
readonly clientNetwork: Schema.String;
|
|
25
|
+
readonly deploymentNetwork: Schema.String;
|
|
26
|
+
}>, import("effect/Cause").YieldableError>;
|
|
27
|
+
/** The connected client's network does not match the configured deployment's network. */
|
|
28
|
+
export declare class MisoNetworkMismatchError extends MisoNetworkMismatchError_base {
|
|
29
|
+
get message(): string;
|
|
30
|
+
}
|
|
31
|
+
declare const MisoChainIdentifierMismatchError_base: Schema.Class<MisoChainIdentifierMismatchError, Schema.TaggedStruct<"MisoChainIdentifierMismatchError", {
|
|
32
|
+
readonly actual: Schema.String;
|
|
33
|
+
readonly expected: Schema.String;
|
|
34
|
+
}>, import("effect/Cause").YieldableError>;
|
|
35
|
+
/** The connected endpoint's chain identifier does not match the configured deployment's. */
|
|
36
|
+
export declare class MisoChainIdentifierMismatchError extends MisoChainIdentifierMismatchError_base {
|
|
37
|
+
get message(): string;
|
|
38
|
+
}
|
|
39
|
+
declare const MisoClientNotReadyError_base: Schema.Class<MisoClientNotReadyError, Schema.TaggedStruct<"MisoClientNotReadyError", {
|
|
40
|
+
readonly operation: Schema.String;
|
|
41
|
+
}>, import("effect/Cause").YieldableError>;
|
|
42
|
+
/** A method that requires the exact-chain validation lifecycle was called before `ready()`. */
|
|
43
|
+
export declare class MisoClientNotReadyError extends MisoClientNotReadyError_base {
|
|
44
|
+
get message(): string;
|
|
45
|
+
}
|
|
46
|
+
declare const MalformedRecordSoldEventError_base: Schema.Class<MalformedRecordSoldEventError, Schema.TaggedStruct<"MalformedRecordSoldEventError", {
|
|
47
|
+
readonly digest: Schema.optional<Schema.String>;
|
|
48
|
+
readonly reason: Schema.optional<Schema.String>;
|
|
49
|
+
}>, import("effect/Cause").YieldableError>;
|
|
50
|
+
/** An on-chain `RecordSoldEvent` could not be decoded into a `RecordSale`. */
|
|
51
|
+
export declare class MalformedRecordSoldEventError extends MalformedRecordSoldEventError_base {
|
|
52
|
+
}
|
|
53
|
+
/** Authenticated-fetch / API-authorization signing or verification failure. */
|
|
54
|
+
export declare const MisoAuthErrorCode: Schema.Literals<readonly ["invalid_target", "challenge_rejected", "invalid_challenge", "signing_failed"]>;
|
|
55
|
+
export type MisoAuthErrorCode = typeof MisoAuthErrorCode.Type;
|
|
56
|
+
declare const MisoAuthError_base: Schema.Class<MisoAuthError, Schema.TaggedStruct<"MisoAuthError", {
|
|
57
|
+
readonly code: Schema.Literals<readonly ["invalid_target", "challenge_rejected", "invalid_challenge", "signing_failed"]>;
|
|
58
|
+
readonly reason: Schema.String;
|
|
59
|
+
readonly status: Schema.optional<Schema.Number>;
|
|
60
|
+
readonly cause: Schema.optional<Schema.Defect>;
|
|
61
|
+
}>, import("effect/Cause").YieldableError>;
|
|
62
|
+
export declare class MisoAuthError extends MisoAuthError_base {
|
|
63
|
+
get message(): string;
|
|
64
|
+
}
|
|
65
|
+
declare const ReleaseNotFoundError_base: Schema.Class<ReleaseNotFoundError, Schema.TaggedStruct<"ReleaseNotFoundError", {
|
|
66
|
+
readonly releaseId: Schema.String;
|
|
67
|
+
}>, import("effect/Cause").YieldableError>;
|
|
68
|
+
/** No Release exists at the requested id (or it is not a Release from the configured deployment). */
|
|
69
|
+
export declare class ReleaseNotFoundError extends ReleaseNotFoundError_base {
|
|
70
|
+
}
|
|
71
|
+
declare const ReceiptNotFoundError_base: Schema.Class<ReceiptNotFoundError, Schema.TaggedStruct<"ReceiptNotFoundError", {
|
|
72
|
+
readonly digest: Schema.String;
|
|
73
|
+
}>, import("effect/Cause").YieldableError>;
|
|
74
|
+
/** The fullnode and the indexer both have no record of this transaction digest. */
|
|
75
|
+
export declare class ReceiptNotFoundError extends ReceiptNotFoundError_base {
|
|
76
|
+
}
|
|
77
|
+
declare const RecordPurchaseNotFoundError_base: Schema.Class<RecordPurchaseNotFoundError, Schema.TaggedStruct<"RecordPurchaseNotFoundError", {
|
|
78
|
+
readonly digest: Schema.String;
|
|
79
|
+
}>, import("effect/Cause").YieldableError>;
|
|
80
|
+
/** The transaction exists, but its effects contain no `record_shop::listing::RecordSoldEvent`. */
|
|
81
|
+
export declare class RecordPurchaseNotFoundError extends RecordPurchaseNotFoundError_base {
|
|
82
|
+
}
|
|
83
|
+
declare const ForeignPressingError_base: Schema.Class<ForeignPressingError, Schema.TaggedStruct<"ForeignPressingError", {
|
|
84
|
+
readonly pressingId: Schema.String;
|
|
85
|
+
readonly actualType: Schema.optional<Schema.String>;
|
|
86
|
+
}>, import("effect/Cause").YieldableError>;
|
|
87
|
+
/** An object exists at the requested Pressing id, but is not a Pressing from the configured Record package. */
|
|
88
|
+
export declare class ForeignPressingError extends ForeignPressingError_base {
|
|
89
|
+
get message(): string;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingUR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AExC;CAAG;;;;AAEL,kGAAkG;AAClG,qBAAa,2BAA4B,SAAQ,gCAKhD;CAAG;;;;;AAEJ,+GAA+G;AAC/G,qBAAa,oBAAqB,SAAQ,yBAGxC;IACA,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// Copyright (c) Miso Labs, Inc.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
// The platform-specific error vocabulary, built on the shared foundation
|
|
4
|
+
// (`@misofm/effect/errors`). Every failure a caller might need to act on is a
|
|
5
|
+
// `Schema.TaggedError` carrying the fields needed to act; `isNotFound`-style
|
|
6
|
+
// message sniffing is replaced by `Effect.catchTag` against these tags.
|
|
7
|
+
import { Schema } from "effect";
|
|
8
|
+
// Re-export the foundation vocabulary so a platform consumer never needs a
|
|
9
|
+
// second import for the errors platform reads/executes surface directly.
|
|
10
|
+
export { BcsDecodeError, DeploymentError, GraphQLUnavailableError, ObjectNotFoundError, ObjectTypeMismatchError, SuiRpcError, TransactionFailedError, } from "@misofm/effect/errors";
|
|
11
|
+
/** Record sales (Record + Record Shop) are unavailable on this deployment. */
|
|
12
|
+
export class RecordSalesUnavailableError extends Schema.TaggedError()("RecordSalesUnavailableError", {
|
|
13
|
+
reason: Schema.String,
|
|
14
|
+
}) {
|
|
15
|
+
get message() {
|
|
16
|
+
return `@misofm/platform: Record sales are unavailable: ${this.reason}`;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/** Vault/Action/plugin operations are unavailable on this deployment. */
|
|
20
|
+
export class OperationsUnavailableError extends Schema.TaggedError()("OperationsUnavailableError", {
|
|
21
|
+
reason: Schema.String,
|
|
22
|
+
}) {
|
|
23
|
+
get message() {
|
|
24
|
+
return `@misofm/platform: Vault operations are unavailable: ${this.reason}`;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/** A caller-supplied `MisoPlatformDeployment` manifest failed structural validation. */
|
|
28
|
+
export class MisoPlatformDeploymentInvalidError extends Schema.TaggedError()("MisoPlatformDeploymentInvalidError", {
|
|
29
|
+
message: Schema.String,
|
|
30
|
+
}) {
|
|
31
|
+
}
|
|
32
|
+
/** The connected client's network does not match the configured deployment's network. */
|
|
33
|
+
export class MisoNetworkMismatchError extends Schema.TaggedError()("MisoNetworkMismatchError", {
|
|
34
|
+
clientNetwork: Schema.String,
|
|
35
|
+
deploymentNetwork: Schema.String,
|
|
36
|
+
}) {
|
|
37
|
+
get message() {
|
|
38
|
+
return `@misofm/platform: client network "${this.clientNetwork}" does not match deployment network "${this.deploymentNetwork}"`;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/** The connected endpoint's chain identifier does not match the configured deployment's. */
|
|
42
|
+
export class MisoChainIdentifierMismatchError extends Schema.TaggedError()("MisoChainIdentifierMismatchError", {
|
|
43
|
+
actual: Schema.String,
|
|
44
|
+
expected: Schema.String,
|
|
45
|
+
}) {
|
|
46
|
+
get message() {
|
|
47
|
+
return `@misofm/platform: endpoint chain identifier "${this.actual}" does not match deployment chain identifier "${this.expected}"`;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/** A method that requires the exact-chain validation lifecycle was called before `ready()`. */
|
|
51
|
+
export class MisoClientNotReadyError extends Schema.TaggedError()("MisoClientNotReadyError", {
|
|
52
|
+
operation: Schema.String,
|
|
53
|
+
}) {
|
|
54
|
+
get message() {
|
|
55
|
+
return `@misofm/platform: ${this.operation} requires an exact-chain validation lifecycle; call and await client.miso.ready() first`;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/** An on-chain `RecordSoldEvent` could not be decoded into a `RecordSale`. */
|
|
59
|
+
export class MalformedRecordSoldEventError extends Schema.TaggedError()("MalformedRecordSoldEventError", {
|
|
60
|
+
digest: Schema.optional(Schema.String),
|
|
61
|
+
reason: Schema.optional(Schema.String),
|
|
62
|
+
}) {
|
|
63
|
+
}
|
|
64
|
+
/** Authenticated-fetch / API-authorization signing or verification failure. */
|
|
65
|
+
export const MisoAuthErrorCode = Schema.Literals([
|
|
66
|
+
"invalid_target",
|
|
67
|
+
"challenge_rejected",
|
|
68
|
+
"invalid_challenge",
|
|
69
|
+
"signing_failed",
|
|
70
|
+
]);
|
|
71
|
+
export class MisoAuthError extends Schema.TaggedError()("MisoAuthError", {
|
|
72
|
+
code: MisoAuthErrorCode,
|
|
73
|
+
reason: Schema.String,
|
|
74
|
+
status: Schema.optional(Schema.Number),
|
|
75
|
+
cause: Schema.optional(Schema.Defect()),
|
|
76
|
+
}) {
|
|
77
|
+
get message() {
|
|
78
|
+
return this.reason;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// ── Domain not-found wrappers ───────────────────────────────────────────────
|
|
82
|
+
//
|
|
83
|
+
// Added where a caller benefits from a typed tag instead of message-sniffing —
|
|
84
|
+
// concretely, `misofm/api`'s read service hand-rolls exactly this bridge today
|
|
85
|
+
// (`services/miso-read-service/src/routes.ts`: `isMissingRelease`,
|
|
86
|
+
// `isMissingReceipt`). These let that bridge use `Effect.catchTag` instead.
|
|
87
|
+
/** No Release exists at the requested id (or it is not a Release from the configured deployment). */
|
|
88
|
+
export class ReleaseNotFoundError extends Schema.TaggedError()("ReleaseNotFoundError", {
|
|
89
|
+
releaseId: Schema.String,
|
|
90
|
+
}) {
|
|
91
|
+
}
|
|
92
|
+
/** The fullnode and the indexer both have no record of this transaction digest. */
|
|
93
|
+
export class ReceiptNotFoundError extends Schema.TaggedError()("ReceiptNotFoundError", {
|
|
94
|
+
digest: Schema.String,
|
|
95
|
+
}) {
|
|
96
|
+
}
|
|
97
|
+
/** The transaction exists, but its effects contain no `record_shop::listing::RecordSoldEvent`. */
|
|
98
|
+
export class RecordPurchaseNotFoundError extends Schema.TaggedError()("RecordPurchaseNotFoundError", {
|
|
99
|
+
digest: Schema.String,
|
|
100
|
+
}) {
|
|
101
|
+
}
|
|
102
|
+
/** An object exists at the requested Pressing id, but is not a Pressing from the configured Record package. */
|
|
103
|
+
export class ForeignPressingError extends Schema.TaggedError()("ForeignPressingError", {
|
|
104
|
+
pressingId: Schema.String,
|
|
105
|
+
actualType: Schema.optional(Schema.String),
|
|
106
|
+
}) {
|
|
107
|
+
get message() {
|
|
108
|
+
return `@misofm/platform: object ${this.pressingId} is not a Pressing from the configured Record package.`;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AAEtC,yEAAyE;AACzE,8EAA8E;AAC9E,6EAA6E;AAC7E,wEAAwE;AAExE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,2EAA2E;AAC3E,yEAAyE;AACzE,OAAO,EACL,cAAc,EACd,eAAe,EACf,uBAAuB,EACvB,mBAAmB,EACnB,uBAAuB,EACvB,WAAW,EACX,sBAAsB,GAEvB,MAAM,uBAAuB,CAAC;AAE/B,8EAA8E;AAC9E,MAAM,OAAO,2BAA4B,SAAQ,MAAM,CAAC,WAAW,EAA+B,CAChG,6BAA6B,EAC7B;IACE,MAAM,EAAE,MAAM,CAAC,MAAM;CACtB,CACF;IACC,IAAa,OAAO;QAClB,OAAO,mDAAmD,IAAI,CAAC,MAAM,EAAE,CAAC;IAC1E,CAAC;CACF;AAED,yEAAyE;AACzE,MAAM,OAAO,0BAA2B,SAAQ,MAAM,CAAC,WAAW,EAA8B,CAC9F,4BAA4B,EAC5B;IACE,MAAM,EAAE,MAAM,CAAC,MAAM;CACtB,CACF;IACC,IAAa,OAAO;QAClB,OAAO,uDAAuD,IAAI,CAAC,MAAM,EAAE,CAAC;IAC9E,CAAC;CACF;AAED,wFAAwF;AACxF,MAAM,OAAO,kCAAmC,SAAQ,MAAM,CAAC,WAAW,EAAsC,CAC9G,oCAAoC,EACpC;IACE,OAAO,EA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ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { ParallelTransactionExecutor } from "@mysten/sui/transactions";
|
|
2
2
|
import type { SuiClientTypes } from "@mysten/sui/client";
|
|
3
|
+
import { Effect } from "effect";
|
|
3
4
|
import { type ExecResult } from "@misofm/musicos";
|
|
5
|
+
import { SuiRpcError } from "@misofm/effect/errors";
|
|
4
6
|
import type { TxThunk } from "./transactions.ts";
|
|
5
7
|
export * from "@misofm/musicos/execute";
|
|
6
8
|
/** Publication execution also needs lifecycle events to associate same-typed
|
|
@@ -26,5 +28,5 @@ export interface PlatformExecResult extends ExecResult {
|
|
|
26
28
|
* job (e.g. a resumable checkpoint that reconciles against on-chain state). A Move
|
|
27
29
|
* abort RESOLVES as a `FailedTransaction`, so `toExecResult` surfaces it too.
|
|
28
30
|
*/
|
|
29
|
-
export declare
|
|
31
|
+
export declare const executeViaExecutor: (executor: ParallelTransactionExecutor, ...thunks: TxThunk[]) => Effect.Effect<PlatformExecResult, SuiRpcError, never>;
|
|
30
32
|
//# sourceMappingURL=execute.d.ts.map
|
package/dist/execute.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAuC,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAKjD,cAAc,yBAAyB,CAAC;AAExC;gFACgF;AAChF,eAAO,MAAM,qBAAqB;;;;;CAA6C,CAAC;AAGhF,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IACpD,MAAM,EAAE,cAAc,CAAC,KAAK,EAAE,CAAC;CAChC;AAED;;;;;;;;;;;GAWG;AACH,
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAuC,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAKjD,cAAc,yBAAyB,CAAC;AAExC;gFACgF;AAChF,eAAO,MAAM,qBAAqB;;;;;CAA6C,CAAC;AAGhF,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IACpD,MAAM,EAAE,cAAc,CAAC,KAAK,EAAE,CAAC;CAChC;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB,wHAY7B,CAAC"}
|
package/dist/execute.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// Copyright (c) Miso Labs, Inc.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { Effect } from "effect";
|
|
3
4
|
import { buildTx, toExecResult, FULL_INCLUDE } from "@misofm/musicos";
|
|
5
|
+
import { SuiRpcError } from "@misofm/effect/errors";
|
|
4
6
|
// Consumers of the platform SDK should not need a second direct dependency on
|
|
5
7
|
// the protocol SDK just to execute a composed PTB. Keep the generic execution
|
|
6
8
|
// surface available through this platform-layer entry point as well.
|
|
@@ -20,12 +22,15 @@ export const PLATFORM_FULL_INCLUDE = { ...FULL_INCLUDE, events: true };
|
|
|
20
22
|
* job (e.g. a resumable checkpoint that reconciles against on-chain state). A Move
|
|
21
23
|
* abort RESOLVES as a `FailedTransaction`, so `toExecResult` surfaces it too.
|
|
22
24
|
*/
|
|
23
|
-
export
|
|
24
|
-
const tx =
|
|
25
|
-
const res =
|
|
25
|
+
export const executeViaExecutor = Effect.fn("executeViaExecutor")(function* (executor, ...thunks) {
|
|
26
|
+
const tx = yield* buildTx(...thunks);
|
|
27
|
+
const res = yield* Effect.tryPromise({
|
|
28
|
+
try: () => executor.executeTransaction(tx, PLATFORM_FULL_INCLUDE),
|
|
29
|
+
catch: (cause) => new SuiRpcError({ operation: "executeTransaction", cause }),
|
|
30
|
+
});
|
|
26
31
|
const base = toExecResult(res);
|
|
27
32
|
if (res.$kind !== "Transaction")
|
|
28
33
|
throw new Error("unreachable: toExecResult accepted a failed transaction");
|
|
29
34
|
return { ...base, events: res.Transaction.events ?? [] };
|
|
30
|
-
}
|
|
35
|
+
});
|
|
31
36
|
//# sourceMappingURL=execute.js.map
|
package/dist/execute.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AAWtC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAmB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AAWtC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAmB,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD,8EAA8E;AAC9E,8EAA8E;AAC9E,qEAAqE;AACrE,cAAc,yBAAyB,CAAC;AAExC;gFACgF;AAChF,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,GAAG,YAAY,EAAE,MAAM,EAAE,IAAI,EAAW,CAAC;AAOhF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC,QAAQ,CAAC,EACzE,QAAqC,EACrC,GAAG,MAAiB;IAEpB,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC;IACrC,MAAM,GAAG,GAA0D,KAAK,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC;QAC1F,GAAG,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,EAAE,qBAAqB,CAAC;QACjE,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,WAAW,CAAC,EAAE,SAAS,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;KAC9E,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,GAAG,CAAC,KAAK,KAAK,aAAa;QAAE,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC5G,OAAO,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC;AAC3D,CAAC,CAAC,CAAC"}
|
package/dist/genre.d.ts
CHANGED
|
@@ -1,43 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* On-chain, `release_genre` and `recording_genre` store the identical shape: a
|
|
5
|
-
* bare `vector<ID>` of `genre::Genre` object ids under a dynamic field keyed by
|
|
6
|
-
* an empty `ExtensionKey()`, index 0 the primary, capped at `MAX_GENRES` (6), and
|
|
7
|
-
* non-empty by construction — removing the last entry drops the field, so "the
|
|
8
|
-
* field exists" and "there is a primary" are the same fact. Every id in the list
|
|
9
|
-
* came from `add_genre(self, cap, genre: &Genre)`, which only accepts a real
|
|
10
|
-
* object minted by the shared `genre` vocabulary registry; `remove_genre` takes
|
|
11
|
-
* a bare `ID` since proving membership is not needed to drop a reference.
|
|
12
|
-
*
|
|
13
|
-
* This module spans both `Release` and `Recording` rather than living beside
|
|
14
|
-
* one target object (contrast `release-extensions.ts` / `recording-extensions.ts`,
|
|
15
|
-
* which are split by target). Genre is not a per-target-object axis: the two
|
|
16
|
-
* packages are separately deployed, separately versioned siblings with the same
|
|
17
|
-
* vocabulary and the same shape, and `recording-extensions.ts` must not import
|
|
18
|
-
* genre helpers out of `release-extensions.ts` (or vice versa) just because one
|
|
19
|
-
* happened to be written first.
|
|
20
|
-
*
|
|
21
|
-
* `setReleaseGenres` / `setRecordingGenres` below express the complete desired
|
|
22
|
-
* list: they emit `clear_genres` first, then exactly one `add_genre` per id in
|
|
23
|
-
* array order. `clear_genres` is a no-op when nothing is attached, so this is
|
|
24
|
-
* safe to run against a fresh object, and it is equally safe to re-run against
|
|
25
|
-
* one that already carries genres — the leading `clear_genres` wipes prior
|
|
26
|
-
* state before the adds replay, so the transaction is idempotent and can be
|
|
27
|
-
* composed more than once in the same PTB. Editing clients that want to
|
|
28
|
-
* mutate an existing assignment without a full replace should use the
|
|
29
|
-
* exported single-mutation primitives (`addReleaseGenre`, `removeReleaseGenre`
|
|
30
|
-
* and their `recording` counterparts), or `clearReleaseGenres` /
|
|
31
|
-
* `clearRecordingGenres` to drop the list outright.
|
|
32
|
-
*
|
|
33
|
-
* `getReleaseGenres` / `getRecordingGenres` below return `[]` when the
|
|
34
|
-
* dynamic field is absent, which now exactly mirrors the on-chain `genres()`
|
|
35
|
-
* view — both Move modules removed their standalone emptiness/first-entry
|
|
36
|
-
* accessors, so emptiness is `genres().length === 0` and the primary is
|
|
37
|
-
* `genres()[0]`, computed client-side the same way Move computes them.
|
|
38
|
-
*/
|
|
39
|
-
import type { ClientWithCoreApi } from "@mysten/sui/client";
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
|
+
import { type SuiClient, type SuiRpcError } from "@misofm/effect";
|
|
40
3
|
import type { TxThunk } from "./transactions.ts";
|
|
4
|
+
import { PlatformDeployment } from "./deployments.ts";
|
|
41
5
|
import type { ReleaseExtensionTarget } from "./release-extensions.ts";
|
|
42
6
|
import type { RecordingExtensionTarget } from "./recording-extensions.ts";
|
|
43
7
|
/** Validate the canonical on-chain genre vocabulary spelling. */
|
|
@@ -46,6 +10,25 @@ export declare function assertCanonicalGenreName(name: string): void;
|
|
|
46
10
|
* `genrePackageId` must be the genre package's defining (original publish)
|
|
47
11
|
* address — the on-chain derivation hashes type names with defining IDs. */
|
|
48
12
|
export declare function deriveGenreAddress(genreRegistryId: string, genrePackageId: string, canonicalName: string): string;
|
|
13
|
+
declare const Genre_base: Schema.Class<Genre, Schema.Struct<{
|
|
14
|
+
readonly id: Schema.String;
|
|
15
|
+
readonly name: Schema.String;
|
|
16
|
+
}>, {}>;
|
|
17
|
+
/**
|
|
18
|
+
* A vocabulary entry from the shared `genre` registry, identified by its
|
|
19
|
+
* canonical name (e.g. `"HIP_HOP"`). Constructing one needs the deployment's
|
|
20
|
+
* genre registry object id and genre package id — see {@link Genre.derive}.
|
|
21
|
+
*/
|
|
22
|
+
export declare class Genre extends Genre_base {
|
|
23
|
+
/**
|
|
24
|
+
* Derives a `Genre`'s immutable object address from the platform
|
|
25
|
+
* deployment's genre registry + package id. This is a pure derivation (no
|
|
26
|
+
* chain read) but is the pilot for a value object whose construction
|
|
27
|
+
* genuinely needs deployment context, so it reaches that context through
|
|
28
|
+
* the `PlatformDeployment` service rather than an explicit parameter.
|
|
29
|
+
*/
|
|
30
|
+
static readonly derive: (canonicalName: string) => Effect.Effect<Genre, never, PlatformDeployment>;
|
|
31
|
+
}
|
|
49
32
|
/** The maximum number of genres `release_genre` / `recording_genre` will accept. */
|
|
50
33
|
export declare const MAX_GENRES = 6;
|
|
51
34
|
export type SetReleaseGenresParams = ReleaseExtensionTarget & {
|
|
@@ -113,12 +96,13 @@ export declare function recordingGenresFieldId(recordingId: string, recordingGen
|
|
|
113
96
|
* are attached. The primary is `list[0]`; there is no separate primary reader
|
|
114
97
|
* because the Move `genres` view already returns `[]` for the absent case.
|
|
115
98
|
*/
|
|
116
|
-
export declare
|
|
99
|
+
export declare const getReleaseGenres: (releaseId: string, releaseGenrePackageId: string) => Effect.Effect<string[], SuiRpcError, SuiClient>;
|
|
117
100
|
/**
|
|
118
101
|
* Read a Recording's genre ids in order (primary first), or `[]` when no
|
|
119
102
|
* genres are attached. The primary is `list[0]`; there is no separate primary
|
|
120
103
|
* reader because the Move `genres` view already returns `[]` for the absent
|
|
121
104
|
* case.
|
|
122
105
|
*/
|
|
123
|
-
export declare
|
|
106
|
+
export declare const getRecordingGenres: (recordingId: string, recordingGenrePackageId: string) => Effect.Effect<string[], SuiRpcError, SuiClient>;
|
|
107
|
+
export {};
|
|
124
108
|
//# sourceMappingURL=genre.d.ts.map
|