Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More โ†’
Socket
Sign inDemoInstall
Socket

@capacitor-community/contacts

Package Overview
Dependencies
Maintainers
35
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@capacitor-community/contacts - npm Package Compare versions

Comparing version 1.0.9 to 1.1.1

ios/Plugin/class/Permissions.swift

262

dist/docs.json

@@ -31,2 +31,20 @@ {

"slug": "getcontacts"
},
{
"name": "saveContact",
"signature": "(contact: NewContact) => any",
"parameters": [
{
"name": "contact",
"docs": "",
"type": "NewContact"
}
],
"returns": "any",
"tags": [],
"docs": "",
"complexTypes": [
"NewContact"
],
"slug": "savecontact"
}

@@ -167,5 +185,247 @@ ],

]
},
{
"name": "NewContact",
"slug": "newcontact",
"docs": "New contact schema.",
"tags": [
{
"text": "https://developer.apple.com/documentation/contacts/cnmutablecontact",
"name": "see"
},
{
"text": "android-link...",
"name": "see"
}
],
"methods": [],
"properties": [
{
"name": "contactType",
"tags": [],
"docs": "",
"complexTypes": [
"ContactType"
],
"type": "ContactType | undefined"
},
{
"name": "namePrefix",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "string | undefined"
},
{
"name": "givenName",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "string | undefined"
},
{
"name": "middleName",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "string | undefined"
},
{
"name": "familyName",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "string | undefined"
},
{
"name": "nameSuffix",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "string | undefined"
},
{
"name": "nickname",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "string | undefined"
},
{
"name": "jobTitle",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "string | undefined"
},
{
"name": "departmentName",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "string | undefined"
},
{
"name": "organizationName",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "string | undefined"
},
{
"name": "postalAddresses",
"tags": [],
"docs": "",
"complexTypes": [
"PostalAddress"
],
"type": "{} | undefined"
},
{
"name": "emailAddresses",
"tags": [],
"docs": "",
"complexTypes": [
"EmailAddress"
],
"type": "{} | undefined"
},
{
"name": "urlAddresses",
"tags": [],
"docs": "",
"complexTypes": [
"UrlAddress"
],
"type": "{} | undefined"
},
{
"name": "phoneNumbers",
"tags": [],
"docs": "",
"complexTypes": [
"PhoneNumber"
],
"type": "{} | undefined"
},
{
"name": "birthday",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "string | undefined"
},
{
"name": "note",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "string | undefined"
},
{
"name": "socialProfiles",
"tags": [],
"docs": "",
"complexTypes": [
"SocialProfile"
],
"type": "{} | undefined"
},
{
"name": "image",
"tags": [],
"docs": "Base64 image",
"complexTypes": [],
"type": "string | undefined"
}
]
},
{
"name": "PostalAddress",
"slug": "postaladdress",
"docs": "",
"tags": [],
"methods": [],
"properties": [
{
"name": "label",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "string | undefined"
},
{
"name": "address",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "{ street?: string | undefined; city?: string | undefined; state?: string | undefined; postalCode?: string | undefined; country?: string | undefined; } | undefined"
}
]
},
{
"name": "UrlAddress",
"slug": "urladdress",
"docs": "",
"tags": [],
"methods": [],
"properties": [
{
"name": "label",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "string | undefined"
},
{
"name": "url",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "string | undefined"
}
]
},
{
"name": "SocialProfile",
"slug": "socialprofile",
"docs": "",
"tags": [],
"methods": [],
"properties": [
{
"name": "label",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "string | undefined"
},
{
"name": "profile",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "{ username?: string | undefined; service?: string | undefined; urlString?: string | undefined; } | undefined"
}
]
}
],
"enums": []
"enums": [
{
"name": "ContactType",
"slug": "contacttype",
"members": [
{
"name": "Person",
"tags": [],
"docs": ""
},
{
"name": "Organization",
"tags": [],
"docs": ""
}
]
}
]
}

@@ -6,2 +6,3 @@ export interface ContactsPlugin {

}>;
saveContact(contact: NewContact): Promise<void>;
}

@@ -19,2 +20,28 @@ export interface PermissionStatus {

}
export interface UrlAddress {
label?: string;
url?: string;
}
export interface SocialProfile {
label?: string;
profile?: {
username?: string;
service?: string;
urlString?: string;
};
}
export interface PostalAddress {
label?: string;
address?: {
street?: string;
city?: string;
state?: string;
postalCode?: string;
country?: string;
};
}
export declare enum ContactType {
Person = 0,
Organization = 1
}
export interface Contact {

@@ -30,1 +57,28 @@ contactId: string;

}
/**
* New contact schema.
*
* @see https://developer.apple.com/documentation/contacts/cnmutablecontact
* @see android-link...
*/
export interface NewContact {
contactType?: ContactType;
namePrefix?: string;
givenName?: string;
middleName?: string;
familyName?: string;
nameSuffix?: string;
nickname?: string;
jobTitle?: string;
departmentName?: string;
organizationName?: string;
postalAddresses?: PostalAddress[];
emailAddresses?: EmailAddress[];
urlAddresses?: UrlAddress[];
phoneNumbers?: PhoneNumber[];
birthday?: string;
note?: string;
socialProfiles?: SocialProfile[];
/** Base64 image */
image?: string;
}

@@ -6,3 +6,7 @@ // declare module "@capacitor/core" {

// }
export {};
export var ContactType;
(function (ContactType) {
ContactType[ContactType["Person"] = 0] = "Person";
ContactType[ContactType["Organization"] = 1] = "Organization";
})(ContactType || (ContactType = {}));
//# sourceMappingURL=definitions.js.map

6

dist/esm/web.d.ts

@@ -1,3 +0,4 @@

import { WebPlugin } from "@capacitor/core";
import { ContactsPlugin, PermissionStatus, Contact } from "./definitions";
import { WebPlugin } from '@capacitor/core';
import type { NewContact } from '.';
import type { ContactsPlugin, PermissionStatus, Contact } from './definitions';
export declare class ContactsPluginWeb extends WebPlugin implements ContactsPlugin {

@@ -9,4 +10,5 @@ constructor();

}>;
saveContact(_: NewContact): Promise<void>;
}
declare const Contacts: ContactsPluginWeb;
export { Contacts };

@@ -1,15 +0,19 @@

import { WebPlugin } from "@capacitor/core";
import { WebPlugin } from '@capacitor/core';
export class ContactsPluginWeb extends WebPlugin {
constructor() {
super({
name: "CapContacts",
platforms: ["web"],
name: 'CapContacts',
platforms: ['web'],
});
}
async getPermissions() {
throw new Error("getPermission not available");
throw new Error('getPermission not available');
}
async getContacts() {
throw new Error("getContacts not available");
throw new Error('getContacts not available');
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async saveContact(_) {
throw new Error('getContacts not available');
}
}

@@ -16,0 +20,0 @@ const Contacts = new ContactsPluginWeb();

@@ -7,2 +7,13 @@ 'use strict';

// declare module "@capacitor/core" {
// interface PluginRegistry {
// Contacts: ContactsPlugin;
// }
// }
exports.ContactType = void 0;
(function (ContactType) {
ContactType[ContactType["Person"] = 0] = "Person";
ContactType[ContactType["Organization"] = 1] = "Organization";
})(exports.ContactType || (exports.ContactType = {}));
const Contacts$1 = core.registerPlugin('Contacts', {

@@ -15,12 +26,16 @@ web: () => Promise.resolve().then(function () { return web; }).then(m => new m.ContactsPluginWeb()),

super({
name: "CapContacts",
platforms: ["web"],
name: 'CapContacts',
platforms: ['web'],
});
}
async getPermissions() {
throw new Error("getPermission not available");
throw new Error('getPermission not available');
}
async getContacts() {
throw new Error("getContacts not available");
throw new Error('getContacts not available');
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async saveContact(_) {
throw new Error('getContacts not available');
}
}

@@ -27,0 +42,0 @@ const Contacts = new ContactsPluginWeb();

var capacitorContacts = (function (exports, core) {
'use strict';
// declare module "@capacitor/core" {
// interface PluginRegistry {
// Contacts: ContactsPlugin;
// }
// }
exports.ContactType = void 0;
(function (ContactType) {
ContactType[ContactType["Person"] = 0] = "Person";
ContactType[ContactType["Organization"] = 1] = "Organization";
})(exports.ContactType || (exports.ContactType = {}));
const Contacts$1 = core.registerPlugin('Contacts', {

@@ -11,12 +22,16 @@ web: () => Promise.resolve().then(function () { return web; }).then(m => new m.ContactsPluginWeb()),

super({
name: "CapContacts",
platforms: ["web"],
name: 'CapContacts',
platforms: ['web'],
});
}
async getPermissions() {
throw new Error("getPermission not available");
throw new Error('getPermission not available');
}
async getContacts() {
throw new Error("getContacts not available");
throw new Error('getContacts not available');
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async saveContact(_) {
throw new Error('getContacts not available');
}
}

@@ -23,0 +38,0 @@ const Contacts = new ContactsPluginWeb();

{
"name": "@capacitor-community/contacts",
"version": "1.0.9",
"version": "1.1.1",
"description": "Contacts Plugin for Capacitor",

@@ -36,3 +36,3 @@ "main": "dist/plugin.cjs.js",

"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- autocorrect --format",
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix",
"eslint": "eslint . --ext ts",

@@ -56,2 +56,3 @@ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"",

"@ionic/swiftlint-config": "^1.1.2",
"all-contributors-cli": "^6.20.0",
"eslint": "^7.11.0",

@@ -58,0 +59,0 @@ "prettier": "~2.2.0",

@@ -13,7 +13,7 @@ <p align="center"><br><img src="https://user-images.githubusercontent.com/236501/85893648-1c92e880-b7a8-11ea-926d-95355b8175c7.png" width="128" height="128" /></p>

<a href="https://www.npmjs.com/package/@capacitor-community/contacts"><img src="https://img.shields.io/npm/l/@capacitor-community/contacts?style=flat-square" /></a>
<br>
<br>
<a href="https://www.npmjs.com/package/@capacitor-community/contacts"><img src="https://img.shields.io/npm/dw/@capacitor-community/contacts?style=flat-square" /></a>
<a href="https://www.npmjs.com/package/@capacitor-community/contacts"><img src="https://img.shields.io/npm/v/@capacitor-community/contacts?style=flat-square" /></a>
</p>
## Maintainers

@@ -41,3 +41,3 @@

Initalize Capacitor
Initialize Capacitor

@@ -87,3 +87,3 @@ ```

For Android you have to add the permisions in your AndroidManifest.xml. Add the following permissions before the closing of the "manifest" tag.
For Android you have to add the permissions in your AndroidManifest.xml. Add the following permissions before the closing of the "manifest" tag.

@@ -125,3 +125,3 @@ ```

If you're considering to use this plugin you most likely want to retrive contacts a users contacts:
If you're considering to use this plugin you most likely want to retrieve contacts a users contacts:

@@ -131,4 +131,3 @@ Import the Plugin in your TS file:

```
import { Plugins } from "@capacitor/core";
const { Contacts } = Plugins;
import { Contacts } from '@capacitor-community/contacts'
```

@@ -148,3 +147,3 @@

That's it. Do Whatever you want with the retrived contacts.
That's it. Do Whatever you want with the retrieved contacts.

@@ -206,18 +205,17 @@ If you're trying to build something like "contacts matching" based on phone numbers i recommend using google libphonenumber: https://www.npmjs.com/package/google-libphonenumber

<tr>
<td align="center"><a href="https://github.com/Idrimi"><img src="https://avatars0.githubusercontent.com/u/24573405?v=4?s=100" width="100px;" alt=""/><br /><sub><b>idrimi</b></sub></a><br /><a href="https://github.com/idrimi (Jonathan Gerber)/contacts/commits?author=Idrimi" title="Code">๐Ÿ’ป</a></td>
<td align="center"><a href="https://github.com/tafelnl"><img src="https://avatars2.githubusercontent.com/u/35837839?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tafel</b></sub></a><br /><a href="https://github.com/idrimi (Jonathan Gerber)/contacts/commits?author=tafelnl" title="Code">๐Ÿ’ป</a></td>
<td align="center"><a href="http://ionicframework.com/"><img src="https://avatars3.githubusercontent.com/u/11214?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Max Lynch</b></sub></a><br /><a href="https://github.com/idrimi (Jonathan Gerber)/contacts/commits?author=mlynch" title="Documentation">๐Ÿ“–</a> <a href="#eventOrganizing-mlynch" title="Event Organizing">๐Ÿ“‹</a></td>
<td align="center"><a href="https://github.com/david-garzon-adl"><img src="https://avatars0.githubusercontent.com/u/45822796?v=4?s=100" width="100px;" alt=""/><br /><sub><b>David Javier Garzon Carrillo</b></sub></a><br /><a href="https://github.com/idrimi (Jonathan Gerber)/contacts/commits?author=david-garzon-adl" title="Code">๐Ÿ’ป</a></td>
<td align="center"><a href="https://github.com/vhinic"><img src="https://avatars.githubusercontent.com/u/244439?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Vladimir Hiniฤ‡</b></sub></a><br /><a href="https://github.com/idrimi (Jonathan Gerber)/contacts/commits?author=vhinic" title="Code">๐Ÿ’ป</a></td>
<td align="center"><a href="https://github.com/Idrimi"><img src="https://avatars0.githubusercontent.com/u/24573405?v=4?s=100" width="100px;" alt=""/><br /><sub><b>idrimi</b></sub></a><br /><a href="https://github.com/capacitor-community/contacts/commits?author=Idrimi" title="Code">๐Ÿ’ป</a></td>
<td align="center"><a href="https://github.com/tafelnl"><img src="https://avatars2.githubusercontent.com/u/35837839?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tafel</b></sub></a><br /><a href="https://github.com/capacitor-community/contacts/commits?author=tafelnl" title="Code">๐Ÿ’ป</a></td>
<td align="center"><a href="http://ionicframework.com/"><img src="https://avatars3.githubusercontent.com/u/11214?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Max Lynch</b></sub></a><br /><a href="https://github.com/capacitor-community/contacts/commits?author=mlynch" title="Documentation">๐Ÿ“–</a> <a href="#eventOrganizing-mlynch" title="Event Organizing">๐Ÿ“‹</a></td>
<td align="center"><a href="https://github.com/david-garzon-adl"><img src="https://avatars0.githubusercontent.com/u/45822796?v=4?s=100" width="100px;" alt=""/><br /><sub><b>David Javier Garzon Carrillo</b></sub></a><br /><a href="https://github.com/capacitor-community/contacts/commits?author=david-garzon-adl" title="Code">๐Ÿ’ป</a></td>
<td align="center"><a href="https://github.com/vhinic"><img src="https://avatars.githubusercontent.com/u/244439?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Vladimir Hiniฤ‡</b></sub></a><br /><a href="https://github.com/capacitor-community/contacts/commits?author=vhinic" title="Code">๐Ÿ’ป</a></td>
<td align="center"><a href="https://t.me/reslear"><img src="https://avatars.githubusercontent.com/u/12596485?v=4?s=100" width="100px;" alt=""/><br /><sub><b>reslear</b></sub></a><br /><a href="https://github.com/capacitor-community/contacts/commits?author=reslear" title="Documentation">๐Ÿ“–</a></td>
<td align="center"><a href="https://marvin.digital/"><img src="https://avatars.githubusercontent.com/u/11534760?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Marvin Heilemann</b></sub></a><br /><a href="https://github.com/capacitor-community/contacts/commits?author=muuvmuuv" title="Code">๐Ÿ’ป</a> <a href="https://github.com/capacitor-community/contacts/commits?author=muuvmuuv" title="Documentation">๐Ÿ“–</a></td>
</tr>
</table>
<!-- markdownlint-restore -->
<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
<!-- prettier-ignore -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
## API

@@ -229,3 +227,5 @@

* [`getContacts()`](#getcontacts)
* [`saveContact(...)`](#savecontact)
* [Interfaces](#interfaces)
* [Enums](#enums)

@@ -259,2 +259,17 @@ </docgen-index>

### saveContact(...)
```typescript
saveContact(contact: NewContact) => any
```
| Param | Type |
| ------------- | ------------------------------------------------- |
| **`contact`** | <code><a href="#newcontact">NewContact</a></code> |
**Returns:** <code>any</code>
--------------------
### Interfaces

@@ -299,2 +314,63 @@

#### NewContact
New contact schema.
| Prop | Type | Description |
| ---------------------- | --------------------------------------------------- | ------------ |
| **`contactType`** | <code><a href="#contacttype">ContactType</a></code> | |
| **`namePrefix`** | <code>string</code> | |
| **`givenName`** | <code>string</code> | |
| **`middleName`** | <code>string</code> | |
| **`familyName`** | <code>string</code> | |
| **`nameSuffix`** | <code>string</code> | |
| **`nickname`** | <code>string</code> | |
| **`jobTitle`** | <code>string</code> | |
| **`departmentName`** | <code>string</code> | |
| **`organizationName`** | <code>string</code> | |
| **`postalAddresses`** | <code>{}</code> | |
| **`emailAddresses`** | <code>{}</code> | |
| **`urlAddresses`** | <code>{}</code> | |
| **`phoneNumbers`** | <code>{}</code> | |
| **`birthday`** | <code>string</code> | |
| **`note`** | <code>string</code> | |
| **`socialProfiles`** | <code>{}</code> | |
| **`image`** | <code>string</code> | Base64 image |
#### PostalAddress
| Prop | Type |
| ------------- | ------------------------------------------------------------------------------------------------------- |
| **`label`** | <code>string</code> |
| **`address`** | <code>{ street?: string; city?: string; state?: string; postalCode?: string; country?: string; }</code> |
#### UrlAddress
| Prop | Type |
| ----------- | ------------------- |
| **`label`** | <code>string</code> |
| **`url`** | <code>string</code> |
#### SocialProfile
| Prop | Type |
| ------------- | ------------------------------------------------------------------------- |
| **`label`** | <code>string</code> |
| **`profile`** | <code>{ username?: string; service?: string; urlString?: string; }</code> |
### Enums
#### ContactType
| Members |
| ------------------ |
| **`Person`** |
| **`Organization`** |
</docgen-api>

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

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with โšก๏ธ by Socket Inc