@sinch/fax 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +126 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +18 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/v3/bar-code/bar-code.d.ts +11 -0
- package/dist/models/v3/bar-code/bar-code.js +3 -0
- package/dist/models/v3/bar-code/bar-code.js.map +1 -0
- package/dist/models/v3/bar-code/index.d.ts +1 -0
- package/dist/models/v3/bar-code/index.js +3 -0
- package/dist/models/v3/bar-code/index.js.map +1 -0
- package/dist/models/v3/email/email.d.ts +12 -0
- package/dist/models/v3/email/email.js +3 -0
- package/dist/models/v3/email/email.js.map +1 -0
- package/dist/models/v3/email/index.d.ts +1 -0
- package/dist/models/v3/email/index.js +3 -0
- package/dist/models/v3/email/index.js.map +1 -0
- package/dist/models/v3/enums.d.ts +16 -0
- package/dist/models/v3/enums.js +10 -0
- package/dist/models/v3/enums.js.map +1 -0
- package/dist/models/v3/fax/fax.d.ts +62 -0
- package/dist/models/v3/fax/fax.js +3 -0
- package/dist/models/v3/fax/fax.js.map +1 -0
- package/dist/models/v3/fax/index.d.ts +1 -0
- package/dist/models/v3/fax/index.js +3 -0
- package/dist/models/v3/fax/index.js.map +1 -0
- package/dist/models/v3/fax-base64-file/fax-base64-file.d.ts +7 -0
- package/dist/models/v3/fax-base64-file/fax-base64-file.js +3 -0
- package/dist/models/v3/fax-base64-file/fax-base64-file.js.map +1 -0
- package/dist/models/v3/fax-base64-file/index.d.ts +1 -0
- package/dist/models/v3/fax-base64-file/index.js +3 -0
- package/dist/models/v3/fax-base64-file/index.js.map +1 -0
- package/dist/models/v3/fax-content-url/fax-content-url.d.ts +4 -0
- package/dist/models/v3/fax-content-url/fax-content-url.js +3 -0
- package/dist/models/v3/fax-content-url/fax-content-url.js.map +1 -0
- package/dist/models/v3/fax-content-url/index.d.ts +1 -0
- package/dist/models/v3/fax-content-url/index.js +3 -0
- package/dist/models/v3/fax-content-url/index.js.map +1 -0
- package/dist/models/v3/fax-money/fax-money.d.ts +9 -0
- package/dist/models/v3/fax-money/fax-money.js +3 -0
- package/dist/models/v3/fax-money/fax-money.js.map +1 -0
- package/dist/models/v3/fax-money/index.d.ts +1 -0
- package/dist/models/v3/fax-money/index.js +3 -0
- package/dist/models/v3/fax-money/index.js.map +1 -0
- package/dist/models/v3/fax-request/fax-request.d.ts +43 -0
- package/dist/models/v3/fax-request/fax-request.js +3 -0
- package/dist/models/v3/fax-request/fax-request.js.map +1 -0
- package/dist/models/v3/fax-request/index.d.ts +1 -0
- package/dist/models/v3/fax-request/index.js +3 -0
- package/dist/models/v3/fax-request/index.js.map +1 -0
- package/dist/models/v3/index.d.ts +13 -0
- package/dist/models/v3/index.js +47 -0
- package/dist/models/v3/index.js.map +1 -0
- package/dist/models/v3/mod-events/base-fax-event/base-fax-event.d.ts +16 -0
- package/dist/models/v3/mod-events/base-fax-event/base-fax-event.js +3 -0
- package/dist/models/v3/mod-events/base-fax-event/base-fax-event.js.map +1 -0
- package/dist/models/v3/mod-events/base-fax-event/index.d.ts +1 -0
- package/dist/models/v3/mod-events/base-fax-event/index.js +3 -0
- package/dist/models/v3/mod-events/base-fax-event/index.js.map +1 -0
- package/dist/models/v3/mod-events/fax-completed-event/fax-completed-event.d.ts +13 -0
- package/dist/models/v3/mod-events/fax-completed-event/fax-completed-event.js +3 -0
- package/dist/models/v3/mod-events/fax-completed-event/fax-completed-event.js.map +1 -0
- package/dist/models/v3/mod-events/fax-completed-event/index.d.ts +1 -0
- package/dist/models/v3/mod-events/fax-completed-event/index.js +3 -0
- package/dist/models/v3/mod-events/fax-completed-event/index.js.map +1 -0
- package/dist/models/v3/mod-events/incoming-fax-event/incoming-fax-event.d.ts +15 -0
- package/dist/models/v3/mod-events/incoming-fax-event/incoming-fax-event.js +3 -0
- package/dist/models/v3/mod-events/incoming-fax-event/incoming-fax-event.js.map +1 -0
- package/dist/models/v3/mod-events/incoming-fax-event/index.d.ts +1 -0
- package/dist/models/v3/mod-events/incoming-fax-event/index.js +3 -0
- package/dist/models/v3/mod-events/incoming-fax-event/index.js.map +1 -0
- package/dist/models/v3/mod-events/index.d.ts +2 -0
- package/dist/models/v3/mod-events/index.js +19 -0
- package/dist/models/v3/mod-events/index.js.map +1 -0
- package/dist/models/v3/service/index.d.ts +1 -0
- package/dist/models/v3/service/index.js +3 -0
- package/dist/models/v3/service/index.js.map +1 -0
- package/dist/models/v3/service/service.d.ts +35 -0
- package/dist/models/v3/service/service.js +3 -0
- package/dist/models/v3/service/service.js.map +1 -0
- package/dist/models/v3/service-email-settings/index.d.ts +1 -0
- package/dist/models/v3/service-email-settings/index.js +3 -0
- package/dist/models/v3/service-email-settings/index.js.map +1 -0
- package/dist/models/v3/service-email-settings/service-email-settings.d.ts +6 -0
- package/dist/models/v3/service-email-settings/service-email-settings.js +3 -0
- package/dist/models/v3/service-email-settings/service-email-settings.js.map +1 -0
- package/dist/models/v3/service-phone-number/index.d.ts +1 -0
- package/dist/models/v3/service-phone-number/index.js +3 -0
- package/dist/models/v3/service-phone-number/index.js.map +1 -0
- package/dist/models/v3/service-phone-number/service-phone-number.d.ts +8 -0
- package/dist/models/v3/service-phone-number/service-phone-number.js +3 -0
- package/dist/models/v3/service-phone-number/service-phone-number.js.map +1 -0
- package/dist/models/v3/update-email-request/index.d.ts +1 -0
- package/dist/models/v3/update-email-request/index.js +3 -0
- package/dist/models/v3/update-email-request/index.js.map +1 -0
- package/dist/models/v3/update-email-request/update-email-request.d.ts +4 -0
- package/dist/models/v3/update-email-request/update-email-request.js +3 -0
- package/dist/models/v3/update-email-request/update-email-request.js.map +1 -0
- package/dist/rest/index.d.ts +1 -0
- package/dist/rest/index.js +18 -0
- package/dist/rest/index.js.map +1 -0
- package/dist/rest/v3/callbacks/callbacks-webhook.d.ts +16 -0
- package/dist/rest/v3/callbacks/callbacks-webhook.js +61 -0
- package/dist/rest/v3/callbacks/callbacks-webhook.js.map +1 -0
- package/dist/rest/v3/callbacks/index.d.ts +1 -0
- package/dist/rest/v3/callbacks/index.js +18 -0
- package/dist/rest/v3/callbacks/index.js.map +1 -0
- package/dist/rest/v3/emails/emails-api.d.ts +71 -0
- package/dist/rest/v3/emails/emails-api.jest.fixture.d.ts +26 -0
- package/dist/rest/v3/emails/emails-api.jest.fixture.js +29 -0
- package/dist/rest/v3/emails/emails-api.jest.fixture.js.map +1 -0
- package/dist/rest/v3/emails/emails-api.js +148 -0
- package/dist/rest/v3/emails/emails-api.js.map +1 -0
- package/dist/rest/v3/emails/index.d.ts +2 -0
- package/dist/rest/v3/emails/index.js +19 -0
- package/dist/rest/v3/emails/index.js.map +1 -0
- package/dist/rest/v3/enums.d.ts +1 -0
- package/dist/rest/v3/enums.js +3 -0
- package/dist/rest/v3/enums.js.map +1 -0
- package/dist/rest/v3/fax-domain-api.d.ts +26 -0
- package/dist/rest/v3/fax-domain-api.js +68 -0
- package/dist/rest/v3/fax-domain-api.js.map +1 -0
- package/dist/rest/v3/fax-service.d.ts +16 -0
- package/dist/rest/v3/fax-service.js +25 -0
- package/dist/rest/v3/fax-service.js.map +1 -0
- package/dist/rest/v3/faxes/faxes-api.d.ts +85 -0
- package/dist/rest/v3/faxes/faxes-api.jest.fixture.d.ts +26 -0
- package/dist/rest/v3/faxes/faxes-api.jest.fixture.js +29 -0
- package/dist/rest/v3/faxes/faxes-api.jest.fixture.js.map +1 -0
- package/dist/rest/v3/faxes/faxes-api.js +222 -0
- package/dist/rest/v3/faxes/faxes-api.js.map +1 -0
- package/dist/rest/v3/faxes/index.d.ts +2 -0
- package/dist/rest/v3/faxes/index.js +19 -0
- package/dist/rest/v3/faxes/index.js.map +1 -0
- package/dist/rest/v3/index.d.ts +6 -0
- package/dist/rest/v3/index.js +23 -0
- package/dist/rest/v3/index.js.map +1 -0
- package/dist/rest/v3/services/index.d.ts +2 -0
- package/dist/rest/v3/services/index.js +19 -0
- package/dist/rest/v3/services/index.js.map +1 -0
- package/dist/rest/v3/services/services-api.d.ts +98 -0
- package/dist/rest/v3/services/services-api.jest.fixture.d.ts +34 -0
- package/dist/rest/v3/services/services-api.jest.fixture.js +37 -0
- package/dist/rest/v3/services/services-api.jest.fixture.js.map +1 -0
- package/dist/rest/v3/services/services-api.js +199 -0
- package/dist/rest/v3/services/services-api.js.map +1 -0
- package/package.json +37 -0
package/README.md
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Sinch Fax SDK for Node.js
|
|
2
|
+
|
|
3
|
+
This package contains the Sinch Fax SDK for Node.js for use with [Sinch APIs](https://developers.sinch.com/). To use it, you will need a Sinch account. Please [sign up](https://dashboard.sinch.com/signup) or [log in](https://dashboard.sinch.com/login) if you already have one.
|
|
4
|
+
|
|
5
|
+
<span style="color:red; font-weight:bold">Warning:</span>
|
|
6
|
+
**This SDK is currently available for preview purposes only. It should not be used in production environments.**
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
We recommend to use this SDK as part of the [`@sinch/sdk-core`](../../packages/sdk-core) package in order to make the most out of all the Sinch products.
|
|
11
|
+
|
|
12
|
+
However, it's still possible to use this SDK standalone is you need to access the Fax API only.
|
|
13
|
+
|
|
14
|
+
### With NPM
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @sinch/fax
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### With Yarn
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
yarn add @sinch/fax
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
### Credentials
|
|
29
|
+
|
|
30
|
+
The `Fax` API uses the Sinch unified authentication with OAuth2. You will need to provide the following credentials:
|
|
31
|
+
- projectId: can be found in the [Account Dashboard](https://dashboard.sinch.com/settings/access-keys)
|
|
32
|
+
- keyId:: can be found in your Access key list in the [Account Dashboard](https://dashboard.sinch.com/settings/access-keys)
|
|
33
|
+
- keySecret: can be found **ONLY** when generating a new access key: keep it safe!
|
|
34
|
+
|
|
35
|
+
### As part of the Sinch SDK
|
|
36
|
+
|
|
37
|
+
If you are using this SDK as part of the Sinch SDK (`@sinch/sdk-core`) you can access it as the `fax` property of the client that you would have instantiated.
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import {
|
|
41
|
+
FaxService,
|
|
42
|
+
SendFaxRequestData,
|
|
43
|
+
SinchClient,
|
|
44
|
+
UnifiedCredentials,
|
|
45
|
+
} from '@sinch/sdk-core';
|
|
46
|
+
|
|
47
|
+
const credentials: UnifiedCredentials = {
|
|
48
|
+
projectId: 'PROJECT_ID',
|
|
49
|
+
keyId: 'KEY_ID',
|
|
50
|
+
keySecret: 'KEY_SECRET',
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
// Access the 'fax' service registered on the Sinch Client
|
|
54
|
+
const sinch = new SinchClient(credentials);
|
|
55
|
+
const faxService: FaxService = sinch.fax;
|
|
56
|
+
|
|
57
|
+
// Build the request data
|
|
58
|
+
const requestData: SendFaxRequestData = {
|
|
59
|
+
sendFaxRequestBody: {
|
|
60
|
+
to: '+12015555555',
|
|
61
|
+
contentUrl: 'https://developers.sinch.com/fax/fax.pdf',
|
|
62
|
+
callbackUrl: 'https://yourserver/incomingFax',
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// Use the 'fax' service registered on the Sinch client
|
|
67
|
+
const response = await faxService.faxes.send(requestData);
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Standalone
|
|
71
|
+
|
|
72
|
+
The SDK can be used standalone if you need to use only the Fax APIs.
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
import {
|
|
76
|
+
UnifiedCredentials,
|
|
77
|
+
} from '@sinch/sdk-client';
|
|
78
|
+
import {
|
|
79
|
+
FaxService,
|
|
80
|
+
SendFaxRequestData,
|
|
81
|
+
} from '@sinch/fax';
|
|
82
|
+
|
|
83
|
+
const credentials: UnifiedCredentials = {
|
|
84
|
+
projectId: 'PROJECT_ID',
|
|
85
|
+
keyId: 'KEY_ID',
|
|
86
|
+
keySecret: 'KEY_SECRET',
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// Declare the 'fax' service in a standalone way
|
|
90
|
+
const faxService = new FaxService(credentials);
|
|
91
|
+
|
|
92
|
+
// Build the request data
|
|
93
|
+
const requestData: SendFaxRequestData = {
|
|
94
|
+
sendFaxRequestBody: {
|
|
95
|
+
to: '+12015555555',
|
|
96
|
+
contentUrl: 'https://developers.sinch.com/fax/fax.pdf',
|
|
97
|
+
callbackUrl: 'https://yourserver/incomingFax',
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
// Use the standalone declaration of the 'fax' service
|
|
102
|
+
const response = await faxService.faxes.send(requestData);
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Promises
|
|
106
|
+
|
|
107
|
+
All the methods that interact with the Sinch APIs use Promises. You can use `await` in an `async` method to wait for the response, or you can resolve them yourself with `then()` / `catch()`.
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
// Method 1: Wait for the Promise to complete (you need to be in an 'async' method)
|
|
111
|
+
let sendFaxResult: Fax;
|
|
112
|
+
try {
|
|
113
|
+
sendFaxResult = await faxService.faxes.send(requestData);
|
|
114
|
+
console.log(`Fax successfully created at '${sendFaxResult.createTime}'. Status = '${sendFaxResult.status}`);
|
|
115
|
+
} catch (error: any) {
|
|
116
|
+
console.error(`ERROR ${error.statusCode}: Impossible to crete the fax sent to ${requestdata.to}.`);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Method 2: Resolve the promise
|
|
120
|
+
faxService.faxes.send(requestData)
|
|
121
|
+
.then(response => console.log(`Fax successfully created at '${sendFaxResult.createTime}'. Status = '${sendFaxResult.status}`))
|
|
122
|
+
.catch(error => console.error(`ERROR ${error.statusCode}: Impossible to crete the fax sent to ${requestdata.to}.`));
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Contact
|
|
126
|
+
Developer Experience team: [devexp@sinch.com](mailto:devexp@sinch.com)
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./models"), exports);
|
|
18
|
+
__exportStar(require("./rest"), exports);
|
|
19
|
+
__exportStar(require("@sinch/sdk-client"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,yCAAuB;AACvB,oDAAkC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './v3';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./v3"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uCAAqB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sinch will scan all pages of all incoming faxes for Code-128 and DataMatrix bar codes and include this information in webhook requests and via the API.
|
|
3
|
+
*/
|
|
4
|
+
export interface BarCode {
|
|
5
|
+
/** The type of barcode found. */
|
|
6
|
+
type?: 'CODE_128' | 'DATA_MATRIX';
|
|
7
|
+
/** The page number on which the barcode was found. */
|
|
8
|
+
page?: number;
|
|
9
|
+
/** The information of the barcode. */
|
|
10
|
+
value?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bar-code.js","sourceRoot":"","sources":["../../../../src/models/v3/bar-code/bar-code.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { BarCode } from './bar-code';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/v3/bar-code/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface EmailBase {
|
|
2
|
+
email?: string;
|
|
3
|
+
/** Numbers you want to associate with this email. */
|
|
4
|
+
phoneNumbers?: string[];
|
|
5
|
+
}
|
|
6
|
+
export interface EmailRequest extends EmailBase {
|
|
7
|
+
}
|
|
8
|
+
export interface Email extends EmailBase {
|
|
9
|
+
/** The `Id` of the project associated with the call. */
|
|
10
|
+
projectId?: string;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email.js","sourceRoot":"","sources":["../../../../src/models/v3/email/email.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { Email, EmailRequest } from './email';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/v3/email/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type ImageConversionMethod = 'HALFTONE' | 'MONOCHROME';
|
|
2
|
+
export type WebhookContentType = 'multipart/form-data' | 'application/json';
|
|
3
|
+
/**
|
|
4
|
+
* The direction of the fax.
|
|
5
|
+
*/
|
|
6
|
+
export type FaxDirection = 'OUTBOUND' | 'INBOUND';
|
|
7
|
+
/**
|
|
8
|
+
* The status of the fax
|
|
9
|
+
*/
|
|
10
|
+
export type FaxStatus = 'QUEUED' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILURE';
|
|
11
|
+
/**
|
|
12
|
+
* Error type
|
|
13
|
+
*/
|
|
14
|
+
export type ErrorType = 'DOCUMENT_CONVERSION_ERROR' | 'CALL_ERROR' | 'FAX_ERROR' | 'FATAL_ERROR' | 'GENERAL_ERROR' | 'LINE_ERROR';
|
|
15
|
+
export type FaxBase64FileType = 'DOC' | 'DOCX' | 'PDF' | 'TIF' | 'JPG' | 'ODT' | 'TXT' | 'HTML' | 'PNG';
|
|
16
|
+
export type FaxWebhookEvent = 'INCOMING_FAX' | 'FAX_COMPLETED';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// export type { TypeEnum as BarCodeTypeEnum } from './bar-code/bar-code';
|
|
3
|
+
// export type { TypeEnum as CallErrorTypeEnum, ErrorCodeEnum as CallErrorErrorCodeEnum } from './call-error/call-error';
|
|
4
|
+
// export type { TypeEnum as DocumentConversionErrorTypeEnum, ErrorCodeEnum as DocumentConversionErrorErrorCodeEnum } from './document-conversion-error/document-conversion-error';
|
|
5
|
+
// export type { CallbackContentTypeEnum as FaxCallbackContentTypeEnum, ImageConversionMethodEnum as FaxImageConversionMethodEnum } from './fax/fax';
|
|
6
|
+
// export type { FileTypeEnum as FaxBase64FileFileTypeEnum } from './fax-base64-file/fax-base64-file';
|
|
7
|
+
// export type { TypeEnum as FaxErrorTypeEnum } from './fax-error/fax-error';
|
|
8
|
+
// export type { CallbackContentTypeEnum as SendFaxRequest1CallbackContentTypeEnum, ImageConversionMethodEnum as SendFaxRequest1ImageConversionMethodEnum } from './send-fax-request1/send-fax-request1';
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
//# sourceMappingURL=enums.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enums.js","sourceRoot":"","sources":["../../../src/models/v3/enums.ts"],"names":[],"mappings":";AAAA,0EAA0E;AAC1E,yHAAyH;AACzH,mLAAmL;AACnL,qJAAqJ;AACrJ,sGAAsG;AACtG,6EAA6E;AAC7E,yMAAyM"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { BarCode } from '../bar-code';
|
|
2
|
+
import { FaxContentUrl } from '../fax-content-url';
|
|
3
|
+
import { FaxMoney } from '../fax-money';
|
|
4
|
+
import { ErrorType, FaxDirection, FaxStatus, ImageConversionMethod, WebhookContentType } from '../enums';
|
|
5
|
+
export interface Fax {
|
|
6
|
+
/** The id of a fax */
|
|
7
|
+
id?: string;
|
|
8
|
+
/** @see FaxDirection */
|
|
9
|
+
direction?: FaxDirection;
|
|
10
|
+
/** A phone number in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format, including the leading \'+\'. */
|
|
11
|
+
from?: string;
|
|
12
|
+
/** A phone number in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format, including the leading \'+\'. */
|
|
13
|
+
to?: string;
|
|
14
|
+
/** @see FaxContentUrl */
|
|
15
|
+
contentUrl?: FaxContentUrl;
|
|
16
|
+
/** The number of pages in the fax. */
|
|
17
|
+
numberOfPages?: number;
|
|
18
|
+
/** @see FaxStatus */
|
|
19
|
+
status?: FaxStatus;
|
|
20
|
+
/** The total price for this fax. This field is populated after the final fax price is calculated. */
|
|
21
|
+
price?: FaxMoney;
|
|
22
|
+
/** The bar codes found in the fax. This field is populated when sinch detects bar codes on incoming faxes. */
|
|
23
|
+
barCodes?: BarCode[];
|
|
24
|
+
/** A timestamp representing the time when the initial API call was made. */
|
|
25
|
+
createTime?: Date;
|
|
26
|
+
/** If the job is complete, this is a timestamp representing the time the job was completed. */
|
|
27
|
+
completedTime?: Date;
|
|
28
|
+
/** Text that will be displayed at the top of each page of the fax. 50 characters maximum. Default header text is \"-\". Note that the header is not applied until the fax is transmitted, so it will not appear on fax PDFs or thumbnails. */
|
|
29
|
+
headerText?: string;
|
|
30
|
+
/** If true, page numbers will be displayed in the header. Default is true. */
|
|
31
|
+
headerPageNumbers?: boolean;
|
|
32
|
+
/** A [TZ database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) string specifying the timezone for the header timestamp. */
|
|
33
|
+
headerTimeZone?: string;
|
|
34
|
+
/** The number of seconds to wait between retries if the fax is not yet completed. */
|
|
35
|
+
retryDelaySeconds?: number;
|
|
36
|
+
/** You can use this to attach labels to your call that you can use in your applications. It is a key value store. */
|
|
37
|
+
labels?: {
|
|
38
|
+
[key: string]: string;
|
|
39
|
+
};
|
|
40
|
+
/** The URL to which a callback will be sent when the fax is completed. The callback will be sent as a POST request with a JSON body. The callback will be sent to the URL specified in the `callbackUrl` parameter, if provided, otherwise it will be sent to the URL specified in the `callbackUrl` field of the Fax Service object. */
|
|
41
|
+
callbackUrl?: string;
|
|
42
|
+
/** The content type of the callback. */
|
|
43
|
+
callbackContentType?: WebhookContentType;
|
|
44
|
+
/** Determines how documents are converted to black and white. Defaults to value selected on Fax Service object. */
|
|
45
|
+
imageConversionMethod?: ImageConversionMethod;
|
|
46
|
+
/** @see ErrorType */
|
|
47
|
+
errorType?: ErrorType;
|
|
48
|
+
/** One of the error numbers listed in the [Fax Error Messages section](#FaxErrors). */
|
|
49
|
+
errorId?: number;
|
|
50
|
+
/** One of the error codes listed in the [Fax Error Messages section](#FaxErrors). */
|
|
51
|
+
errorCode?: string;
|
|
52
|
+
/** The `Id` of the project associated with the call. */
|
|
53
|
+
projectId?: string;
|
|
54
|
+
/** ID of the fax service used. */
|
|
55
|
+
serviceId?: string;
|
|
56
|
+
/** | The number of times the fax will be retired before cancel. Default value is set in your fax service. | The maximum number of retries is 5. */
|
|
57
|
+
maxRetries?: number;
|
|
58
|
+
/** The number of times the fax has been retried. */
|
|
59
|
+
retryCount?: number;
|
|
60
|
+
/** Only shown on the fax result. This indicates if the content of the fax is stored with Sinch. (true or false) */
|
|
61
|
+
hasFile?: string;
|
|
62
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fax.js","sourceRoot":"","sources":["../../../../src/models/v3/fax/fax.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { Fax } from './fax';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/v3/fax/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FaxBase64FileType } from '../enums';
|
|
2
|
+
export interface FaxBase64File {
|
|
3
|
+
/** When application/json Base64 encoded file content, this is only present when using application/json for request/response. */
|
|
4
|
+
file?: string;
|
|
5
|
+
/** When request/response is application json and file is part of payload. This is the file type of the file. */
|
|
6
|
+
fileType?: FaxBase64FileType;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fax-base64-file.js","sourceRoot":"","sources":["../../../../src/models/v3/fax-base64-file/fax-base64-file.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { FaxBase64File } from './fax-base64-file';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/v3/fax-base64-file/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Give us any URL on the Internet (including ones with basic authentication) At least one file or contentUrl parameter is required. Please note: If you are passing fax a secure URL (starting with https://), make sure that your SSL certificate (including your intermediate cert, if you have one) is installed properly, valid, and up-to-date. If the file parameter is specified as well, content from URLs will be rendered before content from files. You can add multiple URLs by adding them as an array them with a comma when posting as multipart/form-data For example: \"https://developers.sinch.com/fax/fax.pdf, https://developers.sinch.com/\" or if posting JSON `\"contentUrl\": [\"https://developers.sinch.com/fax/fax.pdf\", \"https://developers.sinch.com/\"]`
|
|
3
|
+
*/
|
|
4
|
+
export type FaxContentUrl = string | string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fax-content-url.js","sourceRoot":"","sources":["../../../../src/models/v3/fax-content-url/fax-content-url.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { FaxContentUrl } from './fax-content-url';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/v3/fax-content-url/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is where we need description to be overridden by `$ref:` description
|
|
3
|
+
*/
|
|
4
|
+
export interface FaxMoney {
|
|
5
|
+
/** The 3-letter currency code defined in ISO 4217. */
|
|
6
|
+
currencyCode?: string;
|
|
7
|
+
/** The amount with 4 decimals and decimal delimiter `.`. */
|
|
8
|
+
amount?: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fax-money.js","sourceRoot":"","sources":["../../../../src/models/v3/fax-money/fax-money.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { FaxMoney } from './fax-money';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/v3/fax-money/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ImageConversionMethod, WebhookContentType } from '../enums';
|
|
2
|
+
import { FaxContentUrl } from '../fax-content-url';
|
|
3
|
+
import { FaxBase64File } from '../fax-base64-file';
|
|
4
|
+
export type FaxRequest = FaxRequestJson | FaxRequestFormData;
|
|
5
|
+
interface FaxRequestBase {
|
|
6
|
+
/** A phone number in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format, including the leading \\\'+\\\'. */
|
|
7
|
+
to: string;
|
|
8
|
+
/** A phone number in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format, including the leading \\\'+\\\'. */
|
|
9
|
+
from?: string;
|
|
10
|
+
/** */
|
|
11
|
+
contentUrl?: FaxContentUrl;
|
|
12
|
+
/** Text that will be displayed at the top of each page of the fax. 50 characters maximum. Default header text is \\\"-\\\". Note that the header is not applied until the fax is transmitted, so it will not appear on fax PDFs or thumbnails. */
|
|
13
|
+
headerText?: string;
|
|
14
|
+
/** If true, page numbers will be displayed in the header. Default is true. */
|
|
15
|
+
headerPageNumbers?: boolean;
|
|
16
|
+
/** A [TZ database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) string specifying the timezone for the header timestamp. */
|
|
17
|
+
headerTimeZone?: string;
|
|
18
|
+
/** The number of seconds to wait between retries if the fax is not yet completed. */
|
|
19
|
+
retryDelaySeconds?: number;
|
|
20
|
+
/** You can use this to attach labels to your call that you can use in your applications. It is a key value store. */
|
|
21
|
+
labels?: {
|
|
22
|
+
[key: string]: string;
|
|
23
|
+
};
|
|
24
|
+
/** The URL to which a callback will be sent when the fax is completed. The callback will be sent as a POST request with a JSON body. The callback will be sent to the URL specified in the `callbackUrl` parameter, if provided, otherwise it will be sent to the URL specified in the `callbackUrl` field of the Fax Service object. */
|
|
25
|
+
callbackUrl?: string;
|
|
26
|
+
/** The content type of the callback. */
|
|
27
|
+
callbackContentType?: WebhookContentType;
|
|
28
|
+
/** Determines how documents are converted to black and white. Defaults to value selected on Fax Service object. */
|
|
29
|
+
imageConversionMethod?: ImageConversionMethod;
|
|
30
|
+
/** ID of the fax service used. */
|
|
31
|
+
serviceId?: string;
|
|
32
|
+
/** | The number of times the fax will be retired before cancel. Default value is set in your fax service. | The maximum number of retries is 5. */
|
|
33
|
+
maxRetries?: number;
|
|
34
|
+
}
|
|
35
|
+
export type FaxRequestJson = FaxRequestBase & {
|
|
36
|
+
/** An array of base64 encoded files */
|
|
37
|
+
files: FaxBase64File[];
|
|
38
|
+
};
|
|
39
|
+
export interface FaxRequestFormData extends FaxRequestBase {
|
|
40
|
+
/** The file(s) you want to send as a fax as body attachment. */
|
|
41
|
+
file?: any;
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fax-request.js","sourceRoot":"","sources":["../../../../src/models/v3/fax-request/fax-request.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { FaxRequest, FaxRequestJson, FaxRequestFormData } from './fax-request';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/v3/fax-request/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './bar-code';
|
|
2
|
+
export * from './email';
|
|
3
|
+
export * from './fax';
|
|
4
|
+
export * from './fax-base64-file';
|
|
5
|
+
export * from './fax-content-url';
|
|
6
|
+
export * from './fax-money';
|
|
7
|
+
export * from './fax-request';
|
|
8
|
+
export * from './mod-events';
|
|
9
|
+
export * from './service';
|
|
10
|
+
export * from './service-email-settings';
|
|
11
|
+
export * from './service-phone-number';
|
|
12
|
+
export * from './update-email-request';
|
|
13
|
+
export * from './enums';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// export * from './bad-request-detail';
|
|
18
|
+
__exportStar(require("./bar-code"), exports);
|
|
19
|
+
// export * from './call-error';
|
|
20
|
+
// export * from './document-conversion-error';
|
|
21
|
+
__exportStar(require("./email"), exports);
|
|
22
|
+
// export * from './error';
|
|
23
|
+
// export * from './error-detail';
|
|
24
|
+
// export * from './error-info';
|
|
25
|
+
// export * from './error-type';
|
|
26
|
+
__exportStar(require("./fax"), exports);
|
|
27
|
+
__exportStar(require("./fax-base64-file"), exports);
|
|
28
|
+
__exportStar(require("./fax-content-url"), exports);
|
|
29
|
+
// export * from './fax-error';
|
|
30
|
+
// export * from './fax-errors';
|
|
31
|
+
// export * from './fax-status';
|
|
32
|
+
// export * from './field-violation';
|
|
33
|
+
// export * from './generic-event';
|
|
34
|
+
__exportStar(require("./fax-money"), exports);
|
|
35
|
+
__exportStar(require("./fax-request"), exports);
|
|
36
|
+
__exportStar(require("./mod-events"), exports);
|
|
37
|
+
// export * from './pagination';
|
|
38
|
+
// export * from './quota-failure';
|
|
39
|
+
// export * from './quota-failure-detail';
|
|
40
|
+
// export * from './request-info-detail';
|
|
41
|
+
// export * from './send-fax-request1';
|
|
42
|
+
__exportStar(require("./service"), exports);
|
|
43
|
+
__exportStar(require("./service-email-settings"), exports);
|
|
44
|
+
__exportStar(require("./service-phone-number"), exports);
|
|
45
|
+
__exportStar(require("./update-email-request"), exports);
|
|
46
|
+
__exportStar(require("./enums"), exports);
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/v3/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAwC;AACxC,6CAA2B;AAC3B,gCAAgC;AAChC,+CAA+C;AAC/C,0CAAwB;AACxB,2BAA2B;AAC3B,kCAAkC;AAClC,gCAAgC;AAChC,gCAAgC;AAChC,wCAAsB;AACtB,oDAAkC;AAClC,oDAAkC;AAClC,+BAA+B;AAC/B,gCAAgC;AAChC,gCAAgC;AAChC,qCAAqC;AACrC,mCAAmC;AACnC,8CAA4B;AAC5B,gDAA8B;AAC9B,+CAA6B;AAC7B,gCAAgC;AAChC,mCAAmC;AACnC,0CAA0C;AAC1C,yCAAyC;AACzC,uCAAuC;AACvC,4CAA0B;AAC1B,2DAAyC;AACzC,yDAAuC;AACvC,yDAAuC;AACvC,0CAAwB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Fax } from '../../fax';
|
|
2
|
+
import { FaxWebhookEvent } from '../../enums';
|
|
3
|
+
export interface BaseFaxEvent {
|
|
4
|
+
/** The different events that can trigger a webhook */
|
|
5
|
+
event?: FaxWebhookEvent;
|
|
6
|
+
/** Time of the event. */
|
|
7
|
+
eventTime?: Date;
|
|
8
|
+
/** @see Fax */
|
|
9
|
+
fax?: Fax;
|
|
10
|
+
}
|
|
11
|
+
export interface FaxEventJson extends BaseFaxEvent {
|
|
12
|
+
}
|
|
13
|
+
export interface FaxEventFormData extends BaseFaxEvent {
|
|
14
|
+
/** The fax content as a PDF attachment to the body. <application/pdf> */
|
|
15
|
+
file?: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-fax-event.js","sourceRoot":"","sources":["../../../../../src/models/v3/mod-events/base-fax-event/base-fax-event.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { FaxEventJson, FaxEventFormData } from './base-fax-event';
|