plm-upload-mcp 1.3.5 → 1.3.7

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 (2) hide show
  1. package/index.mjs +4 -5
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -138,7 +138,7 @@ const driveOf = (c) => (c.staging ? 'staging' : 'main')
138
138
  // planUprev (src/lib/promotion.ts). Change both together. ---------------------
139
139
  const IM_METHOD = /\binjection\b|\bmou?ld(ed|ing)?\s+plastic/i
140
140
  const isXRev = (sku) => /-X\d+$/.test(sku)
141
- const familyOf = (sku) => sku.replace(/-(X\d+|[A-Z]\d|\d\d)$/, '')
141
+ const familyOf = (sku) => sku.replace(/-(X\d+|(?:[A-Z]\d|\d\d)(?:X\d+)?)$/, '') // in-work A0X0 too
142
142
 
143
143
  /** Next prototype revision, same rule as the edge `uprev` (X0–X98 only). */
144
144
  function nextRev(sku) {
@@ -223,13 +223,11 @@ async function uploadOne({ path, sku, skuName, category, bucket, filename = base
223
223
  filename,
224
224
  mimeType,
225
225
  bucket,
226
+ // The pick goes on with the upload: set-category afterwards needs View files for the file's guessed category.
227
+ ...(category ? { category } : {}),
226
228
  })
227
229
  if (synced?.error) throw new Error(synced.error)
228
230
 
229
- if (category && synced?.driveFileId) {
230
- await edgeJson({ action: 'set-category', fileId: synced.driveFileId, category }).catch(() => {})
231
- }
232
-
233
231
  return {
234
232
  file: filename,
235
233
  sku,
@@ -762,6 +760,7 @@ if (process.argv.includes('--selftest')) {
762
760
  assert(nextRev('MNT-1234-X1').newSku === 'MNT-1234-X2', 'X1 -> X2')
763
761
  assert(nextRev('MNT-1234-X9').newSku === 'MNT-1234-X10' && nextRev('MNT-1234-X98').newSku === 'MNT-1234-X99', 'X9 → X10, X98 → X99')
764
762
  assert(nextRev('MNT-1234-X99').error && nextRev('MNT-1234-A0').error, 'X99 and A0 refused')
763
+ assert(familyOf('MNT-1234-A0X12') === 'MNT-1234' && !isXRev('MNT-1234-A0X0') && nextRev('MNT-1234-A0X0').error, 'in-work A0X0: family, not staging')
765
764
  const prev = { sku: 'MNT-1234-X1', drawing_rev: '01' }
766
765
  assert(drawingWarnings({ is_lionsbot: true, sku: 'MNT-1234-X2', rev: '02' }, 'MNT-1234-X2', prev).length === 0, 'clean drawing')
767
766
  assert(/No difference/.test(drawingWarnings({ is_lionsbot: true, sku: 'MNT-1234-X1', rev: '01' }, 'MNT-1234-X2', prev)[0]), 'same sku + rev')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plm-upload-mcp",
3
- "version": "1.3.5",
3
+ "version": "1.3.7",
4
4
  "description": "MCP server to read the LionsBot PLM (SKU folders, component metadata, extracted drawing metadata, product & staging BOMs) bulk-upload SolidWorks exports (STEP/PDF) into it by SKU, create components' Drive folders and uprev staging prototypes.",
5
5
  "license": "UNLICENSED",
6
6
  "keywords": ["mcp", "modelcontextprotocol", "lionsbot", "plm", "solidworks"],