Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
*/

import debugBuilder from 'debug';
import EventEmitter from 'eventemitter3';
import { EventEmitter } from 'eventemitter3';
import * as _ from 'lodash';
import { HttpClient } from './http';
import { IHeaders, IHttpClient, IMTOMAttachments, IOptions, ISecurity, SoapMethod, SoapMethodAsync } from './types';
import { assert, findPrefix } from './utils';
import { WSDL } from './wsdl';
import { IPort, OperationElement, ServiceElement } from './wsdl/elements';
import { HttpClient } from './http.js';
import { IHeaders, IHttpClient, IMTOMAttachments, IOptions, ISecurity, SoapMethod, SoapMethodAsync } from './types.js';
import { assert, findPrefix } from './utils.js';
import { WSDL } from './wsdl/index.js';
import { IPort, OperationElement, ServiceElement } from './wsdl/elements.js';

/**
* Read a ReadableStream to string
Expand Down
6 changes: 3 additions & 3 deletions src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

import debugBuilder from 'debug';
import MIMEType from 'whatwg-mimetype';
import { IExOptions, IHeaders, IHttpClient, IOptions } from './types';
import { parseMTOMResp } from './utils';
import { IExOptions, IHeaders, IHttpClient, IOptions } from './types.js';
import { parseMTOMResp } from './utils.js';

const debug = debugBuilder('fetch-soap');

// Use default import for bundler compatibility (named imports from JSON don't work in webpack/Next.js)
import pkg from '../package.json';
import pkg from '../package.json' with { type: 'json' };
Comment thread
evans-sam marked this conversation as resolved.
const version = pkg.version;

const textEncoder = new TextEncoder();
Expand Down
4 changes: 2 additions & 2 deletions src/security/BasicAuthSecurity.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as _ from 'lodash';
import { IHeaders, ISecurity } from '../types';
import { stringToBase64 } from '../utils';
import { IHeaders, ISecurity } from '../types.js';
import { stringToBase64 } from '../utils.js';

export class BasicAuthSecurity implements ISecurity {
private _username: string;
Expand Down
2 changes: 1 addition & 1 deletion src/security/BearerSecurity.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as _ from 'lodash';
import { IHeaders, ISecurity } from '../types';
import { IHeaders, ISecurity } from '../types.js';

export class BearerSecurity implements ISecurity {
private defaults;
Expand Down
4 changes: 2 additions & 2 deletions src/security/WSSecurity.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ISecurity } from '../types';
import { generateNonce, passwordDigest, xmlEscape } from '../utils';
import { ISecurity } from '../types.js';
import { generateNonce, passwordDigest, xmlEscape } from '../utils.js';

const validPasswordTypes = ['PasswordDigest', 'PasswordText'];

Expand Down
6 changes: 3 additions & 3 deletions src/security/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './BasicAuthSecurity';
export * from './BearerSecurity';
export * from './WSSecurity';
export * from './BasicAuthSecurity.js';
export * from './BearerSecurity.js';
export * from './WSSecurity.js';
22 changes: 11 additions & 11 deletions src/soap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
* MIT Licensed
*/

import { Client } from './client';
import * as _security from './security';
import { IOptions, IWSDLCache } from './types';
import { wsdlCacheSingleton } from './utils';
import { open_wsdl, WSDL } from './wsdl';
import { Client } from './client.js';
import * as _security from './security/index.js';
import { IOptions, IWSDLCache } from './types.js';
import { wsdlCacheSingleton } from './utils.js';
import { open_wsdl, WSDL } from './wsdl/index.js';

export const security = _security;
export { Client } from './client';
export { HttpClient } from './http';
export { BasicAuthSecurity, BearerSecurity, WSSecurity } from './security';
export { passwordDigest } from './utils';
export * from './types';
export { WSDL } from './wsdl';
export { Client } from './client.js';
export { HttpClient } from './http.js';
export { BasicAuthSecurity, BearerSecurity, WSSecurity } from './security/index.js';
export { passwordDigest } from './utils.js';
export * from './types.js';
export { WSDL } from './wsdl/index.js';

type WSDLCallback = (error: any, result?: WSDL) => any;

Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WSDL } from './wsdl';
import type { IHttpResponse } from './http';
import { WSDL } from './wsdl/index.js';
import type { IHttpResponse } from './http.js';

export interface IHeaders {
[k: string]: any;
Expand Down
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IMTOMAttachments, IWSDLCache } from './types';
import { WSDL } from './wsdl';
import { IMTOMAttachments, IWSDLCache } from './types.js';
import { WSDL } from './wsdl/index.js';

/**
* Simple assertion function (replaces Node.js assert module)
Expand Down
4 changes: 2 additions & 2 deletions src/wsdl/elements.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import debugBuilder from 'debug';
import * as _ from 'lodash';
import { IWsdlBaseOptions } from '../types';
import { assert, splitQName, TNS_PREFIX } from '../utils';
import { IWsdlBaseOptions } from '../types.js';
import { assert, splitQName, TNS_PREFIX } from '../utils.js';

const debug = debugBuilder('fetch-soap');

Expand Down
10 changes: 5 additions & 5 deletions src/wsdl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import debugBuilder from 'debug';
import * as _ from 'lodash';
import * as sax from 'sax';
import stripBom from 'strip-bom';
import { HttpClient } from '../http';
import { NamespaceContext } from '../nscontext';
import { IOptions } from '../types';
import { assert, findPrefix, splitQName, TNS_PREFIX, xmlEscape } from '../utils';
import * as elements from './elements';
import { HttpClient } from '../http.js';
import { NamespaceContext } from '../nscontext.js';
import { IOptions } from '../types.js';
import { assert, findPrefix, splitQName, TNS_PREFIX, xmlEscape } from '../utils.js';
import * as elements from './elements.js';

const debug = debugBuilder('fetch-soap');

Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"compileOnSave": true,
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"moduleResolution": "bundler",
"module": "nodenext",
"moduleResolution": "nodenext",
"lib": ["ES2020", "DOM"],
"outDir": "lib",
"rootDir": "src",
Expand Down
Loading