@partium/react-native-sdk 15.19.0 → 16.0.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.
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
import { PFile } from
|
|
2
|
+
import { PFile } from '@partium/js-sdk/core';
|
|
3
|
+
export interface RNPFileOptions {
|
|
4
|
+
/** MIME type, e.g. from react-native-image-picker `asset.type`. Defaults from file extension. */
|
|
5
|
+
mimeType?: string;
|
|
6
|
+
/** File name, e.g. from react-native-image-picker `asset.fileName`. Defaults from URI path. */
|
|
7
|
+
fileName?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* React Native file representation for multipart uploads.
|
|
11
|
+
* Uses the RN FormData file object shape ({ uri, name, type }).
|
|
12
|
+
*/
|
|
3
13
|
export declare class RNPFile extends PFile {
|
|
4
14
|
localFilePath: string;
|
|
5
|
-
|
|
15
|
+
readonly mimeType: string;
|
|
16
|
+
readonly fileName: string;
|
|
17
|
+
constructor(localFilePath: string, options?: RNPFileOptions);
|
|
6
18
|
supportsMultipartUpload(): boolean;
|
|
7
19
|
appendToFormData(name: string, formData: FormData): void;
|
|
8
20
|
}
|
package/core/models/rn-p-file.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Copyright © 2022-2026 Partium, Inc. DBA Partium
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.RNPFile=void 0;const core_1=require("@partium/js-sdk/core");class RNPFile extends core_1.PFile{constructor(e){super(),this.localFilePath=e}supportsMultipartUpload(){return!
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.RNPFile=void 0;const core_1=require("@partium/js-sdk/core");class RNPFile extends core_1.PFile{constructor(e,i={}){var t,r;super(),this.localFilePath=e,this.fileName=null!==(t=i.fileName)&&void 0!==t?t:deriveFileName(e),this.mimeType=null!==(r=i.mimeType)&&void 0!==r?r:deriveMimeType(this.fileName)}supportsMultipartUpload(){return!0}appendToFormData(e,i){i.append(e,{uri:normalizeFileUri(this.localFilePath),name:this.fileName,type:this.mimeType})}}function normalizeFileUri(e){return e.startsWith("file://")||e.startsWith("content://")?e:`file://${e}`}function deriveFileName(e){const i=e.split("?")[0].split("/"),t=i[i.length-1];return t.length>0?t:"image.jpg"}function deriveMimeType(e){var i;switch(null===(i=e.split(".").pop())||void 0===i?void 0:i.toLowerCase()){case"png":return"image/png";case"gif":return"image/gif";case"webp":return"image/webp";case"heic":case"heif":return"image/heic";default:return"image/jpeg"}}exports.RNPFile=RNPFile;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@partium/react-native-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.0",
|
|
4
4
|
"description": "The Partium Find SDK enables integration of Partium’s parts and materials search capabilities into React Native-based applications.",
|
|
5
5
|
"author": "Partium Inc.",
|
|
6
6
|
"license": "See LICENSE.txt",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"clean": "npx rimraf -- node_modules package-lock.json && npm i"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@partium/js-sdk": "
|
|
22
|
+
"@partium/js-sdk": "16.0.0",
|
|
23
23
|
"rxjs": "7.8.2"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|