@labelgrid/core 0.2.1 → 0.2.2

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/CHANGELOG.md CHANGED
@@ -8,6 +8,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8
8
  `@labelgrid/core` is primarily an internal shared client for the LabelGrid MCP
9
9
  server and CLI — there are no API-stability promises before 1.0.
10
10
 
11
+ ## [0.2.2] - 2026-08-20
12
+
13
+ ### Added
14
+
15
+ - Catalog entities now declare whether their delete endpoint accepts a
16
+ replacement, allowing clients to expose reassignment only for writers and
17
+ publishers.
18
+ - `LabelGridClient.delete()` accepts optional query parameters while preserving
19
+ the existing request URL byte-for-byte when none are supplied.
20
+
21
+ ### Changed
22
+
23
+ - Writer and publisher delete guidance now names every reference that can block
24
+ deletion.
25
+
11
26
  ## [0.2.1] - 2026-08-05
12
27
 
13
28
  ### Changed
@@ -72,7 +72,12 @@ export declare class LabelGridClient {
72
72
  idempotency?: boolean;
73
73
  idempotencyKey?: string;
74
74
  }): Promise<ApiResult<T>>;
75
- delete<T>(path: string): Promise<ApiResult<T>>;
75
+ /**
76
+ * A delete carries its parameters in the query string, never in a body: RFC
77
+ * 9110 gives a DELETE body no defined semantics and intermediaries drop it.
78
+ * Omitting `query` sends exactly the URL it always did.
79
+ */
80
+ delete<T>(path: string, query?: Record<string, unknown>): Promise<ApiResult<T>>;
76
81
  /**
77
82
  * Sends a multipart/form-data POST with a single file field plus optional
78
83
  * extra string fields. A missing/unreadable file yields a FILE_NOT_FOUND
package/dist/api/http.js CHANGED
@@ -357,8 +357,13 @@ export class LabelGridClient {
357
357
  idempotencyKey: opts?.idempotencyKey,
358
358
  });
359
359
  }
360
- delete(path) {
361
- return this.send('DELETE', path);
360
+ /**
361
+ * A delete carries its parameters in the query string, never in a body: RFC
362
+ * 9110 gives a DELETE body no defined semantics and intermediaries drop it.
363
+ * Omitting `query` sends exactly the URL it always did.
364
+ */
365
+ delete(path, query) {
366
+ return this.send('DELETE', path, { query });
362
367
  }
363
368
  /**
364
369
  * Sends a multipart/form-data POST with a single file field plus optional
@@ -23,5 +23,19 @@ export type EntitySpec = {
23
23
  fieldsDoc: string;
24
24
  /** One-line doc of the server-side delete refusals. */
25
25
  deleteNote: string;
26
+ /**
27
+ * Whether this entity's DELETE endpoint accepts `replace_with` — the id of the
28
+ * entity that takes over every credit held by the one being deleted, rewritten
29
+ * before the delete. Only the writer and publisher endpoints have it. Stated
30
+ * for every entity rather than defaulted, so a new entity cannot inherit an
31
+ * answer nobody gave.
32
+ */
33
+ acceptsDeleteReplacement: boolean;
26
34
  };
27
35
  export declare const ENTITIES: Record<EntityName, EntitySpec>;
36
+ /**
37
+ * The entities whose DELETE accepts `replace_with`, derived from the registry so
38
+ * the tool schema, its description and its refusal message cannot disagree with
39
+ * the table or with each other.
40
+ */
41
+ export declare const REPLACEMENT_ENTITIES: readonly EntityName[];
package/dist/entities.js CHANGED
@@ -19,35 +19,47 @@ export const ENTITIES = {
19
19
  filtersDoc: 'label: no documented filters.',
20
20
  fieldsDoc: 'label — required: name, default_email; optional: support email, website/platform URLs, default copyright lines, isrc_base.',
21
21
  deleteNote: 'label: refused while the label still has releases — remove or reassign its releases first.',
22
+ acceptsDeleteReplacement: false,
22
23
  },
23
24
  artist: {
24
25
  path: '/artists',
25
26
  filtersDoc: 'artist: artist_name.',
26
27
  fieldsDoc: 'artist — required: artist_name; optional: full_name, email, location, bios, isni, default_language, platform profile URLs.',
27
28
  deleteNote: 'artist: refused while still referenced by releases or tracks.',
29
+ acceptsDeleteReplacement: false,
28
30
  },
29
31
  writer: {
30
32
  path: '/writers',
31
33
  filtersDoc: 'writer: name, ipi.',
32
34
  fieldsDoc: 'writer — required: first_name, last_name; optional: middle_name, display_credits, email, country, pro, ipi, isni, publisher_id (or publisher_name/publisher_pro/publisher_ipi).',
33
- deleteNote: 'writer: refused while still referenced by tracks.',
35
+ deleteNote: 'writer: refused while still referenced by tracks or artists, unless replace_with reassigns those credits.',
36
+ acceptsDeleteReplacement: true,
34
37
  },
35
38
  publisher: {
36
39
  path: '/publishers',
37
40
  filtersDoc: 'publisher: name, ipi.',
38
41
  fieldsDoc: 'publisher — required: name; optional: ipi, pro, isni, controlled_publisher.',
39
- deleteNote: 'publisher: refused while still referenced by writers.',
42
+ deleteNote: 'publisher: refused while still referenced by tracks or label default publishers, unless replace_with reassigns those credits.',
43
+ acceptsDeleteReplacement: true,
40
44
  },
41
45
  release: {
42
46
  path: '/releases',
43
47
  filtersDoc: 'release: label_id, is_live (1 = live only), barcode_number (UPC/EAN), cat.',
44
48
  fieldsDoc: 'release — required on create: content_type, label_id, artists, titles, cat (catalog number), artwork_ai_usage, primary_genre_id; many optional fields (dates, copyright lines, genres, per-outlet URLs).',
45
49
  deleteNote: 'release: only a never-submitted draft can be deleted.',
50
+ acceptsDeleteReplacement: false,
46
51
  },
47
52
  track: {
48
53
  path: '/tracks',
49
54
  filtersDoc: 'track: release_id, isrc.',
50
55
  fieldsDoc: 'track — required on create: release_id, disc, track_num, composition_type, artists, audio_ai_usage, composition_ai_usage, commercial_samples, audio_language, contributors, and recording_country (ISO 3166-1 alpha-2, e.g. "US"); optional: titles, isrc, iswc, writers, publishers, splits, and more.',
51
56
  deleteNote: 'track: refused once the release is no longer an editable draft.',
57
+ acceptsDeleteReplacement: false,
52
58
  },
53
59
  };
60
+ /**
61
+ * The entities whose DELETE accepts `replace_with`, derived from the registry so
62
+ * the tool schema, its description and its refusal message cannot disagree with
63
+ * the table or with each other.
64
+ */
65
+ export const REPLACEMENT_ENTITIES = ENTITY_NAMES.filter((name) => ENTITIES[name].acceptsDeleteReplacement);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labelgrid/core",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Shared LabelGrid public-API client: HTTP transport, uploads, content types, the catalog-entity registry, and redacting logging",
5
5
  "type": "module",
6
6
  "keywords": ["labelgrid", "music-distribution", "api-client"],