capacitor-appmetrica
Advanced tools
Comparing version 1.0.0-beta.3 to 1.0.0-beta.4
import { UserProfile } from './profile'; | ||
import type { AppmetricaActivateOptions, AppmetricaLocation } from './definitions'; | ||
export * from './definitions'; | ||
export * from './profile'; | ||
export declare class Appmetrica { | ||
@@ -5,0 +6,0 @@ private appmetrica; |
@@ -6,2 +6,3 @@ import { registerPlugin } from '@capacitor/core'; | ||
export * from './definitions'; | ||
export * from './profile'; | ||
export class Appmetrica { | ||
@@ -8,0 +9,0 @@ constructor() { |
@@ -7,2 +7,168 @@ 'use strict'; | ||
exports.Gender = void 0; | ||
(function (Gender) { | ||
Gender[Gender["MALE"] = 0] = "MALE"; | ||
Gender[Gender["FEMALE"] = 1] = "FEMALE"; | ||
Gender[Gender["OTHER"] = 2] = "OTHER"; | ||
})(exports.Gender || (exports.Gender = {})); | ||
class UserProfile { | ||
constructor() { | ||
this.updates = []; | ||
} | ||
apply(update) { | ||
this.updates.push(update); | ||
return this; | ||
} | ||
applyFromArray(updatesArray) { | ||
this.updates.push(...updatesArray); | ||
return this; | ||
} | ||
} | ||
class UserProfileUpdate { | ||
constructor(attributeName, methodName, key, ...values) { | ||
this.attributeName = attributeName; | ||
this.methodName = methodName; | ||
this.key = key; | ||
this.values = values; | ||
} | ||
} | ||
class BirthDateAttribute { | ||
constructor() { | ||
this.attributeName = 'birthDate'; | ||
} | ||
withAge(age) { | ||
return new UserProfileUpdate(this.attributeName, 'withAge', null, age); | ||
} | ||
withBirthDate(yearOrDate, month, day) { | ||
const args = []; | ||
if (typeof yearOrDate !== 'number') { | ||
args.push(yearOrDate.getDate(), yearOrDate.getMonth(), yearOrDate.getFullYear()); | ||
} | ||
else { | ||
args.push(yearOrDate); | ||
if (month !== undefined) | ||
args.push(month); | ||
if (day !== undefined) | ||
args.push(day); | ||
} | ||
return new UserProfileUpdate(this.attributeName, 'withBirthDate', null, ...args); | ||
} | ||
withValueReset() { | ||
return new UserProfileUpdate(this.attributeName, 'withValueReset', null); | ||
} | ||
} | ||
class GenderAttribute { | ||
constructor() { | ||
this.attributeName = 'gender'; | ||
} | ||
withValue(value) { | ||
return new UserProfileUpdate(this.attributeName, 'withValue', null, value.toString()); | ||
} | ||
withValueReset() { | ||
return new UserProfileUpdate(this.attributeName, 'withValueReset', null); | ||
} | ||
} | ||
class NameAttribute { | ||
constructor() { | ||
this.attributeName = 'name'; | ||
} | ||
withValue(value) { | ||
return new UserProfileUpdate(this.attributeName, 'withValue', null, value); | ||
} | ||
withValueReset() { | ||
return new UserProfileUpdate(this.attributeName, 'withValueReset', null); | ||
} | ||
} | ||
class NotificationsEnabledAttribute { | ||
constructor() { | ||
this.attributeName = 'notificationsEnabled'; | ||
} | ||
withValue(value) { | ||
return new UserProfileUpdate(this.attributeName, 'withValue', null, value); | ||
} | ||
withValueReset() { | ||
return new UserProfileUpdate(this.attributeName, 'withValueReset', null); | ||
} | ||
} | ||
class CustomBooleanAttribute { | ||
constructor(key) { | ||
this.attributeName = 'customBoolean'; | ||
this.key = key; | ||
} | ||
withValue(value) { | ||
return new UserProfileUpdate(this.attributeName, 'withValue', this.key, value); | ||
} | ||
withValueIfUndefined(value) { | ||
return new UserProfileUpdate(this.attributeName, 'withValueIfUndefined', this.key, value); | ||
} | ||
withValueReset() { | ||
return new UserProfileUpdate(this.attributeName, 'withValueReset', this.key); | ||
} | ||
} | ||
class CustomCounterAttribute { | ||
constructor(key) { | ||
this.attributeName = 'customCounter'; | ||
this.key = key; | ||
} | ||
withDelta(value) { | ||
return new UserProfileUpdate(this.attributeName, 'withDelta', this.key, value); | ||
} | ||
} | ||
class CustomNumberAttribute { | ||
constructor(key) { | ||
this.attributeName = 'customNumber'; | ||
this.key = key; | ||
} | ||
withValue(value) { | ||
return new UserProfileUpdate(this.attributeName, 'withValue', this.key, value); | ||
} | ||
withValueIfUndefined(value) { | ||
return new UserProfileUpdate(this.attributeName, 'withValueIfUndefined', this.key, value); | ||
} | ||
withValueReset() { | ||
return new UserProfileUpdate(this.attributeName, 'withValueReset', this.key); | ||
} | ||
} | ||
class CustomStringAttribute { | ||
constructor(key) { | ||
this.attributeName = 'customString'; | ||
this.key = key; | ||
} | ||
withValue(value) { | ||
return new UserProfileUpdate(this.attributeName, 'withValue', this.key, value); | ||
} | ||
withValueIfUndefined(value) { | ||
return new UserProfileUpdate(this.attributeName, 'withValueIfUndefined', this.key, value); | ||
} | ||
withValueReset() { | ||
return new UserProfileUpdate(this.attributeName, 'withValueReset', this.key); | ||
} | ||
} | ||
class ProfileAttribute { | ||
static BirthDate() { | ||
return new BirthDateAttribute(); | ||
} | ||
static Gender() { | ||
return new GenderAttribute(); | ||
} | ||
static Name() { | ||
return new NameAttribute(); | ||
} | ||
static NotificationsEnabled() { | ||
return new NotificationsEnabledAttribute(); | ||
} | ||
static CustomBool(key) { | ||
return new CustomBooleanAttribute(key); | ||
} | ||
static CustomCounter(key) { | ||
return new CustomCounterAttribute(key); | ||
} | ||
static CustomNumber(key) { | ||
return new CustomNumberAttribute(key); | ||
} | ||
static CustomString(key) { | ||
return new CustomStringAttribute(key); | ||
} | ||
} | ||
const CapacitorAppmetrica = core.registerPlugin('Appmetrica', { | ||
@@ -66,2 +232,13 @@ // web: () => import('./web').then(m => new m.AppmetricaWeb()), | ||
exports.Appmetrica = Appmetrica; | ||
exports.BirthDateAttribute = BirthDateAttribute; | ||
exports.CustomBooleanAttribute = CustomBooleanAttribute; | ||
exports.CustomCounterAttribute = CustomCounterAttribute; | ||
exports.CustomNumberAttribute = CustomNumberAttribute; | ||
exports.CustomStringAttribute = CustomStringAttribute; | ||
exports.GenderAttribute = GenderAttribute; | ||
exports.NameAttribute = NameAttribute; | ||
exports.NotificationsEnabledAttribute = NotificationsEnabledAttribute; | ||
exports.ProfileAttribute = ProfileAttribute; | ||
exports.UserProfile = UserProfile; | ||
exports.UserProfileUpdate = UserProfileUpdate; | ||
//# sourceMappingURL=plugin.cjs.js.map |
var capacitorAppmetrica = (function (exports, core) { | ||
'use strict'; | ||
exports.Gender = void 0; | ||
(function (Gender) { | ||
Gender[Gender["MALE"] = 0] = "MALE"; | ||
Gender[Gender["FEMALE"] = 1] = "FEMALE"; | ||
Gender[Gender["OTHER"] = 2] = "OTHER"; | ||
})(exports.Gender || (exports.Gender = {})); | ||
class UserProfile { | ||
constructor() { | ||
this.updates = []; | ||
} | ||
apply(update) { | ||
this.updates.push(update); | ||
return this; | ||
} | ||
applyFromArray(updatesArray) { | ||
this.updates.push(...updatesArray); | ||
return this; | ||
} | ||
} | ||
class UserProfileUpdate { | ||
constructor(attributeName, methodName, key, ...values) { | ||
this.attributeName = attributeName; | ||
this.methodName = methodName; | ||
this.key = key; | ||
this.values = values; | ||
} | ||
} | ||
class BirthDateAttribute { | ||
constructor() { | ||
this.attributeName = 'birthDate'; | ||
} | ||
withAge(age) { | ||
return new UserProfileUpdate(this.attributeName, 'withAge', null, age); | ||
} | ||
withBirthDate(yearOrDate, month, day) { | ||
const args = []; | ||
if (typeof yearOrDate !== 'number') { | ||
args.push(yearOrDate.getDate(), yearOrDate.getMonth(), yearOrDate.getFullYear()); | ||
} | ||
else { | ||
args.push(yearOrDate); | ||
if (month !== undefined) | ||
args.push(month); | ||
if (day !== undefined) | ||
args.push(day); | ||
} | ||
return new UserProfileUpdate(this.attributeName, 'withBirthDate', null, ...args); | ||
} | ||
withValueReset() { | ||
return new UserProfileUpdate(this.attributeName, 'withValueReset', null); | ||
} | ||
} | ||
class GenderAttribute { | ||
constructor() { | ||
this.attributeName = 'gender'; | ||
} | ||
withValue(value) { | ||
return new UserProfileUpdate(this.attributeName, 'withValue', null, value.toString()); | ||
} | ||
withValueReset() { | ||
return new UserProfileUpdate(this.attributeName, 'withValueReset', null); | ||
} | ||
} | ||
class NameAttribute { | ||
constructor() { | ||
this.attributeName = 'name'; | ||
} | ||
withValue(value) { | ||
return new UserProfileUpdate(this.attributeName, 'withValue', null, value); | ||
} | ||
withValueReset() { | ||
return new UserProfileUpdate(this.attributeName, 'withValueReset', null); | ||
} | ||
} | ||
class NotificationsEnabledAttribute { | ||
constructor() { | ||
this.attributeName = 'notificationsEnabled'; | ||
} | ||
withValue(value) { | ||
return new UserProfileUpdate(this.attributeName, 'withValue', null, value); | ||
} | ||
withValueReset() { | ||
return new UserProfileUpdate(this.attributeName, 'withValueReset', null); | ||
} | ||
} | ||
class CustomBooleanAttribute { | ||
constructor(key) { | ||
this.attributeName = 'customBoolean'; | ||
this.key = key; | ||
} | ||
withValue(value) { | ||
return new UserProfileUpdate(this.attributeName, 'withValue', this.key, value); | ||
} | ||
withValueIfUndefined(value) { | ||
return new UserProfileUpdate(this.attributeName, 'withValueIfUndefined', this.key, value); | ||
} | ||
withValueReset() { | ||
return new UserProfileUpdate(this.attributeName, 'withValueReset', this.key); | ||
} | ||
} | ||
class CustomCounterAttribute { | ||
constructor(key) { | ||
this.attributeName = 'customCounter'; | ||
this.key = key; | ||
} | ||
withDelta(value) { | ||
return new UserProfileUpdate(this.attributeName, 'withDelta', this.key, value); | ||
} | ||
} | ||
class CustomNumberAttribute { | ||
constructor(key) { | ||
this.attributeName = 'customNumber'; | ||
this.key = key; | ||
} | ||
withValue(value) { | ||
return new UserProfileUpdate(this.attributeName, 'withValue', this.key, value); | ||
} | ||
withValueIfUndefined(value) { | ||
return new UserProfileUpdate(this.attributeName, 'withValueIfUndefined', this.key, value); | ||
} | ||
withValueReset() { | ||
return new UserProfileUpdate(this.attributeName, 'withValueReset', this.key); | ||
} | ||
} | ||
class CustomStringAttribute { | ||
constructor(key) { | ||
this.attributeName = 'customString'; | ||
this.key = key; | ||
} | ||
withValue(value) { | ||
return new UserProfileUpdate(this.attributeName, 'withValue', this.key, value); | ||
} | ||
withValueIfUndefined(value) { | ||
return new UserProfileUpdate(this.attributeName, 'withValueIfUndefined', this.key, value); | ||
} | ||
withValueReset() { | ||
return new UserProfileUpdate(this.attributeName, 'withValueReset', this.key); | ||
} | ||
} | ||
class ProfileAttribute { | ||
static BirthDate() { | ||
return new BirthDateAttribute(); | ||
} | ||
static Gender() { | ||
return new GenderAttribute(); | ||
} | ||
static Name() { | ||
return new NameAttribute(); | ||
} | ||
static NotificationsEnabled() { | ||
return new NotificationsEnabledAttribute(); | ||
} | ||
static CustomBool(key) { | ||
return new CustomBooleanAttribute(key); | ||
} | ||
static CustomCounter(key) { | ||
return new CustomCounterAttribute(key); | ||
} | ||
static CustomNumber(key) { | ||
return new CustomNumberAttribute(key); | ||
} | ||
static CustomString(key) { | ||
return new CustomStringAttribute(key); | ||
} | ||
} | ||
const CapacitorAppmetrica = core.registerPlugin('Appmetrica', { | ||
@@ -62,2 +228,13 @@ // web: () => import('./web').then(m => new m.AppmetricaWeb()), | ||
exports.Appmetrica = Appmetrica; | ||
exports.BirthDateAttribute = BirthDateAttribute; | ||
exports.CustomBooleanAttribute = CustomBooleanAttribute; | ||
exports.CustomCounterAttribute = CustomCounterAttribute; | ||
exports.CustomNumberAttribute = CustomNumberAttribute; | ||
exports.CustomStringAttribute = CustomStringAttribute; | ||
exports.GenderAttribute = GenderAttribute; | ||
exports.NameAttribute = NameAttribute; | ||
exports.NotificationsEnabledAttribute = NotificationsEnabledAttribute; | ||
exports.ProfileAttribute = ProfileAttribute; | ||
exports.UserProfile = UserProfile; | ||
exports.UserProfileUpdate = UserProfileUpdate; | ||
@@ -64,0 +241,0 @@ Object.defineProperty(exports, '__esModule', { value: true }); |
{ | ||
"name": "capacitor-appmetrica", | ||
"version": "1.0.0-beta.3", | ||
"version": "1.0.0-beta.4", | ||
"description": "Appmetrica capacitor plugin", | ||
@@ -5,0 +5,0 @@ "main": "dist/plugin.cjs.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
119295
876
0