Registry / devops / appcenter-file-upload-client

appcenter-file-upload-client

JSON →
library0.1.0jsnpmunverified

This package, `appcenter-file-upload-client`, provides a client-side JavaScript/TypeScript library designed to streamline the file upload process specifically for Microsoft App Center services. It abstracts the complexities of interacting with the Microsoft file upload service, offering a programmatic interface to upload files with progress tracking, cancellation capabilities, and event hooks for messages and state changes. Currently at version 0.1.0, this package is an early-stage release, and given its last commit date in 2018, it is considered abandoned and unlikely to receive further updates or stability guarantees. Its primary differentiator is its direct integration with App Center's internal file upload mechanisms, requiring `assetId`, `assetDomain`, and `assetToken` values obtained from the App Center service itself.

npm install appcenter-file-upload-client
INSTALL
IMPORT
SIG · APPCENTER-FILE-UPL
A
appcenter-file-upload-client
devopsjavascriptv0.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FileUploadClient
import { FileUploadClient } from 'appcenter-file-upload-client';
const FileUploadClient = require('appcenter-file-upload-client');
The primary class for initiating and managing file uploads. This library primarily uses named exports.
IFileUploadClientSettings
import type { IFileUploadClientSettings } from 'appcenter-file-upload-client';
import { IFileUploadClientSettings } from 'appcenter-file-upload-client';
Interface for configuring the upload process. Use `import type` for type-only imports in TypeScript environments.
IProgress
import type { IProgress } from 'appcenter-file-upload-client';
import { IProgress } from 'appcenter-file-upload-client';
Interface for tracking upload progress. Use `import type` for type-only imports in TypeScript environments.

Demonstrates initializing `FileUploadClient`, performing an upload with progress and message callbacks, and handling success or error with required environment variables.

import { FileUploadClient } from 'appcenter-file-upload-client'; import type { IProgress, MessageLevel, IUploadResults, FileUploadError } from 'appcenter-file-upload-client'; const FILE_PATH = process.env.UPLOAD_FILE_PATH ?? './sample.txt'; // These values must be obtained securely from the App Center Upload Service // and are required for authentication and targeting the correct upload destination. const fileUploadData = { assetId: process.env.APPCENTER_ASSET_ID ?? '', assetToken: process.env.APPCENTER_ASSET_TOKEN ?? '', assetUploadDomian: process.env.APPCENTER_ASSET_DOMAIN ?? '' }; if (!fileUploadData.assetId || !fileUploadData.assetToken || !fileUploadData.assetUploadDomian || !FILE_PATH) { console.error('Please set UPLOAD_FILE_PATH, APPCENTER_ASSET_ID, APPCENTER_ASSET_TOKEN, and APPCENTER_ASSET_DOMAIN environment variables.'); process.exit(1); } new FileUploadClient().upload({ onMessage: (uploadMessage: string, messageLevel: MessageLevel) => { console.log(`[${MessageLevel[messageLevel]}] Upload message: ${uploadMessage}`); }, onProgressChanged: (progressData: IProgress) => { console.log(`Upload progress: ${progressData.percentCompleted}%`); }, assetId: fileUploadData.assetId, assetDomain: fileUploadData.assetUploadDomian, assetToken: fileUploadData.assetToken, filePath: FILE_PATH, useLogging: true }).then((uploadResult: IUploadResults) => { console.log("File upload completed. Download URL:", uploadResult.downloadUrl); }).catch((error: FileUploadError) => { console.error('An error occurred during upload:', error.message); process.exit(1); });
Debug
Known issues
breakingThis package is at version 0.1.0 and appears to be abandoned since 2018. It is highly unstable, not actively maintained, and any internal changes to the App Center file upload service are unlikely to be reflected or supported by this client. Production use is strongly discouraged.
fix
Consider alternative file upload solutions or directly integrating with App Center's current file upload APIs if available and documented, bypassing this library.
affects: >=0.1.0
gotchaThe client requires `assetId`, `assetDomain`, and `assetToken` values that must be securely obtained from the App Center file upload service itself. This library does not handle the acquisition or generation of these authentication tokens.
fix
Ensure your application fetches the necessary `assetId`, `assetDomain`, and `assetToken` from App Center's backend services before attempting an upload. Consult App Center documentation for how to retrieve these credentials.
affects: >=0.1.0
gotchaFile uploads can be unreliable due to network conditions, server issues, or incorrect authentication. The library provides `onMessage` and `onStateChanged` callbacks, but robust error handling and retry mechanisms need to be implemented externally by the consumer.
fix
Implement comprehensive error handling in your application, including retry logic with exponential backoff for transient network issues, and clear user feedback on upload failures.
affects: >=0.1.0
Errors
Common errors & fixes
TypeError: (0 , appcenter_file_upload_client_1.FileUploadClient) is not a constructor
Incorrect import statement, often when mixing CommonJS with ESM or attempting to destructure a default export incorrectly for a named export.
fix
For ESM: `import { FileUploadClient } from 'appcenter-file-upload-client';`. For CommonJS: `const { FileUploadClient } = require('appcenter-file-upload-client');`.
An error occured: Missing required settings: assetId, assetToken, assetDomain (or similar message)
The `IFileUploadClientSettings` object passed to the `upload` method is missing one or more critical properties (`assetId`, `assetDomain`, `assetToken`, or `filePath`).
fix
Ensure all required properties are populated in the settings object, obtaining `assetId`, `assetDomain`, and `assetToken` from the App Center service.
Upload failed with status 401: Unauthorized (or similar authentication error)
The `assetToken` provided is invalid, expired, or does not have the necessary permissions for the upload.
fix
Verify that the `assetToken` is fresh, correctly obtained from the App Center service, and has appropriate permissions. Check App Center's documentation for token expiry and refresh mechanisms.
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
14
OpenAI (training)
1
Resources
appcenter-file-upload-client — npm install appcenter-file-upload-client · libregistry