Skip to content

Commit a3688c7

Browse files
author
Jonathan Wenger
committed
22.10.0 release with logging.
1 parent e991e27 commit a3688c7

File tree

398 files changed

+739
-399
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

398 files changed

+739
-399
lines changed

lib/AvaTaxClient.ts

Lines changed: 260 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @author Sachin Baijal <[email protected]>
1111
* @copyright 2004-2018 Avalara, Inc.
1212
* @license https://www.apache.org/licenses/LICENSE-2.0
13-
* @version 22.9.0
13+
* @version 22.10.0
1414
* @link https://github.com/avadev/AvaTax-REST-V2-JS-SDK
1515
*/
1616

@@ -43,9 +43,9 @@ export default class AvaTaxClient {
4343
public baseUrl: string;
4444
public timeout: number;
4545
public auth: string;
46-
private logger: Logger;
4746
public customHttpAgent: https.Agent;
48-
private apiVersion: string = '22.9.0';
47+
private apiVersion: string = '22.10.0';
48+
private logger: Logger;
4949
/**
5050
* Construct a new AvaTaxClient
5151
*
@@ -58,7 +58,7 @@ export default class AvaTaxClient {
5858
* @param {https.Agent} customHttpAgent Specify the http agent which will be used to make http requests to the Avatax APIs.
5959
* @param {LogOptions} logOptions Specify the logging options to be utilized by the SDK.
6060
*/
61-
constructor({ appName, appVersion, machineName, environment, timeout = 1200000, customHttpAgent, logOptions = { logEnabled: true, logLevel: LogLevel.Error } } :
61+
constructor({ appName, appVersion, machineName, environment, timeout = 1200000, customHttpAgent, logOptions = { logEnabled: false } } :
6262
{ appName: string, appVersion: string, machineName: string, environment: string, timeout: number, customHttpAgent: https.Agent, logOptions: LogOptions }) {
6363
this.appNM = appName;
6464
this.appVer = appVersion;
@@ -199,6 +199,11 @@ export default class AvaTaxClient {
199199
return this.baseUrl + url;
200200
}
201201

202+
/**
203+
* Create an entry for an HTTP Request/Response in the logger.
204+
*
205+
* @param {LogObject} logObject The instance of the logObject for a specific API invocation (HTTP Request)
206+
*/
202207
createLogEntry(logObject: LogObject) {
203208
if (logObject.getStatusCode() <= 299) {
204209
this.logger.info(logObject.toString());
@@ -207,6 +212,8 @@ export default class AvaTaxClient {
207212
}
208213
}
209214

215+
216+
210217
/**
211218
* Reset this account's license key
212219
* Resets the existing license key for this account to a new key.
@@ -10777,6 +10784,41 @@ export default class AvaTaxClient {
1077710784
return this.restCall({ url: path, verb: 'post', payload: model, clientId: strClientId });
1077810785
}
1077910786

10787+
/**
10788+
* Create Avalara-supported subscription (ServiceTypes)
10789+
* For Registrar Use Only
10790+
* This API is for use by Avalara Registrar administrative users only.
10791+
*
10792+
* Create one service/subscription object.
10793+
*
10794+
* Returns the newly created Avalara-supported subscription (service) type.
10795+
* This API is intended to be useful for adding new Avalara-supported subscription type (service type).
10796+
* You may always contact Avalara's sales department for information on available products or services.
10797+
*
10798+
* ### Security Policies
10799+
*
10800+
* * This API requires one of the following user roles: BatchServiceAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
10801+
* Swagger Name: AvaTaxClient
10802+
*
10803+
*
10804+
* @param {Models.SubscriptionTypeModel} model The subscription type object you wish to create.
10805+
* @return {Models.SubscriptionTypeModel}
10806+
*/
10807+
10808+
createServiceTypes({ model }: { model: Models.SubscriptionTypeModel }): Promise<Models.SubscriptionTypeModel> {
10809+
var path = this.buildUrl({
10810+
url: `/api/v2/servicetypes`,
10811+
parameters: {}
10812+
});
10813+
var strClientId =
10814+
this.appNM +
10815+
'; ' +
10816+
this.appVer +
10817+
'; JavascriptSdk; ' + this.apiVersion + '; ' +
10818+
this.machineNM;
10819+
return this.restCall({ url: path, verb: 'post', payload: model, clientId: strClientId });
10820+
}
10821+
1078010822
/**
1078110823
* Create a new subscription
1078210824
* This API is for use by Avalara Registrar administrative users only.
@@ -10880,6 +10922,38 @@ export default class AvaTaxClient {
1088010922
return this.restCall({ url: path, verb: 'delete', payload: null, clientId: strClientId });
1088110923
}
1088210924

10925+
/**
10926+
* Delete a single Subscription (ServiceTypes) object
10927+
* For Registrar Use Only
10928+
* This API is for use by Avalara Registrar administrative users only.
10929+
*
10930+
* Marks the Subscription (ServiceTypes) object identified by this URL as deleted.
10931+
* This API is useful for deleting an existing Avalara-supported subscription type (service type).
10932+
*
10933+
* ### Security Policies
10934+
*
10935+
* * This API requires one of the following user roles: BatchServiceAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
10936+
* Swagger Name: AvaTaxClient
10937+
*
10938+
*
10939+
* @param {number} id The unique ID number of the Subscription object you wish to delete.
10940+
* @return {Models.ErrorDetail[]}
10941+
*/
10942+
10943+
deleteServiceType({ id }: { id: number }): Promise<Models.ErrorDetail[]> {
10944+
var path = this.buildUrl({
10945+
url: `/api/v2/servicetypes/${id}`,
10946+
parameters: {}
10947+
});
10948+
var strClientId =
10949+
this.appNM +
10950+
'; ' +
10951+
this.appVer +
10952+
'; JavascriptSdk; ' + this.apiVersion + '; ' +
10953+
this.machineNM;
10954+
return this.restCall({ url: path, verb: 'delete', payload: null, clientId: strClientId });
10955+
}
10956+
1088310957
/**
1088410958
* Delete a single subscription
1088510959
* # For Registrar Use Only
@@ -10912,6 +10986,48 @@ export default class AvaTaxClient {
1091210986
return this.restCall({ url: path, verb: 'delete', payload: null, clientId: strClientId });
1091310987
}
1091410988

10989+
/**
10990+
* Retrieve the full list of Avalara-supported subscription (ServiceTypes)
10991+
* For Registrar Use Only
10992+
* This API is for use by Avalara Registrar administrative users only.
10993+
*
10994+
* Returns the full list of Avalara-supported subscription types.
10995+
* This API is intended to be useful for identifying which features you have added to your account.
10996+
* You may always contact Avalara's sales department for information on available products or services.
10997+
* You cannot change your subscriptions/service directly through the API.
10998+
*
10999+
* ### Security Policies
11000+
*
11001+
* * This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
11002+
* Swagger Name: AvaTaxClient
11003+
*
11004+
*
11005+
* @param {string} filter A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
11006+
* @param {number} top If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records.
11007+
* @param {number} skip If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
11008+
* @param {string} orderBy A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
11009+
* @return {object}
11010+
*/
11011+
11012+
listServiceTypes({ filter, top, skip, orderBy }: { filter: string, top?: number, skip?: number, orderBy: string }): Promise<object> {
11013+
var path = this.buildUrl({
11014+
url: `/api/v2/servicetypes/servicetypes`,
11015+
parameters: {
11016+
$filter: filter,
11017+
$top: top,
11018+
$skip: skip,
11019+
$orderBy: orderBy
11020+
}
11021+
});
11022+
var strClientId =
11023+
this.appNM +
11024+
'; ' +
11025+
this.appVer +
11026+
'; JavascriptSdk; ' + this.apiVersion + '; ' +
11027+
this.machineNM;
11028+
return this.restCall({ url: path, verb: 'get', payload: null, clientId: strClientId });
11029+
}
11030+
1091511031
/**
1091611032
* Reset a user's password programmatically
1091711033
* # For Registrar Use Only
@@ -11021,6 +11137,40 @@ export default class AvaTaxClient {
1102111137
return this.restCall({ url: path, verb: 'put', payload: model, clientId: strClientId });
1102211138
}
1102311139

11140+
/**
11141+
* Update existing Avalara-supported subscription (ServiceTypes)
11142+
* For Registrar Use Only
11143+
* This API is for use by Avalara Registrar administrative users only.
11144+
*
11145+
* Returns the updated Avalara-supported service types.
11146+
* This API is intended to be useful for updating an existing subscription(service) type detail.
11147+
* You may always contact Avalara's sales department for information on available products or services.
11148+
*
11149+
* ### Security Policies
11150+
*
11151+
* * This API requires one of the following user roles: BatchServiceAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
11152+
* Swagger Name: AvaTaxClient
11153+
*
11154+
*
11155+
* @param {number} id The unique ID number of the existing subscription type object to replace.
11156+
* @param {Models.SubscriptionTypeModel} model The subscription type object to update.
11157+
* @return {Models.SubscriptionTypeModel}
11158+
*/
11159+
11160+
updateServiceType({ id, model }: { id: number, model: Models.SubscriptionTypeModel }): Promise<Models.SubscriptionTypeModel> {
11161+
var path = this.buildUrl({
11162+
url: `/api/v2/servicetypes/${id}`,
11163+
parameters: {}
11164+
});
11165+
var strClientId =
11166+
this.appNM +
11167+
'; ' +
11168+
this.appVer +
11169+
'; JavascriptSdk; ' + this.apiVersion + '; ' +
11170+
this.machineNM;
11171+
return this.restCall({ url: path, verb: 'put', payload: model, clientId: strClientId });
11172+
}
11173+
1102411174
/**
1102511175
* Update a single subscription
1102611176
* # For Registrar Use Only
@@ -14334,6 +14484,112 @@ export default class AvaTaxClient {
1433414484
return this.restCall({ url: path, verb: 'get', payload: null, clientId: strClientId });
1433514485
}
1433614486

14487+
/**
14488+
* Fetches a previously stored age verification response.
14489+
* The request must meet the following criteria in order to be evaluated:
14490+
* * *firstName*, *lastName*, and *address* are required fields.
14491+
* * One of the following sets of attributes are required for the *address*:
14492+
* * *line1, city, region*
14493+
* * *line1, postalCode*
14494+
*
14495+
* * Optionally, the request may use the following parameters:
14496+
* * A *DOB* (Date of Birth) field. The value should be ISO-8601 compliant (e.g. 2020-07-21).
14497+
* * Beyond the required *address* fields above, a *country* field is permitted
14498+
* * The valid values for this attribute are [*US, USA*]
14499+
* Swagger Name: AvaTaxBeverageClient
14500+
*
14501+
*
14502+
* @param {Models.AgeVerifyRequest} model Information about the individual whose age is being verified.
14503+
* @return {Models.AgeVerifyResult}
14504+
*/
14505+
14506+
findAgeVerification({ model }: { model: Models.AgeVerifyRequest }): Promise<Models.AgeVerifyResult> {
14507+
var path = this.buildUrl({
14508+
url: `/api/v2/ageverification/store/identity/find`,
14509+
parameters: {}
14510+
});
14511+
var strClientId =
14512+
this.appNM +
14513+
'; ' +
14514+
this.appVer +
14515+
'; JavascriptSdk; ' + this.apiVersion + '; ' +
14516+
this.machineNM;
14517+
return this.restCall({ url: path, verb: 'put', payload: model, clientId: strClientId });
14518+
}
14519+
14520+
/**
14521+
* Stores an age verification response for the account.
14522+
* The request field must meet the following criteria in order to be evaluated:
14523+
* * *firstName*, *lastName*, and *address* are required fields.
14524+
* * One of the following sets of attributes are required for the *address*:
14525+
* * *line1, city, region*
14526+
* * *line1, postalCode*
14527+
*
14528+
* * Optionally, request field may use the following parameters:
14529+
* * A *DOB* (Date of Birth) field. The value should be ISO-8601 compliant (e.g. 2020-07-21).
14530+
* * Beyond the required *address* fields above, a *country* field is permitted
14531+
* * The valid values for this attribute are [*US, USA*]
14532+
*
14533+
*
14534+
* The response field must meet the following criteria in order to be evaluated:
14535+
* * *isOfAge*, *failureCodes* are required fields
14536+
* Swagger Name: AvaTaxBeverageClient
14537+
*
14538+
*
14539+
* @param {Models.StoreAgeVerifyRequest} model Information about the individual whose age has been verified and the corresponding age verification response.
14540+
* @return {}
14541+
*/
14542+
14543+
storeAgeVerification({ model }: { model: Models.StoreAgeVerifyRequest }): Promise<null> {
14544+
var path = this.buildUrl({
14545+
url: `/api/v2/ageverification/store/identity`,
14546+
parameters: {}
14547+
});
14548+
var strClientId =
14549+
this.appNM +
14550+
'; ' +
14551+
this.appVer +
14552+
'; JavascriptSdk; ' + this.apiVersion + '; ' +
14553+
this.machineNM;
14554+
return this.restCall({ url: path, verb: 'put', payload: model, clientId: strClientId });
14555+
}
14556+
14557+
/**
14558+
* Conditionally performs an age verification check. If a record matching the request is found in the internal store, the associated response is returned. Otherwise, an age verification check is performed and the response is stored if the individual is determined to be of age.
14559+
* The request must meet the following criteria in order to be evaluated:
14560+
* * *firstName*, *lastName*, and *address* are required fields.
14561+
* * One of the following sets of attributes are required for the *address*:
14562+
* * *line1, city, region*
14563+
* * *line1, postalCode*
14564+
*
14565+
* * Optionally, the request may use the following parameters:
14566+
* * A *DOB* (Date of Birth) field. The value should be ISO-8601 compliant (e.g. 2020-07-21).
14567+
* * Beyond the required *address* fields above, a *country* field is permitted
14568+
* * The valid values for this attribute are [*US, USA*]
14569+
* Swagger Name: AvaTaxBeverageClient
14570+
*
14571+
*
14572+
* @param {string} simulatedFailureCode (Optional) The failure code included in the simulated response of the endpoint. Note that this endpoint is only available in Sandbox for testing purposes.
14573+
* @param {Models.AgeVerifyRequest} model Information about the individual whose age is being verified.
14574+
* @return {Models.StoreIfVerifiedResult}
14575+
*/
14576+
14577+
storeIfVerified({ simulatedFailureCode, model }: { simulatedFailureCode: string, model: Models.AgeVerifyRequest }): Promise<Models.StoreIfVerifiedResult> {
14578+
var path = this.buildUrl({
14579+
url: `/api/v2/ageverification/store/identity/storeIfVerified`,
14580+
parameters: {
14581+
simulatedFailureCode: simulatedFailureCode
14582+
}
14583+
});
14584+
var strClientId =
14585+
this.appNM +
14586+
'; ' +
14587+
this.appVer +
14588+
'; JavascriptSdk; ' + this.apiVersion + '; ' +
14589+
this.machineNM;
14590+
return this.restCall({ url: path, verb: 'put', payload: model, clientId: strClientId });
14591+
}
14592+
1433714593
/**
1433814594
* Determines whether an individual meets or exceeds the minimum legal drinking age.
1433914595
* The request must meet the following criteria in order to be evaluated:

lib/enums/AccountStatusId.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @author Sachin Baijal <[email protected]>
1111
* @copyright 2004-2018 Avalara, Inc.
1212
* @license https://www.apache.org/licenses/LICENSE-2.0
13-
* @version 22.9.0
13+
* @version 22.10.0
1414
* @link https://github.com/avadev/AvaTax-REST-V2-JS-SDK
1515
*/
1616

lib/enums/AccountTypeId.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @author Sachin Baijal <[email protected]>
1111
* @copyright 2004-2018 Avalara, Inc.
1212
* @license https://www.apache.org/licenses/LICENSE-2.0
13-
* @version 22.9.0
13+
* @version 22.10.0
1414
* @link https://github.com/avadev/AvaTax-REST-V2-JS-SDK
1515
*/
1616

lib/enums/AccrualType.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @author Sachin Baijal <[email protected]>
1111
* @copyright 2004-2018 Avalara, Inc.
1212
* @license https://www.apache.org/licenses/LICENSE-2.0
13-
* @version 22.9.0
13+
* @version 22.10.0
1414
* @link https://github.com/avadev/AvaTax-REST-V2-JS-SDK
1515
*/
1616

lib/enums/AddressCategoryId.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @author Sachin Baijal <[email protected]>
1111
* @copyright 2004-2018 Avalara, Inc.
1212
* @license https://www.apache.org/licenses/LICENSE-2.0
13-
* @version 22.9.0
13+
* @version 22.10.0
1414
* @link https://github.com/avadev/AvaTax-REST-V2-JS-SDK
1515
*/
1616

lib/enums/AddressTypeId.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @author Sachin Baijal <[email protected]>
1111
* @copyright 2004-2018 Avalara, Inc.
1212
* @license https://www.apache.org/licenses/LICENSE-2.0
13-
* @version 22.9.0
13+
* @version 22.10.0
1414
* @link https://github.com/avadev/AvaTax-REST-V2-JS-SDK
1515
*/
1616

lib/enums/AdjustmentPeriodTypeId.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @author Sachin Baijal <[email protected]>
1111
* @copyright 2004-2018 Avalara, Inc.
1212
* @license https://www.apache.org/licenses/LICENSE-2.0
13-
* @version 22.9.0
13+
* @version 22.10.0
1414
* @link https://github.com/avadev/AvaTax-REST-V2-JS-SDK
1515
*/
1616

lib/enums/AdjustmentReason.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @author Sachin Baijal <[email protected]>
1111
* @copyright 2004-2018 Avalara, Inc.
1212
* @license https://www.apache.org/licenses/LICENSE-2.0
13-
* @version 22.9.0
13+
* @version 22.10.0
1414
* @link https://github.com/avadev/AvaTax-REST-V2-JS-SDK
1515
*/
1616

0 commit comments

Comments
 (0)