mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-05-02 00:07:23 +08:00
chore: clean up legacy references and unused code
Update renovate.json for current dependencies. Remove Commitizen badge from README. Replace @ionic-native imports with @awesome-cordova-plugins in plugin JSDoc examples. Fill in Kommunicate documentation links. Add modern package exports to published plugin packages. Remove unused shipit script and release-please scripts.
This commit is contained in:
@@ -140,7 +140,7 @@ export class AppPreferences extends AwesomeCordovaNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['iOS', 'Windows', 'Windows Phone 8'],
|
||||
})
|
||||
cloudSync(): Object {
|
||||
cloudSync(): object {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ export class AppPreferences extends AwesomeCordovaNativePlugin {
|
||||
@Cordova({
|
||||
platforms: ['iOS', 'Windows', 'Windows Phone 8'],
|
||||
})
|
||||
defaults(): Object {
|
||||
defaults(): object {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -725,7 +725,7 @@ export class HTTP extends AwesomeCordovaNativePlugin {
|
||||
}
|
||||
|
||||
@Cordova({ sync: false })
|
||||
approovGetDeviceID(): Promise<String> {
|
||||
approovGetDeviceID(): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -735,22 +735,22 @@ export class HTTP extends AwesomeCordovaNativePlugin {
|
||||
}
|
||||
|
||||
@Cordova({ sync: false })
|
||||
approovFetchToken(url: string): Promise<String> {
|
||||
approovFetchToken(url: string): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({ sync: false })
|
||||
approovGetMessageSignature(message: string): Promise<String> {
|
||||
approovGetMessageSignature(message: string): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({ sync: false })
|
||||
approovFetchSecureString(key: string, newDef: string): Promise<String> {
|
||||
approovFetchSecureString(key: string, newDef: string): Promise<string> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({ sync: false })
|
||||
approovFetchCustomJWT(payload: string): Promise<String> {
|
||||
approovFetchCustomJWT(payload: string): Promise<string> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,5 +208,5 @@ export class Appsflyer extends AwesomeCordovaNativePlugin {
|
||||
* @param {Object} options Additional Parameters to track
|
||||
*/
|
||||
@Cordova({ sync: true })
|
||||
logCrossPromotionAndOpenStore(appId: string, campaign: string, options: Object): void {}
|
||||
logCrossPromotionAndOpenStore(appId: string, campaign: string, options: object): void {}
|
||||
}
|
||||
|
||||
@@ -208,7 +208,11 @@ export interface IContactField {
|
||||
* @hidden
|
||||
*/
|
||||
export class ContactField implements IContactField {
|
||||
constructor(public type?: string, public value?: string, public pref?: boolean) {}
|
||||
constructor(
|
||||
public type?: string,
|
||||
public value?: string,
|
||||
public pref?: boolean
|
||||
) {}
|
||||
}
|
||||
|
||||
export interface IContactAddress {
|
||||
@@ -307,7 +311,7 @@ export class ContactFindOptions implements IContactFindOptions {
|
||||
* @usage
|
||||
*
|
||||
* ```typescript
|
||||
* import { Contacts, Contact, ContactField, ContactName } from '@ionic-native/contacts/ngx';
|
||||
* import { Contacts, Contact, ContactField, ContactName } from '@awesome-cordova-plugins/contacts/ngx';
|
||||
*
|
||||
* constructor(private contacts: Contacts) { }
|
||||
*
|
||||
|
||||
@@ -396,7 +396,7 @@ export class Facebook extends AwesomeCordovaNativePlugin {
|
||||
* @param {Object} userData An object containing data about the user
|
||||
*/
|
||||
@Cordova()
|
||||
setUserData(userData: Object): Promise<void> {
|
||||
setUserData(userData: object): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -420,7 +420,7 @@ export class Facebook extends AwesomeCordovaNativePlugin {
|
||||
successIndex: 3,
|
||||
errorIndex: 4,
|
||||
})
|
||||
logEvent(name: string, params?: Object, valueToSum?: number): Promise<any> {
|
||||
logEvent(name: string, params?: object, valueToSum?: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -466,7 +466,7 @@ export class Facebook extends AwesomeCordovaNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
logPurchase(value: number, currency: string, params?: Object): Promise<any> {
|
||||
logPurchase(value: number, currency: string, params?: object): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -401,7 +401,7 @@ export class FbSdk extends AwesomeCordovaNativePlugin {
|
||||
* @param {Object} userData An object containing data about the user
|
||||
*/
|
||||
@Cordova()
|
||||
setUserData(userData: Object): Promise<void> {
|
||||
setUserData(userData: object): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -425,7 +425,7 @@ export class FbSdk extends AwesomeCordovaNativePlugin {
|
||||
successIndex: 3,
|
||||
errorIndex: 4,
|
||||
})
|
||||
logEvent(name: string, params?: Object, valueToSum?: number): Promise<any> {
|
||||
logEvent(name: string, params?: object, valueToSum?: number): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -471,7 +471,7 @@ export class FbSdk extends AwesomeCordovaNativePlugin {
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
logPurchase(value: number, currency: string, params?: Object): Promise<any> {
|
||||
logPurchase(value: number, currency: string, params?: object): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ export class FirebaseModelInput {
|
||||
* @description This plugin downloads the TensorFlow model from firebase and classify the images.
|
||||
*
|
||||
* ```typescript
|
||||
* import { FirebaseModel } from '@ionic-native/ionic-native-firebase-model';
|
||||
* import { FirebaseModel } from '@awesome-cordova-plugins/firebase-model';
|
||||
*
|
||||
*
|
||||
* constructor(private firebaseModel: FirebaseModel) { }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AwesomeCordovaNativePlugin, Cordova, Plugin } from '@awesome-cordova-plugins/core';
|
||||
|
||||
const hypertrackIonicPluginVersion = "0.2.0"
|
||||
const hypertrackIonicPluginVersion = '0.2.0';
|
||||
// Minimal cordova-plugin-hypertrack-v3 version: 0.5.0
|
||||
@Plugin({
|
||||
pluginName: 'cordova-plugin-hypertrack-v3',
|
||||
@@ -42,7 +42,7 @@ interface SuccessHandler {
|
||||
(): any;
|
||||
}
|
||||
interface LocationReceiver {
|
||||
(location: CordovaLatestLocationResult): any;
|
||||
(location: CordovaLatestLocationResult): any;
|
||||
}
|
||||
|
||||
// SDK instance that exposed from Cordova utilizes usage of callbacks, so we
|
||||
@@ -51,7 +51,7 @@ interface HyperTrackCordova {
|
||||
getDeviceId(success: DeviceIdReceiver, error: FailureHandler): void;
|
||||
isRunning(success: TrackingStateReceiver, error: FailureHandler): void;
|
||||
setDeviceName(name: string, success: SuccessHandler, error: FailureHandler): void;
|
||||
setDeviceMetadata(metadata: Object, success: SuccessHandler, error: FailureHandler): void;
|
||||
setDeviceMetadata(metadata: object, success: SuccessHandler, error: FailureHandler): void;
|
||||
setTrackingNotificationProperties(
|
||||
title: string,
|
||||
message: string,
|
||||
@@ -59,7 +59,7 @@ interface HyperTrackCordova {
|
||||
error: FailureHandler
|
||||
): void;
|
||||
addGeoTag(
|
||||
geotagData: Object,
|
||||
geotagData: object,
|
||||
expectedLocation: Coordinates | undefined,
|
||||
success: SuccessHandler,
|
||||
error: FailureHandler
|
||||
@@ -77,7 +77,10 @@ export class CoordinatesValidationError extends Error {}
|
||||
|
||||
/** Wrapper class for passing spatial geoposition as a geotag's expected location */
|
||||
export class Coordinates {
|
||||
constructor(public latitude: number, public longitude: number) {
|
||||
constructor(
|
||||
public latitude: number,
|
||||
public longitude: number
|
||||
) {
|
||||
if (latitude < -90.0 || latitude > 90.0 || longitude < -180.0 || longitude > 180.0) {
|
||||
throw new CoordinatesValidationError('latitude and longitude should be of correct values');
|
||||
}
|
||||
@@ -85,7 +88,7 @@ export class Coordinates {
|
||||
|
||||
public toString = (): string => {
|
||||
return JSON.stringify(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/** A blocker is an obstacle that needs to be resolved to achieve reliable tracking. */
|
||||
@@ -100,28 +103,32 @@ export interface Blocker {
|
||||
resolve: () => void;
|
||||
}
|
||||
|
||||
export type CordovaLatestLocationResult = {
|
||||
type: "location",
|
||||
location: Coordinates,
|
||||
} | {
|
||||
type: "outage",
|
||||
outage: {
|
||||
code: number,
|
||||
name: keyof typeof Outage
|
||||
}
|
||||
}
|
||||
export type CordovaLatestLocationResult =
|
||||
| {
|
||||
type: 'location';
|
||||
location: Coordinates;
|
||||
}
|
||||
| {
|
||||
type: 'outage';
|
||||
outage: {
|
||||
code: number;
|
||||
name: keyof typeof Outage;
|
||||
};
|
||||
};
|
||||
|
||||
export type LocationResult = {
|
||||
type: LocationResultType.LOCATION,
|
||||
value: Coordinates
|
||||
} |
|
||||
{
|
||||
type: LocationResultType.OUTAGE,
|
||||
value: Outage
|
||||
}
|
||||
export type LocationResult =
|
||||
| {
|
||||
type: LocationResultType.LOCATION;
|
||||
value: Coordinates;
|
||||
}
|
||||
| {
|
||||
type: LocationResultType.OUTAGE;
|
||||
value: Outage;
|
||||
};
|
||||
|
||||
export enum LocationResultType {
|
||||
LOCATION, OUTAGE
|
||||
LOCATION,
|
||||
OUTAGE,
|
||||
}
|
||||
|
||||
export enum Outage {
|
||||
@@ -131,7 +138,7 @@ export enum Outage {
|
||||
NOT_TRACKING,
|
||||
START_HAS_NOT_FINISHED,
|
||||
NO_GPS_SIGNAL,
|
||||
RESTART_REQUIRED
|
||||
RESTART_REQUIRED,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -175,7 +182,7 @@ export class HyperTrack {
|
||||
* @see {@link https://dashboard.hypertrack.com/setup}.
|
||||
*/
|
||||
static initialize(publishableKey: string): Promise<HyperTrack> {
|
||||
console.log(`Hypertrack Ionic plugin version ${hypertrackIonicPluginVersion}`)
|
||||
console.log(`Hypertrack Ionic plugin version ${hypertrackIonicPluginVersion}`);
|
||||
return new Promise((resolve, reject) => {
|
||||
new HyperTrackPlugin()
|
||||
.initialize(publishableKey)
|
||||
@@ -235,7 +242,7 @@ export class HyperTrack {
|
||||
*
|
||||
* @param metadata key-value pais of properties.
|
||||
*/
|
||||
setDeviceMetadata(metadata: Object): Promise<void> {
|
||||
setDeviceMetadata(metadata: object): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.cordovaInstanceHandle.setDeviceMetadata(
|
||||
metadata,
|
||||
@@ -268,7 +275,7 @@ export class HyperTrack {
|
||||
* @param geotagData
|
||||
* @param expectedLocation
|
||||
*/
|
||||
addGeotag(geotagData: Object, expectedLocation?: Coordinates): Promise<void> {
|
||||
addGeotag(geotagData: object, expectedLocation?: Coordinates): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.cordovaInstanceHandle.addGeoTag(
|
||||
geotagData,
|
||||
@@ -332,46 +339,46 @@ export class HyperTrack {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves latest device location that was sent by the SDK.
|
||||
/**
|
||||
* Resolves latest device location that was sent by the SDK.
|
||||
* Only available for Android platform.
|
||||
* */
|
||||
getLatestLocation(): Promise<LocationResult> {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.cordovaInstanceHandle.getLatestLocation(
|
||||
locationResult => resolve(this.handleLocationResult(locationResult)),
|
||||
err => reject(err)
|
||||
(locationResult) => resolve(this.handleLocationResult(locationResult)),
|
||||
(err) => reject(err)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves latest device location from system location provider.
|
||||
/**
|
||||
* Resolves latest device location from system location provider.
|
||||
* Only available for Android platform.
|
||||
* */
|
||||
getCurrentLocation(): Promise<LocationResult> {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.cordovaInstanceHandle.getCurrentLocation(
|
||||
locationResult => resolve(this.handleLocationResult(locationResult)),
|
||||
err => reject(err)
|
||||
(locationResult) => resolve(this.handleLocationResult(locationResult)),
|
||||
(err) => reject(err)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
private handleLocationResult(locationResult: CordovaLatestLocationResult): LocationResult {
|
||||
switch (locationResult.type) {
|
||||
case "location": {
|
||||
case 'location': {
|
||||
return {
|
||||
type: LocationResultType.LOCATION,
|
||||
value: locationResult.location
|
||||
}
|
||||
value: locationResult.location,
|
||||
};
|
||||
}
|
||||
case "outage": {
|
||||
const outage = Outage[locationResult.outage.name]
|
||||
case 'outage': {
|
||||
const outage = Outage[locationResult.outage.name];
|
||||
return {
|
||||
type: LocationResultType.OUTAGE,
|
||||
value: outage
|
||||
}
|
||||
value: outage,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ import { Observable } from 'rxjs';
|
||||
* @description
|
||||
* The plugin for the Kommunicate SDK.
|
||||
* With the help of this plugin, you can easily add human + bot chat support functionality to you app.
|
||||
* Refer to: TODO: insert site link
|
||||
* For documentation: TODO: insert link
|
||||
* Refer to: https://www.kommunicate.io/
|
||||
* For documentation: https://docs.kommunicate.io/
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Kommunicate } from '@awesome-cordova-plugins/Kommunicate';
|
||||
|
||||
@@ -174,7 +174,7 @@ export class NewRelic extends AwesomeCordovaNativePlugin {
|
||||
@Cordova({
|
||||
sync: true,
|
||||
})
|
||||
recordMetric(name: string, category: any, value: Number, countUnit: string, valueUnit: string): void {
|
||||
recordMetric(name: string, category: any, value: number, countUnit: string, valueUnit: string): void {
|
||||
return; // We add return; here to avoid any IDE / Compiler errors
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ export class NewRelic extends AwesomeCordovaNativePlugin {
|
||||
@Cordova({
|
||||
sync: true,
|
||||
})
|
||||
setMaxEventPoolSize(maxPoolSize: Number): void {
|
||||
setMaxEventPoolSize(maxPoolSize: number): void {
|
||||
return; // We add return; here to avoid any IDE / Compiler errors
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ export class NewRelic extends AwesomeCordovaNativePlugin {
|
||||
@Cordova({
|
||||
sync: true,
|
||||
})
|
||||
setMaxEventBufferTime(maxBufferTimeInSeconds: Number): void {
|
||||
setMaxEventBufferTime(maxBufferTimeInSeconds: number): void {
|
||||
return; // We add return; here to avoid any IDE / Compiler errors
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ export class NewRelic extends AwesomeCordovaNativePlugin {
|
||||
@Cordova({
|
||||
sync: true,
|
||||
})
|
||||
analyticsEventEnabled(enabled: Boolean): void {
|
||||
analyticsEventEnabled(enabled: boolean): void {
|
||||
return; // We add return; here to avoid any IDE / Compiler errors
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ export class NewRelic extends AwesomeCordovaNativePlugin {
|
||||
@Cordova({
|
||||
sync: true,
|
||||
})
|
||||
networkRequestEnabled(enabled: Boolean): void {
|
||||
networkRequestEnabled(enabled: boolean): void {
|
||||
return; // We add return; here to avoid any IDE / Compiler errors
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ export class NewRelic extends AwesomeCordovaNativePlugin {
|
||||
@Cordova({
|
||||
sync: true,
|
||||
})
|
||||
networkErrorRequestEnabled(enabled: Boolean): void {
|
||||
networkErrorRequestEnabled(enabled: boolean): void {
|
||||
return; // We add return; here to avoid any IDE / Compiler errors
|
||||
}
|
||||
|
||||
@@ -256,7 +256,7 @@ export class NewRelic extends AwesomeCordovaNativePlugin {
|
||||
@Cordova({
|
||||
sync: true,
|
||||
})
|
||||
httpRequestBodyCaptureEnabled(enabled: Boolean): void {
|
||||
httpRequestBodyCaptureEnabled(enabled: boolean): void {
|
||||
return; // We add return; here to avoid any IDE / Compiler errors
|
||||
}
|
||||
|
||||
@@ -277,11 +277,11 @@ export class NewRelic extends AwesomeCordovaNativePlugin {
|
||||
noticeHttpTransaction(
|
||||
url: string,
|
||||
method: string,
|
||||
status: Number,
|
||||
startTime: Number,
|
||||
endTime: Number,
|
||||
bytesSent: Number,
|
||||
bytesReceived: Number,
|
||||
status: number,
|
||||
startTime: number,
|
||||
endTime: number,
|
||||
bytesSent: number,
|
||||
bytesReceived: number,
|
||||
body: string
|
||||
): void {
|
||||
return; // We add return; here to avoid any IDE / Compiler errors
|
||||
@@ -300,7 +300,7 @@ export class NewRelic extends AwesomeCordovaNativePlugin {
|
||||
@Cordova({
|
||||
sync: true,
|
||||
})
|
||||
noticeNetworkFailure(url: string, method: string, startTime: Number, endTime: Number, failure: string): void {
|
||||
noticeNetworkFailure(url: string, method: string, startTime: number, endTime: number, failure: string): void {
|
||||
return; // We add return; here to avoid any IDE / Compiler errors
|
||||
}
|
||||
|
||||
|
||||
@@ -851,7 +851,7 @@ export class OneSignal extends AwesomeCordovaNativePlugin {
|
||||
@Cordova({
|
||||
sync: true,
|
||||
})
|
||||
addTrigger(key: string, value: string | number | Object): void {}
|
||||
addTrigger(key: string, value: string | number | object): void {}
|
||||
|
||||
/**
|
||||
* Add a map of triggers. May show an In-App Message if its trigger conditions were met.
|
||||
@@ -861,7 +861,7 @@ export class OneSignal extends AwesomeCordovaNativePlugin {
|
||||
@Cordova({
|
||||
sync: true,
|
||||
})
|
||||
addTriggers(triggers: Object): void {}
|
||||
addTriggers(triggers: object): void {}
|
||||
|
||||
/**
|
||||
* Removes a single trigger for the given key. May show an In-App Message if its trigger conditions were met.
|
||||
@@ -890,7 +890,7 @@ export class OneSignal extends AwesomeCordovaNativePlugin {
|
||||
* @returns {Promise<string | number | Object>} Return value set with `addTrigger`, or `null`/`nil` (iOS) if never set or removed.
|
||||
*/
|
||||
@Cordova()
|
||||
getTriggerValueForKey(key: string): Promise<string | number | Object> {
|
||||
getTriggerValueForKey(key: string): Promise<string | number | object> {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ export interface CordovaFiniteObservableOptions extends CordovaOptions {
|
||||
*/
|
||||
export function CordovaFiniteObservable(opts: CordovaFiniteObservableOptions = {}) {
|
||||
opts.observable = true;
|
||||
return (target: Object, methodName: string, descriptor: TypedPropertyDescriptor<any>) => {
|
||||
return (target: object, methodName: string, descriptor: TypedPropertyDescriptor<any>) => {
|
||||
return {
|
||||
value(...args: any[]) {
|
||||
const wrappedObservable: Observable<any> = wrap(this, methodName, opts).apply(this, args);
|
||||
|
||||
@@ -8,7 +8,7 @@ declare const navigator: any;
|
||||
* @description Captures a screen shot
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Screenshot } from '@ionic-native/screenshot/ngx';
|
||||
* import { Screenshot } from '@awesome-cordova-plugins/screenshot/ngx';
|
||||
*
|
||||
* constructor(private screenshot: Screenshot) { }
|
||||
*
|
||||
|
||||
@@ -44,7 +44,7 @@ export interface Shortcut {
|
||||
* Please do refer to the original plugin's repo for detailed usage. The usage example here might not be sufficient.
|
||||
*
|
||||
* ```typescript
|
||||
* import { ShortcutsAndroid } from '@ionic-native/shortcuts-android/ngx';
|
||||
* import { ShortcutsAndroid } from '@awesome-cordova-plugins/shortcuts-android/ngx';
|
||||
*
|
||||
*
|
||||
* constructor(private shortcutsAndroid: ShortcutsAndroid) { }
|
||||
|
||||
@@ -118,9 +118,7 @@ export enum LoginType {
|
||||
* SAML 2.0 Login Type
|
||||
*/
|
||||
saml2 = 'SAML2',
|
||||
/**
|
||||
* TODO:
|
||||
*/
|
||||
/** Custom authentication */
|
||||
custom = 'CUSTOM',
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ export class WECapInbox extends AwesomeCordovaNativePlugin {
|
||||
* @returns {Promise<number>} - The count of notifications.
|
||||
*/
|
||||
@Cordova()
|
||||
getNotificationCount(successCallback: (count: String) => void, errorCallback: (error: string) => void): Promise<any> {
|
||||
getNotificationCount(successCallback: (count: string) => void, errorCallback: (error: string) => void): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user