@misofm/api-client 0.2.0 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@misofm/api-client",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Typed client and response contract for the Miso API read layer. The one definition of what a Miso read returns.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
package/src/client.ts CHANGED
@@ -24,6 +24,7 @@ import type {
24
24
  DiscoverShelf,
25
25
  DropPreview,
26
26
  OwnedParty,
27
+ PendingMembership,
27
28
  OwnedRecord,
28
29
  OwnedWork,
29
30
  Ownership,
@@ -239,6 +240,10 @@ export function createMisoApiClient(options: MisoApiClientOptions) {
239
240
  getWalletParties: (address: string): Promise<OwnedParty[]> =>
240
241
  required(s.ownedPartiesSchema, `/wallets/${address}/parties`),
241
242
 
243
+ /** Group invitations awaiting acceptance by this wallet's controlled parties. */
244
+ getPendingMemberships: (address: string): Promise<PendingMembership[]> =>
245
+ required(s.pendingMembershipsSchema, `/wallets/${address}/pending-memberships`),
246
+
242
247
  /** The works this wallet administers, keyed by admin cap. */
243
248
  getWalletWorks: (address: string): Promise<OwnedWork[]> =>
244
249
  required(s.ownedWorksSchema, `/wallets/${address}/works`),
@@ -315,6 +320,7 @@ export const READ_CACHE_CLASS = {
315
320
  getArtists: "artist",
316
321
  getWalletRecords: "private",
317
322
  getWalletParties: "private",
323
+ getPendingMemberships: "private",
318
324
  getWalletWorks: "private",
319
325
  getWork: "private",
320
326
  getBalance: "private",
package/src/schemas.ts CHANGED
@@ -302,6 +302,16 @@ export const ownedPartySchema = z.object({
302
302
 
303
303
  export const ownedPartiesSchema = z.array(ownedPartySchema);
304
304
 
305
+ /** A group invitation awaiting action by a party the wallet administers. */
306
+ export const pendingMembershipSchema = z.object({
307
+ memberPartyId: suiIdSchema,
308
+ memberCapId: suiIdSchema,
309
+ groupId: suiIdSchema,
310
+ groupName: z.string(),
311
+ });
312
+
313
+ export const pendingMembershipsSchema = z.array(pendingMembershipSchema);
314
+
305
315
  export const workKindSchema = z.enum(["composition", "recording", "release"]);
306
316
 
307
317
  export const ownedWorkSchema = z.object({
package/src/types.ts CHANGED
@@ -34,6 +34,7 @@ export type PartySummary = z.infer<typeof s.partySummarySchema>;
34
34
 
35
35
  export type OwnedRecord = z.infer<typeof s.ownedRecordSchema>;
36
36
  export type OwnedParty = z.infer<typeof s.ownedPartySchema>;
37
+ export type PendingMembership = z.infer<typeof s.pendingMembershipSchema>;
37
38
  export type WorkKind = z.infer<typeof s.workKindSchema>;
38
39
  export type OwnedWork = z.infer<typeof s.ownedWorkSchema>;
39
40
  export type WorkDetail = z.infer<typeof s.workDetailSchema>;