npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@meecode/ng112-reg-js

v3.0.6

Published

## Table of Contents - [Installation](#Installation) - [Exposed Classes](#exposed-classes) - [Prerequisites](#Prerequisites) - [Usage](#Usage) - [Registration Client](#Registration-Client) - [Initializing the registration client](#initializi

Readme

ng112-reg-js

Table of Contents

Installation

npm install @meecode/ng112-reg-js

Exposed Classes

Prerequisites

  • Valid API Key
  • Registration service URL

Usage

Be aware that the import syntax depends on the environment you are using

Registration Client

Initializing the registration client

import { DEC112RegistrationClient, Settings } from '@meecode/ng112-reg-js/dist/node';

const registrationServer = 'https://your-registration-server-url/api/apiVersion';
const apiKey = 'yourApiKey';

const settings: Settings = new Settings(registrationServer, apiKey);
const instance = new DEC112RegistrationClient(settings);

Register a device

Follow these steps to register a device:

| Parameter | Required | |--------------------------------------------------------------------------------------------------|---------------| | Get root configuration and choose the appropriate registration endpoint | yes | | Normalize phone number | yes | | Register device | yes | | Send verification code | yes | | Resend verification code | no (Optional) | | Get configuration when verification was successful | yes | | Test configuration | no (Optional) |

The registrationId is very important and needs to be stored in order to send other queries. There is no possibility on recover a lost registrationId.

import { RegistrationData, Registration } from '@meecode/ng112-reg-js/dist/node';

const registrationServer = 'https://your-registration-server-url/api/apiVersion';
const apiKey = 'yourApiKey';
const settings: Settings = new Settings(registrationServer, apiKey);
const instance = new DEC112RegistrationClient(settings);

const normalizePhoneNumberData = new NormalizePhoneNumberData('066412345678', '0042');
const response = await instance.normalizePhoneNumber(normalizePhoneNumberData);

const registrationData = new RegistrationData('iPhone XS', 'en', response.normalizedPhoneNumber);
const registrationResponse = await instance.register(registrationData);

const phoneVerificationData = new PhoneVerificationData("4444-1111", registrationResponse.registrationId);
const verifyPhoneResponse = await instance.verifyPhoneNumber(phoneVerificationData);

const registrationInformationData = new RegistrationInformationData(registrationResponse.registrationId);
const deviceConfiguration = await instance.getConfiguration();

Error Handling

Every method returns Readonly<RequestError> in case one or more errors occur.

import { RegistrationData, Registration } from '@meecode/ng112-reg-js/dist/node';

const registrationServer = 'https://your-registration-server-url/api/apiVersion';
const apiKey = 'yourApiKey';
const settings: Settings = new Settings(registrationServer, apiKey);
const instance = new DEC112RegistrationClient(settings);

const registrationData = new RegistrationData('iPhone XS', 'en', '000011112222');
const registrationResponse = instance.register(registrationData)
    .catch((error: Readonly<RequestError>) => {
        //TODO: implement
    });

Usage in combination with ng112-js SDK

Query the app configuration after successful registration

import {
    Agent,
    DEC112Specifics,
} from 'ng112-js/dist/node';

const registrationServer = 'https://your-registration-server-url/api/apiVersion';
const apiKey = 'yourApiKey';
const settings: Settings = new Settings(registrationServer, apiKey);
const instance = new DEC112RegistrationClient(settings);
const registrationInformationData = new RegistrationInformationData('registrationId');

const configuration = await instance.getConfiguration(registrationInformationData);

const agenConfiguration = {
    endpoint: configuration.server,
    domain: configuration.realm,
    user: configuration.privateId,
    password: configuration.password,
    displayName: 'Your display name',
    namespaceSpecifics: new DEC112Specifics(undefined, configuration.registrationId, 'your language')
};
const agent = new Agent(agenConfiguration);

// Choose the appropriate service from the array of available services and use the sip property as conversation partner
const conversationPartner = configuration.services.default[0].sip;

agent.createConversation(conversationPartner);

Methods & Properties

DEC112RegistrationClient

The DEC112RegistrationClient is used to communicate with the corresponding registration service.

Constructor

constructor(settings)

| Parameter | Type | Default | Required | Description | |-----------|-------------------------|---------|----------|-------------------------------------------| | settings | Settings | null | yes | Settings used for initializing the client |

UpdateRegistrationServer

Update the registration server

updateRegistrationServer(registrationServer)

| Parameter | Type | Default | Required | Description | |--------------------|----------|---------|----------|--------------| | registrationServer | string | null | yes | |

GetConfiguration

Get the configuration for an already existing registration. The configuration can change, so it is recommended to check periodically if the configuration has changed.

getConfiguration(registrationInfo)

| Parameter | Type | Default | Required | Description | |-------------------------|---------------------------------------------------------------|---------|----------|--------------| | registrationInformation | RegistrationInformationData | null | yes | |

Returns a Promise which resolves with Readonly<AppConfiguration> when successful and rejects with Readonly<RequestError> when an error occurred.

GetRootConfiguration

The root configuration provides a list of DEC112 registries and other resources (e.g. language resources). Select the registry which should be used for the registration process.

getRootConfiguration()

No parameters required.

Returns a Promise which resolves with Readonly<RootConfiguration> when successful and rejects with Readonly<RequestError> when an error occurred.

NormalizePhoneNumber

normalizePhoneNumber(phoneNumberData)

| Parameter | Type | Default | Required | Description | |------------------|----------------------------------------------------------|---------|-----------|---------------| | phoneNumberData | NormalizePhoneNumberData | null | true | |

Returns a Promise which resolves with Readonly<NormalizedPhoneNumber> when successful and rejects with Readonly<RequestError> when an error occurred.

Register

Register a new user with the given registration information.

register(registrationData)

| Parameter | Type | Default | Required | Description | |------------------|-----------------------------------------|---------|----------|--------------| | registrationData | RegistrationData | null | yes |

Returns a Promise which resolves with Readonly<Registration> when successful and rejects with Readonly<RequestError> when an error occurred.

CheckRegistration

Check the registration data of an existing registration. Can also be used to check the registration state (e.g.: pending, ...)

Returns a Promise which resolves with Readonly<Registration> when successful and rejects with Readonly<RequestError> when an error occurred.

ResendPhoneVerificationCode

Allows resending a possibly lost phone verification SMS code up to two times.

resendPhoneVerificationCode(rendCodeData)

| Parameter | Type | Default | Required | Description | |----------------|------------------------------------------------------------------------|---------|----------|--------------| | resendCodeData | ResendPhoneVerificationCodeData | null | true | |

Returns a Promise which resolves with Readonly<ResendVerificationCode> when successful and rejects with Readonly<RequestError> when an error occurred.

Unregister

Deletes an existing Registration.

unregister(deleteRegistrationData)

| Parameter | Type | Default | Required | Description | |------------------------|-----------------------------------------------------|---------|----------|--------------| | deleteRegistrationData | DeleteRegistrationData | null | true | |

Returns a Promise which resolves with Readonly<DeleteRegistration> when successful and rejects with Readonly<RequestError> when an error occurred.

VerifyPhoneNumber

Verifies a registrations phone number.

verifyPhoneNumber(verificationData)

| Parameter | Type | Default | Required | Description | |------------------|---------------------------------------------------|---------|----------|--------------| | verificationData | PhoneVerificationData | null | true | |

Returns a Promise which resolves with Readonly<Registration> when successful and rejects with Readonly<RequestError> when an error occurred.

EnableDebug

Enables the debug mode which outputs also debug statements to the console.

enableDebug(true)

| Parameter | Type | Default | Required | Description | |-----------|---------|---------|----------|--------------| | enabled | boolean | null | true | |

IsDebugEnabled

Checks whether the debug mode is enabled or not.

isDebugEnabled()

PhoneVerificationData

| Property | Type | Default | Required | Description | |------------------|----------|---------|----------|--------------| | verificationCode | string | null | yes | | | registrationId | string | null | yes | |

RegistrationData

| Property | Type | Default | Required | Description | |-------------|----------|---------|----------|--------------| | model | string | null | no | | | language | string | null | yes | | | phoneNumber | string | null | yes | |

SaveRegistrationData

| Property | Type | Default | Required | Description | |----------------|----------|---------|----------|--------------| | registrationId | string | null | yes | | | phoneNumber | string | null | yes | | | data | object | null | yes | |

RegistrationInformationData

| Property | Type | Default | Required | Description | |----------------|----------|---------|----------|---------------------------------------------------------------------------------| | registrationId | string | null | yes | The registration id of the device which the configuration should be queried for |

DeleteRegistrationData

| Property | Type | Default | Required | Description | |----------------|----------| --- |----------|--------------| | registrationId | string | null | yes | | | phoneNumber | string | null | yes | |

RequestDataError

| Property | Type | Default | Required | Description | |----------|------|---------|----------|--------------|

Registration

| Property | Type | Description | |----------------------------|-------------------------------------------|--------------| | registrationId | string | | | language | string | | | state | RegistrationState | | | phoneVerificationTimeStamp | string | | | phonePrivacy | string | | | registrationTimeStamp | string | |

DeleteRegistration

| Property | Type | Description | |----------------|----------|--------------| | registrationId | string | |

AppConfiguration

Response of getConfiguration request

| Property | Type | Description | |----------------|-------------------------------|--------------| | registrationId | string | | | server | string | | | publicId | string | | | privateId | string | | | password | string | | | realm | string | | | services | AppServices | |

AppServices

| Property | Type | Description | |----------|---------------------|---------------------------------------------------------------------------------------| | service | Service | A Service element containing all available emergency services information | | app | App | A list of AppService elements used for test emergency calls |

RootConfiguration

| Property | Type | Description | |--------------------------|----------------------------------------------------------------------|--------------| | countryRegistryEndpoints | Array<CountryRegistrationEndpoint> | |

Settings

| Property | Type | Default | Required | Description | |--------------------|----------|----------|----------|-----------------------------------| | registrationServer | string | null | yes | | | apiKey | string | string | yes | The api key used for verification |

SettingsInvalidError

| Property | Type | Default | Required | Description | |----------|------------------------------------------------|---------|----------|--------------| | errors | Array<RequestDataError> | null | yes | |

NormalizePhoneNumberData

| Property | Type | Default | Required | Description | |-------------------|----------|---------|----------|----------------------------------| | phoneNumber | string | null | yes | | | phoneNumberPrefix | string | null | yes | The prefix for the phone number. | 0043 |

NormalizedPhoneNumber

| Property | Type | Default | Required | Description | Example(s) | |-----------------------|----------|---------|----------|--------------|------------| | phoneNumber | string | null | true | | | normalizedPhoneNumber | string | null | true | | | code | string | null | true | |

CheckRegistrationData

| Property | Type | Default | Required | Description | Example(s) | |----------------|----------|---------|----------|--------------|------------| | registrationId | string | null | true | |

ResendPhoneVerificationCodeData

Response of ResendPhoneVerificationCode request.

| Property | Type | Description | |----------------|----------|--------------| | registrationId | string | |

ResendVerificationCode

Request data for the ResendPhoneVerificationCode request.

| Property | Type | Default | Required | Description | |----------------|----------|---------|----------|--------------| | registrationId | string | null | yes |

RegistrationEndpoint

| Property | Type | Description | |----------|----------|--------------| | type | string | | | baseUrl | string | |

CountryRegistrationEndpoint

| Property | Type | Description | |-----------------------|--------------------------------------------------------|--------------| | name | string | | | registrationEndpoints | Array<RegistrationEndpoint> | |

RequestError

| Property | Type | Description | |------------|----------|--------------| | message | string | |
| value | string | |
| identifier | string | |

RegistrationState

Enum for the different registration states. Every value between 2 - 8 means ongoing verification process.

| Value | Integer Value | Description | |---------------------|---------------|-------------| | notRegistered | 0 | | | pendingRegistration | 1 | | | registrationError | 9 | | | registered | 10 | |

Service

Emergency service configuration

| Property | Type | Description | |-----------|---------------------------|-------------------------------------------------------| | services | Array<EmergencyService> | A list of EmergencyService items |
| message | Message | A Message object | | category | Category | A Message object |

EmergencyService

| Property | Type | Description | |------------|-----------------|----------------------------------------------------------| | in | string | Unique id for the server |
| enabled | boolean | A value indicating whether the service is enabled or not | | title | Translations | A Translations object | | category | string | | | urn | string | | | sip | string | | | icon | string | | | type | string | | | titleShort | Translations | A Translations object |

Message

| Property | Type | Description | |-----------------|-------------------|---------------------------------------------------| | defaultMessages | DefaultMessages | A DefaultMessages object |
| silentMessages | SilentMessages | A SilentMessages object |

Category

| Property | Type | Description | |-----------|---------------------|--------------------------------------------------| | emergency | EmergencyCategory | A EmergencyCategory object |
| test | TestCategory | A TestCategory object |

DefaultMessages

| Property | Type | Description | |------------|-----------------|-------------------------------------------------------------------------------------------------------| | start | Translations | The start message for an emergency call. A Translation object |
| stop | Translations | The stop message for an emergency call. A Translation object |
| background | Translations | The message when the device is sent to background. A Translation object |
| foreground | Translations | The message when the device is sent to foreground. A Translation object |
| internal | Translations | An internal message not intended to be sent to the call center. A Translation object |

SilentMessages

| Property | Type | Description | |-----------|-----------------|---------------------------------------------------------------------------------------| | start | Translations | The start message for a silent emergency call. A Translation object |

EmergencyCategory

| Property | Type | Description | |----------|----------------|---------------------------------------| | title | Translations | A Translation object |

TestCategory

| Property | Type | Description | |----------|----------------|---------------------------------------| | title | Translations | A Translation object |

Translations

Translations object

| Property | Type | Description | |----------|----------|---------------------------| | en | string | English translation text |
| de | string | German translation text |

App

App specific configuration

| Property | Type | Description | |-----------------|----------------|--------------------------------------| | notification | Notification | Notification object |
| environmentType | string | Current values: DEC112 or undefined |

Notification

Notification specific configuration

| Property | Type | Description | |---------------|----------|-------------| | appIdentifier | string | |

InAppSearch

| Property | Type | Description | |----------------|--------------------------|-------------| | emergencyCalls | Array<InAppSearchItem> | |

InAppSearchItem

| Property | Type | Description | |-------------|----------------------|-------------| | id | string | | | title | Translation | | | description | Translation | | | domain | string | | | keywords | Array<Translation> | |

Author

MeeCode by Mario Murrent

Special Thanks

For supporting the development:

Gebsl

License

UNLICENSED

Copyright

Copyright © 2021 - 2022, MeeCode by Mario Murrent. All Rights Reserved.

CI Status

Node.js CI