@sinch/fax 1.1.0 → 1.2.1
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/dist/index.js +17 -7
- package/dist/index.js.map +1 -1
- package/dist/models/v3/date-range-filter/date-range-filter.d.ts +17 -0
- package/dist/models/v3/date-range-filter/date-range-filter.js +3 -0
- package/dist/models/v3/date-range-filter/date-range-filter.js.map +1 -0
- package/dist/models/v3/date-range-filter/index.d.ts +1 -0
- package/dist/models/v3/date-range-filter/index.js +3 -0
- package/dist/models/v3/date-range-filter/index.js.map +1 -0
- package/dist/models/v3/enums.d.ts +2 -1
- package/dist/models/v3/enums.js +2 -7
- package/dist/models/v3/enums.js.map +1 -1
- package/dist/models/v3/fax/fax.d.ts +4 -4
- package/dist/models/v3/fax-request/fax-request.d.ts +23 -7
- package/dist/models/v3/fax-request/index.d.ts +1 -1
- package/dist/models/v3/faxes-list/faxes-list.d.ts +4 -0
- package/dist/models/v3/faxes-list/faxes-list.js +3 -0
- package/dist/models/v3/faxes-list/faxes-list.js.map +1 -0
- package/dist/models/v3/faxes-list/index.d.ts +1 -0
- package/dist/models/v3/faxes-list/index.js +3 -0
- package/dist/models/v3/faxes-list/index.js.map +1 -0
- package/dist/models/v3/helper.d.ts +2 -0
- package/dist/models/v3/helper.js +12 -0
- package/dist/models/v3/helper.js.map +1 -0
- package/dist/models/v3/index.d.ts +4 -1
- package/dist/models/v3/index.js +4 -18
- package/dist/models/v3/index.js.map +1 -1
- package/dist/models/v3/mod-events/fax-completed-event/fax-completed-event.d.ts +5 -3
- package/dist/models/v3/requests/faxes/faxes-request-data.d.ts +12 -5
- package/dist/models/v3/webhook-event-parsed/index.d.ts +1 -0
- package/dist/models/v3/webhook-event-parsed/index.js +3 -0
- package/dist/models/v3/webhook-event-parsed/index.js.map +1 -0
- package/dist/rest/v3/callbacks/callbacks-webhook.d.ts +0 -1
- package/dist/rest/v3/emails/emails-api.d.ts +9 -1
- package/dist/rest/v3/emails/emails-api.jest.fixture.d.ts +9 -6
- package/dist/rest/v3/emails/emails-api.jest.fixture.js +8 -4
- package/dist/rest/v3/emails/emails-api.jest.fixture.js.map +1 -1
- package/dist/rest/v3/emails/emails-api.js +11 -1
- package/dist/rest/v3/emails/emails-api.js.map +1 -1
- package/dist/rest/v3/faxes/faxes-api.d.ts +5 -5
- package/dist/rest/v3/faxes/faxes-api.jest.fixture.d.ts +6 -7
- package/dist/rest/v3/faxes/faxes-api.jest.fixture.js +5 -5
- package/dist/rest/v3/faxes/faxes-api.jest.fixture.js.map +1 -1
- package/dist/rest/v3/faxes/faxes-api.js +99 -33
- package/dist/rest/v3/faxes/faxes-api.js.map +1 -1
- package/dist/rest/v3/services/services-api.jest.fixture.d.ts +0 -1
- package/package.json +6 -4
package/dist/index.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
37
|
};
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAgC;AAChC,yCAAuB;AACvB,oDAAkC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DateFormat } from '@sinch/sdk-client';
|
|
2
|
+
/**
|
|
3
|
+
* Filter calls based on `createTime`. If not value is submitted, the default value is the prior week.
|
|
4
|
+
* - `from: '2024-02-15'` will return all faxes from February 2024, 15th
|
|
5
|
+
* - `from: '2024-02-01T14:00:00Z'` will return all faxes after 14:00:00 on the first of February 2024.
|
|
6
|
+
* - `from: '2024-02-01T14:00:00Z'` + `to: '2024-02-01T15:00:00Z'` will return all faxes between 14:00:00 and 15:00:00 (inclusive) on the first of February 2024.
|
|
7
|
+
* - `from: '2024-02-01'` + `to: '2024-02-29'` will return all faxes for all of February 2024.
|
|
8
|
+
*
|
|
9
|
+
* Note: It is also possible to submit partial dates.
|
|
10
|
+
* - `from: '2024-02'` will return all faxes for February 2024
|
|
11
|
+
*/
|
|
12
|
+
export interface DateRangeFilter {
|
|
13
|
+
/** */
|
|
14
|
+
from?: string | Date | DateFormat;
|
|
15
|
+
/** */
|
|
16
|
+
to?: string | Date | DateFormat;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-range-filter.js","sourceRoot":"","sources":["../../../../src/models/v3/date-range-filter/date-range-filter.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { DateRangeFilter } from './date-range-filter';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/v3/date-range-filter/index.ts"],"names":[],"mappings":""}
|
|
@@ -9,8 +9,9 @@ export type FaxDirection = 'OUTBOUND' | 'INBOUND';
|
|
|
9
9
|
*/
|
|
10
10
|
export type FaxStatus = 'QUEUED' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILURE';
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Type of error for the fax
|
|
13
13
|
*/
|
|
14
14
|
export type ErrorType = 'DOCUMENT_CONVERSION_ERROR' | 'CALL_ERROR' | 'FAX_ERROR' | 'FATAL_ERROR' | 'GENERAL_ERROR' | 'LINE_ERROR';
|
|
15
15
|
export type FaxBase64FileType = 'DOC' | 'DOCX' | 'PDF' | 'TIF' | 'JPG' | 'ODT' | 'TXT' | 'HTML' | 'PNG';
|
|
16
|
+
export declare const validBase64FileTypes: FaxBase64FileType[];
|
|
16
17
|
export type FaxWebhookEvent = 'INCOMING_FAX' | 'FAX_COMPLETED';
|
package/dist/models/v3/enums.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validBase64FileTypes = void 0;
|
|
4
|
+
exports.validBase64FileTypes = ['DOC', 'DOCX', 'PDF', 'TIF', 'JPG', 'ODT', 'TXT', 'HTML', 'PNG'];
|
|
10
5
|
//# sourceMappingURL=enums.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enums.js","sourceRoot":"","sources":["../../../src/models/v3/enums.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"enums.js","sourceRoot":"","sources":["../../../src/models/v3/enums.ts"],"names":[],"mappings":";;;AA2Ba,QAAA,oBAAoB,GAC7B,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC"}
|
|
@@ -40,15 +40,15 @@ export interface Fax {
|
|
|
40
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
41
|
callbackUrl?: string;
|
|
42
42
|
/** The content type of the callback. */
|
|
43
|
-
|
|
43
|
+
callbackUrlContentType?: WebhookContentType;
|
|
44
44
|
/** Determines how documents are converted to black and white. Defaults to value selected on Fax Service object. */
|
|
45
45
|
imageConversionMethod?: ImageConversionMethod;
|
|
46
46
|
/** @see ErrorType */
|
|
47
47
|
errorType?: ErrorType;
|
|
48
48
|
/** One of the error numbers listed in the [Fax Error Messages section](#FaxErrors). */
|
|
49
|
-
|
|
50
|
-
/** One of the error
|
|
51
|
-
|
|
49
|
+
errorCode?: number;
|
|
50
|
+
/** One of the error messages listed in the [Fax Error Messages section](#FaxErrors). */
|
|
51
|
+
errorMessage?: string;
|
|
52
52
|
/** The `Id` of the project associated with the call. */
|
|
53
53
|
projectId?: string;
|
|
54
54
|
/** ID of the fax service used. */
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { ImageConversionMethod, WebhookContentType } from '../enums';
|
|
2
2
|
import { FaxContentUrl } from '../fax-content-url';
|
|
3
3
|
import { FaxBase64File } from '../fax-base64-file';
|
|
4
|
-
export type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
to: string;
|
|
4
|
+
export type SingleFaxRequest = SingleFaxRequestJson | SingleFaxRequestFormData;
|
|
5
|
+
export type MultipleFaxRequest = MultipleFaxRequestJson | MultipleFaxRequestFormData;
|
|
6
|
+
export interface FaxRequestBase {
|
|
8
7
|
/** A phone number in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format, including the leading '+'. */
|
|
9
8
|
from?: string;
|
|
10
9
|
/** */
|
|
@@ -24,7 +23,7 @@ interface FaxRequestBase {
|
|
|
24
23
|
/** 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
24
|
callbackUrl?: string;
|
|
26
25
|
/** The content type of the callback. */
|
|
27
|
-
|
|
26
|
+
callbackUrlContentType?: WebhookContentType;
|
|
28
27
|
/** Determines how documents are converted to black and white. Defaults to value selected on Fax Service object. */
|
|
29
28
|
imageConversionMethod?: ImageConversionMethod;
|
|
30
29
|
/** ID of the fax service used. */
|
|
@@ -35,9 +34,26 @@ interface FaxRequestBase {
|
|
|
35
34
|
export type FaxRequestJson = FaxRequestBase & {
|
|
36
35
|
/** An array of base64 encoded files */
|
|
37
36
|
files: FaxBase64File[];
|
|
37
|
+
filePaths?: never;
|
|
38
|
+
};
|
|
39
|
+
export type SingleFaxRequestJson = FaxRequestJson & {
|
|
40
|
+
/** A phone number in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format, including the leading '+'. */
|
|
41
|
+
to: string;
|
|
42
|
+
};
|
|
43
|
+
export type MultipleFaxRequestJson = FaxRequestJson & {
|
|
44
|
+
/** A list of phone number in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format, including the leading '+'. */
|
|
45
|
+
to: string[];
|
|
38
46
|
};
|
|
39
47
|
export interface FaxRequestFormData extends FaxRequestBase {
|
|
40
48
|
/** The file(s) you want to send as a fax as body attachment. */
|
|
41
|
-
|
|
49
|
+
filePaths?: string | string[];
|
|
50
|
+
files?: never;
|
|
42
51
|
}
|
|
43
|
-
export {
|
|
52
|
+
export type SingleFaxRequestFormData = FaxRequestFormData & {
|
|
53
|
+
/** A phone number in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format, including the leading '+'. */
|
|
54
|
+
to: string;
|
|
55
|
+
};
|
|
56
|
+
export type MultipleFaxRequestFormData = FaxRequestFormData & {
|
|
57
|
+
/** A list of phone number in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format, including the leading '+'. */
|
|
58
|
+
to: string[];
|
|
59
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { SingleFaxRequest, SingleFaxRequestJson, SingleFaxRequestFormData, FaxRequestBase, FaxRequestJson, FaxRequestFormData, MultipleFaxRequest, MultipleFaxRequestJson, MultipleFaxRequestFormData, } from './fax-request';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"faxes-list.js","sourceRoot":"","sources":["../../../../src/models/v3/faxes-list/faxes-list.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { FaxesList } from './faxes-list';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/v3/faxes-list/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertToSupportedFileType = void 0;
|
|
4
|
+
const enums_1 = require("./enums");
|
|
5
|
+
const convertToSupportedFileType = (fileType) => {
|
|
6
|
+
if (!fileType || !enums_1.validBase64FileTypes.includes(fileType.toUpperCase())) {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
return fileType.toUpperCase();
|
|
10
|
+
};
|
|
11
|
+
exports.convertToSupportedFileType = convertToSupportedFileType;
|
|
12
|
+
//# sourceMappingURL=helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../src/models/v3/helper.ts"],"names":[],"mappings":";;;AAAA,mCAAkE;AAE3D,MAAM,0BAA0B,GAAG,CAAC,QAA4B,EAAiC,EAAE;IACxG,IAAI,CAAC,QAAQ,IAAI,CAAC,4BAAoB,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAuB,CAAC,EAAE,CAAC;QAC7F,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,QAAQ,CAAC,WAAW,EAAuB,CAAC;AACrD,CAAC,CAAC;AALW,QAAA,0BAA0B,8BAKrC"}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
export * from './bar-code';
|
|
2
|
+
export * from './date-range-filter';
|
|
2
3
|
export * from './email';
|
|
3
4
|
export * from './fax';
|
|
4
5
|
export * from './fax-base64-file';
|
|
5
6
|
export * from './fax-content-url';
|
|
6
7
|
export * from './fax-money';
|
|
7
8
|
export * from './fax-request';
|
|
9
|
+
export * from './faxes-list';
|
|
8
10
|
export * from './mod-events';
|
|
9
11
|
export * from './service';
|
|
10
12
|
export * from './service-email-settings';
|
|
11
13
|
export * from './service-phone-number';
|
|
12
14
|
export * from './update-email-request';
|
|
13
|
-
export * from './webhook-event-parsed
|
|
15
|
+
export * from './webhook-event-parsed';
|
|
14
16
|
export * from './enums';
|
|
15
17
|
export * from './requests';
|
|
18
|
+
export * from './helper';
|
package/dist/models/v3/index.js
CHANGED
|
@@ -14,36 +14,22 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
// export * from './bad-request-detail';
|
|
18
17
|
__exportStar(require("./bar-code"), exports);
|
|
19
|
-
|
|
20
|
-
// export * from './document-conversion-error';
|
|
18
|
+
__exportStar(require("./date-range-filter"), exports);
|
|
21
19
|
__exportStar(require("./email"), exports);
|
|
22
|
-
// export * from './error';
|
|
23
|
-
// export * from './error-detail';
|
|
24
|
-
// export * from './error-info';
|
|
25
|
-
// export * from './error-type';
|
|
26
20
|
__exportStar(require("./fax"), exports);
|
|
27
21
|
__exportStar(require("./fax-base64-file"), exports);
|
|
28
22
|
__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
23
|
__exportStar(require("./fax-money"), exports);
|
|
35
24
|
__exportStar(require("./fax-request"), exports);
|
|
25
|
+
__exportStar(require("./faxes-list"), exports);
|
|
36
26
|
__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
27
|
__exportStar(require("./service"), exports);
|
|
43
28
|
__exportStar(require("./service-email-settings"), exports);
|
|
44
29
|
__exportStar(require("./service-phone-number"), exports);
|
|
45
30
|
__exportStar(require("./update-email-request"), exports);
|
|
46
|
-
__exportStar(require("./webhook-event-parsed
|
|
31
|
+
__exportStar(require("./webhook-event-parsed"), exports);
|
|
47
32
|
__exportStar(require("./enums"), exports);
|
|
48
33
|
__exportStar(require("./requests"), exports);
|
|
34
|
+
__exportStar(require("./helper"), exports);
|
|
49
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/v3/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/v3/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,sDAAoC;AACpC,0CAAwB;AACxB,wCAAsB;AACtB,oDAAkC;AAClC,oDAAkC;AAClC,8CAA4B;AAC5B,gDAA8B;AAC9B,+CAA6B;AAC7B,+CAA6B;AAC7B,4CAA0B;AAC1B,2DAAyC;AACzC,yDAAuC;AACvC,yDAAuC;AACvC,yDAAuC;AACvC,0CAAwB;AACxB,6CAA2B;AAC3B,2CAAyB"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { FaxBase64File } from '../../fax-base64-file';
|
|
2
1
|
import { FaxEventFormData, FaxEventJson } from '../base-fax-event';
|
|
2
|
+
import { FaxBase64FileType } from '../../enums';
|
|
3
3
|
export type FaxCompletedEvent = FaxCompletedEventJson | FaxCompletedEventFormData;
|
|
4
4
|
export interface FaxCompletedEventJson extends FaxEventJson {
|
|
5
5
|
/** Always FAX_COMPLETED for this event. */
|
|
6
6
|
event?: 'FAX_COMPLETED';
|
|
7
|
-
/** */
|
|
8
|
-
|
|
7
|
+
/** The base64 encoded file. */
|
|
8
|
+
file?: string;
|
|
9
|
+
/** The file type of the attached file. */
|
|
10
|
+
fileType?: FaxBase64FileType;
|
|
9
11
|
}
|
|
10
12
|
export interface FaxCompletedEventFormData extends FaxEventFormData {
|
|
11
13
|
/** Always FAX_COMPLETED for this event. */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FaxDirection, FaxStatus } from '../../enums';
|
|
2
|
-
import {
|
|
2
|
+
import { SingleFaxRequest, MultipleFaxRequest } from '../../fax-request';
|
|
3
|
+
import { DateRangeFilter } from '../../date-range-filter';
|
|
3
4
|
export interface DeleteFaxContentRequestData {
|
|
4
5
|
/** The ID of the fax. */
|
|
5
6
|
'id': string;
|
|
@@ -15,8 +16,10 @@ export interface GetFaxRequestData {
|
|
|
15
16
|
'id': string;
|
|
16
17
|
}
|
|
17
18
|
export interface ListFaxesRequestData {
|
|
18
|
-
/** Filter calls based on
|
|
19
|
-
'createTime'?: string;
|
|
19
|
+
/** Filter calls based on `createTime`. It can be a year, a month or a day. */
|
|
20
|
+
'createTime'?: string | Date;
|
|
21
|
+
/** Filter calls based on `createTime`. It will filter the faxes on a range of dates. */
|
|
22
|
+
'createTimeRange'?: DateRangeFilter;
|
|
20
23
|
/** Limits results to faxes with the specified direction. */
|
|
21
24
|
'direction'?: FaxDirection;
|
|
22
25
|
/** Limits results to faxes with the specified status. */
|
|
@@ -30,6 +33,10 @@ export interface ListFaxesRequestData {
|
|
|
30
33
|
/** The page you want to retrieve returned from a previous List request, if any */
|
|
31
34
|
'page'?: string;
|
|
32
35
|
}
|
|
33
|
-
export
|
|
34
|
-
|
|
36
|
+
export type SendFaxRequestData = SendSingleFaxRequestData | SendMultipleFaxRequestData;
|
|
37
|
+
export interface SendSingleFaxRequestData {
|
|
38
|
+
'sendFaxRequestBody': SingleFaxRequest;
|
|
39
|
+
}
|
|
40
|
+
export interface SendMultipleFaxRequestData {
|
|
41
|
+
'sendFaxRequestBody': MultipleFaxRequest;
|
|
35
42
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { FaxWebhookEventParsed } from './webhook-event-parsed';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/v3/webhook-event-parsed/index.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { AddEmailToNumbersRequestData, DeleteEmailRequestData, Email, ListEmailsForProjectRequestData, ListNumbersByEmailRequestData, ServicePhoneNumber, UpdateEmailRequestData } from '../../../models';
|
|
1
|
+
import { AddEmailToNumbersRequestData, DeleteEmailRequestData, Email, ListEmailsForNumberRequestData, ListEmailsForProjectRequestData, ListNumbersByEmailRequestData, ServicePhoneNumber, UpdateEmailRequestData } from '../../../models';
|
|
2
2
|
import { ApiListPromise, SinchClientParameters } from '@sinch/sdk-client';
|
|
3
3
|
import { FaxDomainApi } from '../fax-domain-api';
|
|
4
4
|
export declare class EmailsApi extends FaxDomainApi {
|
|
5
|
+
private servicesApi;
|
|
5
6
|
/**
|
|
6
7
|
* Initialize your interface
|
|
7
8
|
*
|
|
@@ -27,6 +28,13 @@ export declare class EmailsApi extends FaxDomainApi {
|
|
|
27
28
|
* @return {ApiListPromise<Email>} - The list of emails for the project
|
|
28
29
|
*/
|
|
29
30
|
list(data: ListEmailsForProjectRequestData): ApiListPromise<Email>;
|
|
31
|
+
/**
|
|
32
|
+
* List emails for a number
|
|
33
|
+
* List any emails for a number.
|
|
34
|
+
* @param { ListEmailsForNumberRequestData } data - The data to provide to the API call.
|
|
35
|
+
* @return {ApiListPromise<string>} - The list of emails for a given number
|
|
36
|
+
*/
|
|
37
|
+
listForNumber(data: ListEmailsForNumberRequestData): ApiListPromise<string>;
|
|
30
38
|
/**
|
|
31
39
|
* Get numbers for email
|
|
32
40
|
* Get configured numbers for an email
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { AddEmailToNumbersRequestData, DeleteEmailRequestData, Email, ListEmailsForProjectRequestData, ListNumbersByEmailRequestData, ServicePhoneNumber, UpdateEmailRequestData } from '../../../models';
|
|
1
|
+
import { AddEmailToNumbersRequestData, DeleteEmailRequestData, Email, ListEmailsForNumberRequestData, ListEmailsForProjectRequestData, ListNumbersByEmailRequestData, ServicePhoneNumber, UpdateEmailRequestData } from '../../../models';
|
|
3
2
|
import { EmailsApi } from './emails-api';
|
|
4
3
|
import { ApiListPromise } from '@sinch/sdk-client';
|
|
5
4
|
export declare class EmailsApiFixture implements Partial<Readonly<EmailsApi>> {
|
|
@@ -8,19 +7,23 @@ export declare class EmailsApiFixture implements Partial<Readonly<EmailsApi>> {
|
|
|
8
7
|
*/
|
|
9
8
|
addToNumbers: jest.Mock<Promise<Email>, [AddEmailToNumbersRequestData]>;
|
|
10
9
|
/**
|
|
11
|
-
* Fixture associated to function
|
|
10
|
+
* Fixture associated to function delete
|
|
12
11
|
*/
|
|
13
12
|
delete: jest.Mock<Promise<void>, [DeleteEmailRequestData]>;
|
|
14
13
|
/**
|
|
15
|
-
* Fixture associated to function
|
|
14
|
+
* Fixture associated to function list
|
|
16
15
|
*/
|
|
17
16
|
list: jest.Mock<ApiListPromise<Email>, [ListEmailsForProjectRequestData]>;
|
|
18
17
|
/**
|
|
19
|
-
* Fixture associated to function
|
|
18
|
+
* Fixture associated to function listForNumber
|
|
19
|
+
*/
|
|
20
|
+
listForNumber: jest.Mock<ApiListPromise<string>, [ListEmailsForNumberRequestData]>;
|
|
21
|
+
/**
|
|
22
|
+
* Fixture associated to function listNumbers
|
|
20
23
|
*/
|
|
21
24
|
listNumbers: jest.Mock<ApiListPromise<ServicePhoneNumber>, [ListNumbersByEmailRequestData]>;
|
|
22
25
|
/**
|
|
23
|
-
* Fixture associated to function
|
|
26
|
+
* Fixture associated to function update
|
|
24
27
|
*/
|
|
25
28
|
update: jest.Mock<Promise<Email>, [UpdateEmailRequestData]>;
|
|
26
29
|
}
|
|
@@ -8,19 +8,23 @@ class EmailsApiFixture {
|
|
|
8
8
|
*/
|
|
9
9
|
this.addToNumbers = jest.fn();
|
|
10
10
|
/**
|
|
11
|
-
* Fixture associated to function
|
|
11
|
+
* Fixture associated to function delete
|
|
12
12
|
*/
|
|
13
13
|
this.delete = jest.fn();
|
|
14
14
|
/**
|
|
15
|
-
* Fixture associated to function
|
|
15
|
+
* Fixture associated to function list
|
|
16
16
|
*/
|
|
17
17
|
this.list = jest.fn();
|
|
18
18
|
/**
|
|
19
|
-
* Fixture associated to function
|
|
19
|
+
* Fixture associated to function listForNumber
|
|
20
|
+
*/
|
|
21
|
+
this.listForNumber = jest.fn();
|
|
22
|
+
/**
|
|
23
|
+
* Fixture associated to function listNumbers
|
|
20
24
|
*/
|
|
21
25
|
this.listNumbers = jest.fn();
|
|
22
26
|
/**
|
|
23
|
-
* Fixture associated to function
|
|
27
|
+
* Fixture associated to function update
|
|
24
28
|
*/
|
|
25
29
|
this.update = jest.fn();
|
|
26
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emails-api.jest.fixture.js","sourceRoot":"","sources":["../../../../src/rest/v3/emails/emails-api.jest.fixture.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"emails-api.jest.fixture.js","sourceRoot":"","sources":["../../../../src/rest/v3/emails/emails-api.jest.fixture.ts"],"names":[],"mappings":";;;AAaA,MAAa,gBAAgB;IAA7B;QAEE;;WAEG;QACI,iBAAY,GAA8D,IAAI,CAAC,EAAE,EAAE,CAAC;QAC3F;;WAEG;QACI,WAAM,GAAuD,IAAI,CAAC,EAAE,EAAE,CAAC;QAC9E;;WAEG;QACI,SAAI,GAAwE,IAAI,CAAC,EAAE,EAAE,CAAC;QAC7F;;WAEG;QACI,kBAAa,GAAwE,IAAI,CAAC,EAAE,EAAE,CAAC;QACtG;;WAEG;QACI,gBAAW,GAAmF,IAAI,CAAC,EAAE,EAAE,CAAC;QAC/G;;WAEG;QACI,WAAM,GAAwD,IAAI,CAAC,EAAE,EAAE,CAAC;IACjF,CAAC;CAAA;AA1BD,4CA0BC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.EmailsApi = void 0;
|
|
4
4
|
const sdk_client_1 = require("@sinch/sdk-client");
|
|
5
5
|
const fax_domain_api_1 = require("../fax-domain-api");
|
|
6
|
+
const services_1 = require("../services");
|
|
6
7
|
class EmailsApi extends fax_domain_api_1.FaxDomainApi {
|
|
7
8
|
/**
|
|
8
9
|
* Initialize your interface
|
|
@@ -11,6 +12,7 @@ class EmailsApi extends fax_domain_api_1.FaxDomainApi {
|
|
|
11
12
|
*/
|
|
12
13
|
constructor(sinchClientParameters) {
|
|
13
14
|
super(sinchClientParameters, 'EmailsApi');
|
|
15
|
+
this.servicesApi = new services_1.ServicesApi(sinchClientParameters);
|
|
14
16
|
}
|
|
15
17
|
/**
|
|
16
18
|
* Add an email
|
|
@@ -86,6 +88,15 @@ class EmailsApi extends fax_domain_api_1.FaxDomainApi {
|
|
|
86
88
|
Object.assign(listPromise, (0, sdk_client_1.createIteratorMethodsForPagination)(this.client, requestOptionsPromise, listPromise, operationProperties));
|
|
87
89
|
return listPromise;
|
|
88
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* List emails for a number
|
|
93
|
+
* List any emails for a number.
|
|
94
|
+
* @param { ListEmailsForNumberRequestData } data - The data to provide to the API call.
|
|
95
|
+
* @return {ApiListPromise<string>} - The list of emails for a given number
|
|
96
|
+
*/
|
|
97
|
+
listForNumber(data) {
|
|
98
|
+
return this.servicesApi.listEmailsForNumber(data);
|
|
99
|
+
}
|
|
89
100
|
/**
|
|
90
101
|
* Get numbers for email
|
|
91
102
|
* Get configured numbers for an email
|
|
@@ -95,7 +106,6 @@ class EmailsApi extends fax_domain_api_1.FaxDomainApi {
|
|
|
95
106
|
listNumbers(data) {
|
|
96
107
|
this.client = this.getSinchClient();
|
|
97
108
|
const getParams = this.client.extractQueryParams(data, [
|
|
98
|
-
'email',
|
|
99
109
|
'pageSize',
|
|
100
110
|
'page'
|
|
101
111
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emails-api.js","sourceRoot":"","sources":["../../../../src/rest/v3/emails/emails-api.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"emails-api.js","sourceR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C,CAAC;QAC9F,MAAM,OAAO,GAA0C;YACrD,cAAc,EAAE,kBAAkB;YAClC,QAAQ,EAAE,kBAAkB;SAC7B,CAAC;QAEF,MAAM,IAAI,GAAgB,IAAI,CAAC,wBAAwB,CAAC;YACtD,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;YAChD,CAAC,CAAC,IAAI,CAAC;QACT,MAAM,WAAW,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,gBAAgB,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,WAAW,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAE7I,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC;QACnH,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,QAAQ,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;QAExF,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAQ;YACpC,GAAG;YACH,cAAc;YACd,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,WAAW,EAAE,aAAa;SAC3B,CAAC,CAAC;IACL,CAAC;CAEF;AAlMD,8BAkMC"}
|
|
@@ -34,13 +34,13 @@ export declare class FaxesApi extends FaxDomainApi {
|
|
|
34
34
|
*/
|
|
35
35
|
list(data: ListFaxesRequestData): ApiListPromise<Fax>;
|
|
36
36
|
/**
|
|
37
|
-
* Send a fax
|
|
38
|
-
* Create and send
|
|
37
|
+
* Send a fax or multiple faxes
|
|
38
|
+
* Create and send one or multiple faxes. Fax content may be supplied via one or more files or URLs of supported filetypes.
|
|
39
39
|
* This endpoint supports the following content types for the fax payload:
|
|
40
40
|
* - Multipart/form-data
|
|
41
41
|
* - Application/json
|
|
42
|
-
* We will however always return a fax
|
|
43
|
-
* If you supply a callbackUrl the callback will be sent as multipart/form-data with the content of the fax as an attachment to the body, *unless* you specify
|
|
42
|
+
* We will however always return a fax array in the response in application json.
|
|
43
|
+
* If you supply a callbackUrl the callback will be sent as multipart/form-data with the content of the fax as an attachment to the body, *unless* you specify callbackUrlContentType as application/json.
|
|
44
44
|
* #### file(s)
|
|
45
45
|
* Files may be included in the POST request as multipart/form-data parts.
|
|
46
46
|
* #### contentUrl
|
|
@@ -48,5 +48,5 @@ export declare class FaxesApi extends FaxDomainApi {
|
|
|
48
48
|
* 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.
|
|
49
49
|
* @param { SendFaxRequestData } data - The data to provide to the API call.
|
|
50
50
|
*/
|
|
51
|
-
send(data: SendFaxRequestData): Promise<Fax>;
|
|
51
|
+
send(data: SendFaxRequestData): Promise<Fax[]>;
|
|
52
52
|
}
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
/// <reference types="jest" />
|
|
2
1
|
import { DeleteFaxContentRequestData, DownloadFaxContentRequestData, Fax, GetFaxRequestData, ListFaxesRequestData, SendFaxRequestData } from '../../../models';
|
|
3
2
|
import { FaxesApi } from './faxes-api';
|
|
4
3
|
import { ApiListPromise, FileBuffer } from '@sinch/sdk-client';
|
|
5
4
|
export declare class FaxesApiFixture implements Partial<Readonly<FaxesApi>> {
|
|
6
5
|
/**
|
|
7
|
-
* Fixture associated to function
|
|
6
|
+
* Fixture associated to function deleteContent
|
|
8
7
|
*/
|
|
9
8
|
deleteContent: jest.Mock<Promise<void>, [DeleteFaxContentRequestData]>;
|
|
10
9
|
/**
|
|
11
|
-
* Fixture associated to function
|
|
10
|
+
* Fixture associated to function downloadContent
|
|
12
11
|
*/
|
|
13
12
|
downloadContent: jest.Mock<Promise<FileBuffer>, [DownloadFaxContentRequestData]>;
|
|
14
13
|
/**
|
|
15
|
-
* Fixture associated to function
|
|
14
|
+
* Fixture associated to function get
|
|
16
15
|
*/
|
|
17
16
|
get: jest.Mock<Promise<Fax>, [GetFaxRequestData]>;
|
|
18
17
|
/**
|
|
19
|
-
* Fixture associated to function
|
|
18
|
+
* Fixture associated to function list
|
|
20
19
|
*/
|
|
21
20
|
list: jest.Mock<ApiListPromise<Fax>, [ListFaxesRequestData]>;
|
|
22
21
|
/**
|
|
23
|
-
* Fixture associated to function
|
|
22
|
+
* Fixture associated to function send
|
|
24
23
|
*/
|
|
25
|
-
send: jest.Mock<Promise<Fax>, [SendFaxRequestData]>;
|
|
24
|
+
send: jest.Mock<Promise<Fax[]>, [SendFaxRequestData]>;
|
|
26
25
|
}
|
|
@@ -4,23 +4,23 @@ exports.FaxesApiFixture = void 0;
|
|
|
4
4
|
class FaxesApiFixture {
|
|
5
5
|
constructor() {
|
|
6
6
|
/**
|
|
7
|
-
* Fixture associated to function
|
|
7
|
+
* Fixture associated to function deleteContent
|
|
8
8
|
*/
|
|
9
9
|
this.deleteContent = jest.fn();
|
|
10
10
|
/**
|
|
11
|
-
* Fixture associated to function
|
|
11
|
+
* Fixture associated to function downloadContent
|
|
12
12
|
*/
|
|
13
13
|
this.downloadContent = jest.fn();
|
|
14
14
|
/**
|
|
15
|
-
* Fixture associated to function
|
|
15
|
+
* Fixture associated to function get
|
|
16
16
|
*/
|
|
17
17
|
this.get = jest.fn();
|
|
18
18
|
/**
|
|
19
|
-
* Fixture associated to function
|
|
19
|
+
* Fixture associated to function list
|
|
20
20
|
*/
|
|
21
21
|
this.list = jest.fn();
|
|
22
22
|
/**
|
|
23
|
-
* Fixture associated to function
|
|
23
|
+
* Fixture associated to function send
|
|
24
24
|
*/
|
|
25
25
|
this.send = jest.fn();
|
|
26
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"faxes-api.jest.fixture.js","sourceRoot":"","sources":["../../../../src/rest/v3/faxes/faxes-api.jest.fixture.ts"],"names":[],"mappings":";;;AAWA,MAAa,eAAe;IAA5B;QAEE;;WAEG;QACI,kBAAa,GAA4D,IAAI,CAAC,EAAE,EAAE,CAAC;QAC1F;;WAEG;QACI,oBAAe,GAAoE,IAAI,CAAC,EAAE,EAAE,CAAC;QACpG;;WAEG;QACI,QAAG,GAAiD,IAAI,CAAC,EAAE,EAAE,CAAC;QACrE;;WAEG;QACI,SAAI,GAA2D,IAAI,CAAC,EAAE,EAAE,CAAC;QAChF;;WAEG;QACI,SAAI,
|
|
1
|
+
{"version":3,"file":"faxes-api.jest.fixture.js","sourceRoot":"","sources":["../../../../src/rest/v3/faxes/faxes-api.jest.fixture.ts"],"names":[],"mappings":";;;AAWA,MAAa,eAAe;IAA5B;QAEE;;WAEG;QACI,kBAAa,GAA4D,IAAI,CAAC,EAAE,EAAE,CAAC;QAC1F;;WAEG;QACI,oBAAe,GAAoE,IAAI,CAAC,EAAE,EAAE,CAAC;QACpG;;WAEG;QACI,QAAG,GAAiD,IAAI,CAAC,EAAE,EAAE,CAAC;QACrE;;WAEG;QACI,SAAI,GAA2D,IAAI,CAAC,EAAE,EAAE,CAAC;QAChF;;WAEG;QACI,SAAI,GAAoD,IAAI,CAAC,EAAE,EAAE,CAAC;IAC3E,CAAC;CAAA;AAtBD,0CAsBC"}
|
|
@@ -1,8 +1,43 @@
|
|
|
1
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.FaxesApi = void 0;
|
|
4
37
|
const sdk_client_1 = require("@sinch/sdk-client");
|
|
5
38
|
const fax_domain_api_1 = require("../fax-domain-api");
|
|
39
|
+
const FormData = require("form-data");
|
|
40
|
+
const fs = __importStar(require("fs"));
|
|
6
41
|
class FaxesApi extends fax_domain_api_1.FaxDomainApi {
|
|
7
42
|
/**
|
|
8
43
|
* Initialize your interface
|
|
@@ -91,7 +126,6 @@ class FaxesApi extends fax_domain_api_1.FaxDomainApi {
|
|
|
91
126
|
list(data) {
|
|
92
127
|
this.client = this.getSinchClient();
|
|
93
128
|
const getParams = this.client.extractQueryParams(data, [
|
|
94
|
-
'createTime',
|
|
95
129
|
'direction',
|
|
96
130
|
'status',
|
|
97
131
|
'to',
|
|
@@ -99,6 +133,9 @@ class FaxesApi extends fax_domain_api_1.FaxDomainApi {
|
|
|
99
133
|
'pageSize',
|
|
100
134
|
'page'
|
|
101
135
|
]);
|
|
136
|
+
getParams.createTime = JSON.stringify((0, sdk_client_1.formatCreateTimeFilter)(data.createTime));
|
|
137
|
+
getParams['createTime>'] = JSON.stringify((0, sdk_client_1.formatCreateTimeRangeFilter)(data.createTimeRange?.from));
|
|
138
|
+
getParams['createTime<'] = JSON.stringify((0, sdk_client_1.formatCreateTimeRangeFilter)(data.createTimeRange?.to));
|
|
102
139
|
const headers = {
|
|
103
140
|
'Content-Type': 'application/json',
|
|
104
141
|
'Accept': 'application/json',
|
|
@@ -119,13 +156,13 @@ class FaxesApi extends fax_domain_api_1.FaxDomainApi {
|
|
|
119
156
|
return listPromise;
|
|
120
157
|
}
|
|
121
158
|
/**
|
|
122
|
-
* Send a fax
|
|
123
|
-
* Create and send
|
|
159
|
+
* Send a fax or multiple faxes
|
|
160
|
+
* Create and send one or multiple faxes. Fax content may be supplied via one or more files or URLs of supported filetypes.
|
|
124
161
|
* This endpoint supports the following content types for the fax payload:
|
|
125
162
|
* - Multipart/form-data
|
|
126
163
|
* - Application/json
|
|
127
|
-
* We will however always return a fax
|
|
128
|
-
* If you supply a callbackUrl the callback will be sent as multipart/form-data with the content of the fax as an attachment to the body, *unless* you specify
|
|
164
|
+
* We will however always return a fax array in the response in application json.
|
|
165
|
+
* If you supply a callbackUrl the callback will be sent as multipart/form-data with the content of the fax as an attachment to the body, *unless* you specify callbackUrlContentType as application/json.
|
|
129
166
|
* #### file(s)
|
|
130
167
|
* Files may be included in the POST request as multipart/form-data parts.
|
|
131
168
|
* #### contentUrl
|
|
@@ -144,8 +181,8 @@ class FaxesApi extends fax_domain_api_1.FaxDomainApi {
|
|
|
144
181
|
? requestBody['headerTimeZone'] : 'America/New_York';
|
|
145
182
|
requestBody['retryDelaySeconds'] = requestBody['retryDelaySeconds'] !== undefined
|
|
146
183
|
? requestBody['retryDelaySeconds'] : 60;
|
|
147
|
-
requestBody['
|
|
148
|
-
? requestBody['
|
|
184
|
+
requestBody['callbackUrlContentType'] = requestBody['callbackUrlContentType'] !== undefined
|
|
185
|
+
? requestBody['callbackUrlContentType'] : 'multipart/form-data';
|
|
149
186
|
requestBody['imageConversionMethod'] = requestBody['imageConversionMethod'] !== undefined
|
|
150
187
|
? requestBody['imageConversionMethod'] : 'HALFTONE';
|
|
151
188
|
const getParams = this.client.extractQueryParams(data, []);
|
|
@@ -161,61 +198,90 @@ class FaxesApi extends fax_domain_api_1.FaxDomainApi {
|
|
|
161
198
|
body = JSON.stringify(data['sendFaxRequestBody']);
|
|
162
199
|
}
|
|
163
200
|
else {
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
if (
|
|
167
|
-
|
|
201
|
+
const formData = new FormData();
|
|
202
|
+
let requestData;
|
|
203
|
+
if (Array.isArray(data.sendFaxRequestBody.to)) {
|
|
204
|
+
requestData = data.sendFaxRequestBody;
|
|
205
|
+
requestData.to.forEach((to) => formData.append('to', to));
|
|
168
206
|
}
|
|
169
|
-
|
|
170
|
-
|
|
207
|
+
else {
|
|
208
|
+
requestData = data.sendFaxRequestBody;
|
|
209
|
+
formData.append('to', requestData.to);
|
|
210
|
+
}
|
|
211
|
+
if (requestData.filePaths) {
|
|
212
|
+
let attachmentPaths = requestData.filePaths;
|
|
213
|
+
if (typeof attachmentPaths === 'string') {
|
|
214
|
+
attachmentPaths = [String(requestData.filePaths)];
|
|
215
|
+
}
|
|
216
|
+
attachmentPaths.forEach((filePath) => {
|
|
217
|
+
formData.append('file', fs.readFileSync(filePath), filePath.split('/').pop());
|
|
218
|
+
});
|
|
171
219
|
}
|
|
172
220
|
if (requestData.from) {
|
|
173
|
-
|
|
221
|
+
formData.append('from', requestData.from);
|
|
174
222
|
}
|
|
175
223
|
if (requestData.contentUrl) {
|
|
176
|
-
|
|
224
|
+
formData.append('contentUrl', requestData.contentUrl);
|
|
177
225
|
}
|
|
178
226
|
if (requestData.headerText) {
|
|
179
|
-
|
|
227
|
+
formData.append('headerText', requestData.headerText);
|
|
180
228
|
}
|
|
181
229
|
if (requestData.headerPageNumbers) {
|
|
182
|
-
|
|
230
|
+
formData.append('headerPageNumbers', requestData.headerPageNumbers.toString());
|
|
183
231
|
}
|
|
184
232
|
if (requestData.headerTimeZone) {
|
|
185
|
-
|
|
233
|
+
formData.append('headerTimeZone', requestData.headerTimeZone);
|
|
186
234
|
}
|
|
187
235
|
if (requestData.retryDelaySeconds) {
|
|
188
|
-
|
|
236
|
+
formData.append('retryDelaySeconds', requestData.retryDelaySeconds);
|
|
189
237
|
}
|
|
190
238
|
if (requestData.labels) {
|
|
191
|
-
|
|
239
|
+
formData.append('labels', requestData.labels);
|
|
192
240
|
}
|
|
193
241
|
if (requestData.callbackUrl) {
|
|
194
|
-
|
|
242
|
+
formData.append('callbackUrl', requestData.callbackUrl);
|
|
195
243
|
}
|
|
196
|
-
if (requestData.
|
|
197
|
-
|
|
244
|
+
if (requestData.callbackUrlContentType) {
|
|
245
|
+
formData.append('callbackUrlContentType', requestData.callbackUrlContentType);
|
|
198
246
|
}
|
|
199
247
|
if (requestData.imageConversionMethod) {
|
|
200
|
-
|
|
248
|
+
formData.append('imageConversionMethod', requestData.imageConversionMethod);
|
|
201
249
|
}
|
|
202
250
|
if (requestData.serviceId) {
|
|
203
|
-
|
|
251
|
+
formData.append('serviceId', requestData.serviceId);
|
|
204
252
|
}
|
|
205
253
|
if (requestData.maxRetries) {
|
|
206
|
-
|
|
254
|
+
formData.append('maxRetries', requestData.maxRetries);
|
|
207
255
|
}
|
|
208
|
-
body =
|
|
256
|
+
body = formData;
|
|
209
257
|
}
|
|
210
258
|
const basePathUrl = `${this.client.apiClientOptions.hostname}/v3/projects/${this.client.apiClientOptions.projectId}/faxes`;
|
|
211
259
|
const requestOptions = await this.client.prepareOptions(basePathUrl, 'POST', getParams, headers, body || undefined);
|
|
212
260
|
const url = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
261
|
+
if (Array.isArray(data.sendFaxRequestBody.to)) {
|
|
262
|
+
const responseData = await this.client.processCall({
|
|
263
|
+
url,
|
|
264
|
+
requestOptions,
|
|
265
|
+
apiName: this.apiName,
|
|
266
|
+
operationId: 'SendMultipleFax',
|
|
267
|
+
});
|
|
268
|
+
// When there is a single element in the 'to' array, the server will return a Fax, not a FaxList
|
|
269
|
+
if (Array.isArray(responseData.faxes)) {
|
|
270
|
+
return responseData.faxes;
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
return [responseData];
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
const responseData = await this.client.processCall({
|
|
278
|
+
url,
|
|
279
|
+
requestOptions,
|
|
280
|
+
apiName: this.apiName,
|
|
281
|
+
operationId: 'SendFax',
|
|
282
|
+
});
|
|
283
|
+
return [responseData];
|
|
284
|
+
}
|
|
219
285
|
}
|
|
220
286
|
}
|
|
221
287
|
exports.FaxesApi = FaxesApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"faxes-api.js","sourceRoot":"","sources":["../../../../src/rest/v3/faxes/faxes-api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"faxes-api.js","sourceRoot":"","sources":["../../../../src/rest/v3/faxes/faxes-api.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAW2B;AAC3B,sDAAiD;AAejD,sCAAuC;AACvC,uCAAyB;AAEzB,MAAa,QAAS,SAAQ,6BAAY;IAExC;;;;OAIG;IACH,YAAY,qBAA4C;QACtD,KAAK,CAAC,qBAAqB,EAAE,UAAU,CAAC,CAAC;IAC3C,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,aAAa,CAAC,IAAiC;QAC1D,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QACpC,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,kBAAkB,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AS,QAAQ,CAAC;QAE3H,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC;QACpH,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,QAAQ,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;QAExF,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC;YAC9C,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAkB;gBAClE,GAAG;gBACH,cAAc;gBACd,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,WAAW,EAAE,iBAAiB;aAC/B,CAAC,CAAC;YACH,gGAAgG;YAChG,IAAI,KAAK,CAAC,OAAO,CAAE,YAA0B,CAAC,KAAK,CAAC,EAAE,CAAC;gBACrD,OAAQ,YAA0B,CAAC,KAAK,CAAC;YAC3C,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,YAAmB,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;aAAM,CAAC;YACN,MAAM,YAAY,GAAI,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAM;gBACvD,GAAG;gBACH,cAAc;gBACd,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,WAAW,EAAE,SAAS;aACvB,CAAC,CAAC;YACH,OAAO,CAAC,YAAY,CAAC,CAAC;QACxB,CAAC;IAEH,CAAC;CAEF;AArRD,4BAqRC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="jest" />
|
|
2
1
|
import { CreateServiceRequestData, DeleteServiceRequestData, GetServiceRequestData, ListEmailsForNumberRequestData, ListNumbersForServiceRequestData, ListServicesRequestData, ServicePhoneNumber, ServiceResponse, UpdateServiceRequestData } from '../../../models';
|
|
3
2
|
import { ServicesApi } from './services-api';
|
|
4
3
|
import { ApiListPromise } from '@sinch/sdk-client';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sinch/fax",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Sinch Fax API",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"repository": {
|
|
@@ -25,13 +25,15 @@
|
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "yarn run clean && yarn run compile",
|
|
27
27
|
"clean": "rimraf dist tsconfig.tsbuildinfo",
|
|
28
|
-
"compile": "tsc -p tsconfig.build.json && tsc -p tsconfig.tests.json && rimraf dist/tests && rimraf tsconfig.build.tsbuildinfo"
|
|
28
|
+
"compile": "tsc -p tsconfig.build.json && tsc -p tsconfig.tests.json && rimraf dist/tests && rimraf tsconfig.build.tsbuildinfo",
|
|
29
|
+
"test:e2e": "cucumber-js"
|
|
29
30
|
},
|
|
30
31
|
"dependencies": {
|
|
31
|
-
"@sinch/sdk-client": "^1.1
|
|
32
|
+
"@sinch/sdk-client": "^1.2.1"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {},
|
|
34
35
|
"publishConfig": {
|
|
35
|
-
"directory": "dist"
|
|
36
|
+
"directory": "dist",
|
|
37
|
+
"access": "public"
|
|
36
38
|
}
|
|
37
39
|
}
|