nucleus-core-ts 0.10.56 → 0.10.57

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/.build-ok CHANGED
@@ -1 +1 @@
1
- 0.10.56
1
+ 0.10.57
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useEffect, useEffectEvent, useState } from 'react';
4
4
  import { DEFAULT_VERIFICATION_FLOW_LABELS } from '../labels';
5
5
  import { useVerificationFlowStore } from '../store';
6
- import { planDecision } from './decisionPlan';
6
+ import { planDecision, signatureFileType } from './decisionPlan';
7
7
  import { getActiveTheme } from '../theme/store';
8
8
  export function PendingTab({ pendingAction, decideAction, uploadSignatureAction, onDecisionMade, labels }) {
9
9
  // Local, not in the store: only one card is in deciding mode at a time, and
@@ -100,7 +100,7 @@ export function PendingTab({ pendingAction, decideAction, uploadSignatureAction,
100
100
  size: signatureFile.size,
101
101
  mime_type: signatureFile.type || 'application/octet-stream',
102
102
  extension: signatureFile.name.split('.').pop() || '',
103
- type: 'signature'
103
+ type: signatureFileType(signatureFile.type)
104
104
  }));
105
105
  setSignatureNote(say.signatureUploading);
106
106
  uploadSignatureAction.start({
@@ -25,3 +25,18 @@ export declare function planDecision(input: {
25
25
  hasUploadAction: boolean;
26
26
  hasFile: boolean;
27
27
  }): DecisionPlan;
28
+ /**
29
+ * Which `files.type` a signature upload should declare.
30
+ *
31
+ * The column is an enum the HOST configures, and a generic component cannot
32
+ * invent a value for it. The first version of this sent `type: 'signature'`
33
+ * and the install answered, from its own list: "type must be one of: image,
34
+ * document, video, audio, profile_picture" — a 400 the reviewer saw only as
35
+ * "the signature could not be uploaded".
36
+ *
37
+ * So it is derived from the file itself and lands on one of the names every
38
+ * install carries. `document` is the fallback because a signature that is not
39
+ * an image is a signed document, and because it is the safest of the five to
40
+ * be wrong about.
41
+ */
42
+ export declare function signatureFileType(mimeType: string | undefined): string;
@@ -29,3 +29,23 @@
29
29
  kind: 'upload-then-send'
30
30
  };
31
31
  }
32
+ /**
33
+ * Which `files.type` a signature upload should declare.
34
+ *
35
+ * The column is an enum the HOST configures, and a generic component cannot
36
+ * invent a value for it. The first version of this sent `type: 'signature'`
37
+ * and the install answered, from its own list: "type must be one of: image,
38
+ * document, video, audio, profile_picture" — a 400 the reviewer saw only as
39
+ * "the signature could not be uploaded".
40
+ *
41
+ * So it is derived from the file itself and lands on one of the names every
42
+ * install carries. `document` is the fallback because a signature that is not
43
+ * an image is a signed document, and because it is the safest of the five to
44
+ * be wrong about.
45
+ */ export function signatureFileType(mimeType) {
46
+ const mime = (mimeType || '').toLowerCase();
47
+ if (mime.startsWith('image/')) return 'image';
48
+ if (mime.startsWith('video/')) return 'video';
49
+ if (mime.startsWith('audio/')) return 'audio';
50
+ return 'document';
51
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nucleus-core-ts",
3
- "version": "0.10.56",
3
+ "version": "0.10.57",
4
4
  "description": "Production-ready, enterprise-grade TypeScript framework for building multi-tenant APIs",
5
5
  "author": "Hidayet Can Özcan <hidayetcan@gmail.com>",
6
6
  "license": "SEE LICENSE IN LICENSE",