sms77-client
Advanced tools
Comparing version 2.2.0 to 2.3.0
@@ -1,2 +0,2 @@ | ||
import { AnalyticsParams, AnalyticsResponse, ContactsParams, ContactsResponse, LookupParams, LookupResponse, PricingParams, PricingResponse, SmsParams, SmsResponse, StatusParams, StatusResponse, ValidateForVoiceParams, ValidateForVoiceResponse, VoiceParams, VoiceResponse } from './types'; | ||
import { AnalyticsParams, AnalyticsResponse, ContactsParams, ContactsResponse, HooksParams, HooksResponse, LookupParams, LookupResponse, PricingParams, PricingResponse, SmsParams, SmsResponse, StatusParams, StatusResponse, ValidateForVoiceParams, ValidateForVoiceResponse, VoiceParams, VoiceResponse } from './types'; | ||
import { BaseClient } from './BaseClient'; | ||
@@ -8,2 +8,3 @@ export * from './types'; | ||
contacts: (p: ContactsParams) => Promise<ContactsResponse>; | ||
hooks: (p: HooksParams) => Promise<HooksResponse>; | ||
lookup: (p: LookupParams) => Promise<LookupResponse>; | ||
@@ -10,0 +11,0 @@ pricing: (p?: PricingParams | undefined) => Promise<PricingResponse>; |
@@ -363,2 +363,8 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Sms77Client = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | ||
}); }; | ||
_this.hooks = function (p) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.post(Endpoint_1.Endpoint.Hooks, p)]; | ||
case 1: return [2 /*return*/, _a.sent()]; | ||
} | ||
}); }); }; | ||
_this.lookup = function (p) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { | ||
@@ -475,2 +481,3 @@ switch (_a.label) { | ||
Endpoint["Contacts"] = "contacts"; | ||
Endpoint["Hooks"] = "hooks"; | ||
Endpoint["Lookup"] = "lookup"; | ||
@@ -641,4 +648,7 @@ Endpoint["Pricing"] = "pricing"; | ||
exports.__esModule = true; | ||
exports.HOOK_REQUEST_METHODS = exports.HOOK_EVENT_TYPES = void 0; | ||
exports.HOOK_EVENT_TYPES = ['dlr', 'voice_status', 'sms_mo']; | ||
exports.HOOK_REQUEST_METHODS = ['GET', 'POST']; | ||
},{}]},{},[1])(1) | ||
}); |
@@ -8,2 +8,3 @@ import { GSM_CODES } from './constants/GSM_CODES'; | ||
import { ANALYTICS_GROUPS, ANALYTICS_LABELS, ANALYTICS_SUBACCOUNTS, API_RESPONSE_CODES, CNAM_API_CODES, HLR_LOOKUP_OUTCOME_CODES, HLR_PORTED_CODES, HLR_REACHABLE_CODES, HLR_ROAMING_CODES, HLR_STATUS_MESSAGE_CODES, HLR_VALID_NUMBER_CODES, PRICING_FORMATS, ROAMING_STATUS_CODES, SMS_DEBUG_VALUES, SMS_ENCODINGS, SMS_SIGNATURE_POSITIONS, SMS_TYPES, STRING_BOOLEAN_VALUES, STRING_RESPONSE_CODES } from './constants/GENERAL'; | ||
import { HooksAction } from './constants/enums/HooksAction'; | ||
export declare type AnalyticBase = { | ||
@@ -112,10 +113,19 @@ direct: number; | ||
}; | ||
export declare type ContactsParams = { | ||
action: ContactsAction; | ||
export declare type ContactsBaseParams<A extends ContactsAction> = { | ||
action: A; | ||
json?: boolean; | ||
}; | ||
export declare type ContactsDelParams = ContactsBaseParams<ContactsAction.Del> & { | ||
id: number; | ||
}; | ||
export declare type ContactsReadParams = ContactsBaseParams<ContactsAction.Read> & { | ||
id?: number; | ||
}; | ||
export declare type ContactsWriteParams = ContactsBaseParams<ContactsAction.Write> & { | ||
email?: string; | ||
empfaenger?: string; | ||
id?: number; | ||
json?: boolean; | ||
nick?: string; | ||
}; | ||
export declare type ContactsParams = ContactsDelParams | ContactsReadParams | ContactsWriteParams; | ||
declare type BaseLookupParams<T extends LookupType> = { | ||
@@ -132,2 +142,17 @@ type: T; | ||
export declare type LookupParams = LookupCnamParams | LookupFormatParams | LookupHlrParams | LookupMnpParams; | ||
declare type HooksBaseParams<A extends HooksAction> = { | ||
action: A; | ||
}; | ||
export declare type HooksParams = HooksReadParams | HooksSubscribeParams | HooksUnsubscribeParams; | ||
export declare type HooksReadParams = HooksBaseParams<HooksAction.Read>; | ||
export declare const HOOK_EVENT_TYPES: readonly ["dlr", "voice_status", "sms_mo"]; | ||
export declare const HOOK_REQUEST_METHODS: readonly ["GET", "POST"]; | ||
export declare type HookEventType = (typeof HOOK_EVENT_TYPES)[number]; | ||
export declare type HookRequestMethod = (typeof HOOK_REQUEST_METHODS)[number]; | ||
export declare type HooksSubscribeParams = HooksBaseParams<HooksAction.Subscribe> & Omit<Hook, 'id' | 'created' | 'request_method'> & { | ||
request_method?: HookRequestMethod; | ||
}; | ||
export declare type HooksUnsubscribeParams = HooksBaseParams<HooksAction.Unsubscribe> & { | ||
id: number; | ||
}; | ||
export declare type PricingParams = { | ||
@@ -213,2 +238,26 @@ country?: string; | ||
export declare type FormatApiResponse = string | Format; | ||
export declare type HooksResponse = HooksReadSuccessResponse | HooksReadResponse<false> | HooksSubscribeSuccessResponse | HooksSubscribeErrorResponse | HooksUnsubscribeResponse; | ||
declare type HooksReadResponse<B extends boolean> = { | ||
success: B; | ||
}; | ||
export declare type Hook = { | ||
created: string; | ||
event_type: HookEventType; | ||
id: string; | ||
request_method: HookRequestMethod; | ||
target_url: string; | ||
}; | ||
export declare type HooksReadSuccessResponse = HooksReadResponse<true> & { | ||
hooks: Hook[]; | ||
}; | ||
declare type HooksSubscribeResponse<B extends boolean> = { | ||
success: B; | ||
}; | ||
export declare type HooksSubscribeSuccessResponse = HooksSubscribeResponse<true> & { | ||
id: number; | ||
}; | ||
export declare type HooksSubscribeErrorResponse = HooksSubscribeResponse<false>; | ||
export declare type HooksUnsubscribeResponse = { | ||
success: boolean; | ||
}; | ||
export declare type LookupResponse = string | number | FormatApiResponse | HLRApiResponse | CNAMApiResponse | MNPApiResponse; | ||
@@ -215,0 +264,0 @@ export declare type MNPApiJsonResponse = { |
@@ -11,2 +11,3 @@ { | ||
"@types/globalthis": "^1.0.1", | ||
"@types/uuid": "^8.3.0", | ||
"browserify": "^17.0.0", | ||
@@ -18,3 +19,4 @@ "jasmine-fail-fast": "^2.0.1", | ||
"tsify": "^5.0.2", | ||
"typescript": "^4.0.5" | ||
"typescript": "^4.0.5", | ||
"uuid": "^8.3.1" | ||
}, | ||
@@ -53,4 +55,4 @@ "files": [ | ||
"types": "dist/index.d.ts", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"homepage": "https://github.com/sms77io/js-client" | ||
} |
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
53021
1230
1
12