Skip to content

Commit

Permalink
Release v0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Jul 11, 2023
1 parent dfcf550 commit cb82a29
Show file tree
Hide file tree
Showing 286 changed files with 1,574 additions and 1,365 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mercoa/javascript",
"version": "v0.2.0",
"version": "v0.2.1",
"private": false,
"repository": "https://github.com/mercoa-finance/javascript",
"main": "./index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/api/resources/bankLookup/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class BankLookup {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@mercoa/javascript",
"X-Fern-SDK-Version": "v0.2.0",
"X-Fern-SDK-Version": "v0.2.1",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down
7 changes: 0 additions & 7 deletions src/api/resources/commons/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
export * from "./EntityId";
export * from "./EntityUserId";
export * from "./ApprovalPolicyId";
export * from "./CommentId";
export * from "./InvoiceId";
export * from "./PaymentMethodId";
export * from "./PaymentMethodSchemaId";
export * from "./FullName";
export * from "./BirthDate";
export * from "./Address";
Expand Down
52 changes: 24 additions & 28 deletions src/api/resources/entity/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class Entity {
* @throws {@link Mercoa.AuthHeaderMalformedError}
* @throws {@link Mercoa.Unauthorized}
*/
public async getAll(request: Mercoa.entity.GetAllEntities = {}): Promise<Mercoa.entity.EntityResponse[]> {
public async getAll(request: Mercoa.entity.GetAllEntities = {}): Promise<Mercoa.EntityResponse[]> {
const { isPayee, isPayor } = request;
const _queryParams = new URLSearchParams();
if (isPayee != null) {
Expand All @@ -53,7 +53,7 @@ export class Entity {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@mercoa/javascript",
"X-Fern-SDK-Version": "v0.2.0",
"X-Fern-SDK-Version": "v0.2.1",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -118,7 +118,7 @@ export class Entity {
* @throws {@link Mercoa.AuthHeaderMalformedError}
* @throws {@link Mercoa.Unauthorized}
*/
public async find(request: Mercoa.entity.FindEntities = {}): Promise<Mercoa.entity.EntityResponse[]> {
public async find(request: Mercoa.entity.FindEntities = {}): Promise<Mercoa.EntityResponse[]> {
const { foreignId, status } = request;
const _queryParams = new URLSearchParams();
if (foreignId != null) {
Expand All @@ -139,7 +139,7 @@ export class Entity {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@mercoa/javascript",
"X-Fern-SDK-Version": "v0.2.0",
"X-Fern-SDK-Version": "v0.2.1",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -204,7 +204,7 @@ export class Entity {
* @throws {@link Mercoa.AuthHeaderMalformedError}
* @throws {@link Mercoa.Unauthorized}
*/
public async create(request: Mercoa.entity.EntityRequest): Promise<Mercoa.entity.EntityResponse> {
public async create(request: Mercoa.EntityRequest): Promise<Mercoa.EntityResponse> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.MercoaEnvironment.Production,
Expand All @@ -215,14 +215,14 @@ export class Entity {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@mercoa/javascript",
"X-Fern-SDK-Version": "v0.2.0",
"X-Fern-SDK-Version": "v0.2.1",
},
contentType: "application/json",
body: await serializers.entity.EntityRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
body: await serializers.EntityRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
timeoutMs: 60000,
});
if (_response.ok) {
return await serializers.entity.EntityResponse.parseOrThrow(_response.body, {
return await serializers.EntityResponse.parseOrThrow(_response.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
Expand Down Expand Up @@ -281,7 +281,7 @@ export class Entity {
* @throws {@link Mercoa.AuthHeaderMalformedError}
* @throws {@link Mercoa.Unauthorized}
*/
public async get(entityId: Mercoa.EntityId): Promise<Mercoa.entity.EntityResponse> {
public async get(entityId: Mercoa.EntityId): Promise<Mercoa.EntityResponse> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.MercoaEnvironment.Production,
Expand All @@ -292,13 +292,13 @@ export class Entity {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@mercoa/javascript",
"X-Fern-SDK-Version": "v0.2.0",
"X-Fern-SDK-Version": "v0.2.1",
},
contentType: "application/json",
timeoutMs: 60000,
});
if (_response.ok) {
return await serializers.entity.EntityResponse.parseOrThrow(_response.body, {
return await serializers.EntityResponse.parseOrThrow(_response.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
Expand Down Expand Up @@ -359,8 +359,8 @@ export class Entity {
*/
public async update(
entityId: Mercoa.EntityId,
request: Mercoa.entity.EntityUpdateRequest
): Promise<Mercoa.entity.EntityResponse> {
request: Mercoa.EntityUpdateRequest
): Promise<Mercoa.EntityResponse> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.MercoaEnvironment.Production,
Expand All @@ -371,16 +371,14 @@ export class Entity {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@mercoa/javascript",
"X-Fern-SDK-Version": "v0.2.0",
"X-Fern-SDK-Version": "v0.2.1",
},
contentType: "application/json",
body: await serializers.entity.EntityUpdateRequest.jsonOrThrow(request, {
unrecognizedObjectKeys: "strip",
}),
body: await serializers.EntityUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
timeoutMs: 60000,
});
if (_response.ok) {
return await serializers.entity.EntityResponse.parseOrThrow(_response.body, {
return await serializers.EntityResponse.parseOrThrow(_response.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
Expand Down Expand Up @@ -450,7 +448,7 @@ export class Entity {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@mercoa/javascript",
"X-Fern-SDK-Version": "v0.2.0",
"X-Fern-SDK-Version": "v0.2.1",
},
contentType: "application/json",
timeoutMs: 60000,
Expand Down Expand Up @@ -521,7 +519,7 @@ export class Entity {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@mercoa/javascript",
"X-Fern-SDK-Version": "v0.2.0",
"X-Fern-SDK-Version": "v0.2.1",
},
contentType: "application/json",
timeoutMs: 60000,
Expand Down Expand Up @@ -597,7 +595,7 @@ export class Entity {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@mercoa/javascript",
"X-Fern-SDK-Version": "v0.2.0",
"X-Fern-SDK-Version": "v0.2.1",
},
contentType: "application/json",
timeoutMs: 60000,
Expand Down Expand Up @@ -673,7 +671,7 @@ export class Entity {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@mercoa/javascript",
"X-Fern-SDK-Version": "v0.2.0",
"X-Fern-SDK-Version": "v0.2.1",
},
contentType: "application/json",
timeoutMs: 60000,
Expand Down Expand Up @@ -748,7 +746,7 @@ export class Entity {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@mercoa/javascript",
"X-Fern-SDK-Version": "v0.2.0",
"X-Fern-SDK-Version": "v0.2.1",
},
contentType: "application/json",
timeoutMs: 60000,
Expand Down Expand Up @@ -813,7 +811,7 @@ export class Entity {
* @throws {@link Mercoa.AuthHeaderMalformedError}
* @throws {@link Mercoa.Unauthorized}
*/
public async addPayees(entityId: Mercoa.EntityId, request: Mercoa.entity.EntityAddPayeesRequest): Promise<void> {
public async addPayees(entityId: Mercoa.EntityId, request: Mercoa.EntityAddPayeesRequest): Promise<void> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.MercoaEnvironment.Production,
Expand All @@ -824,12 +822,10 @@ export class Entity {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@mercoa/javascript",
"X-Fern-SDK-Version": "v0.2.0",
"X-Fern-SDK-Version": "v0.2.1",
},
contentType: "application/json",
body: await serializers.entity.EntityAddPayeesRequest.jsonOrThrow(request, {
unrecognizedObjectKeys: "strip",
}),
body: await serializers.EntityAddPayeesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
timeoutMs: 60000,
});
if (_response.ok) {
Expand Down
2 changes: 1 addition & 1 deletion src/api/resources/entity/client/requests/FindEntities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ import * as Mercoa from "../../../..";

export interface FindEntities {
foreignId?: string;
status?: Mercoa.entity.EntityStatus;
status?: Mercoa.EntityStatus;
}
1 change: 0 additions & 1 deletion src/api/resources/entity/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from "./types";
export * from "./resources";
export * from "./client";
34 changes: 16 additions & 18 deletions src/api/resources/entity/resources/approvalPolicy/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class ApprovalPolicy {
* @throws {@link Mercoa.AuthHeaderMalformedError}
* @throws {@link Mercoa.Unauthorized}
*/
public async getAll(entityId: Mercoa.EntityId): Promise<Mercoa.entity.ApprovalPolicyResponse[]> {
public async getAll(entityId: Mercoa.EntityId): Promise<Mercoa.ApprovalPolicyResponse[]> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.MercoaEnvironment.Production,
Expand All @@ -36,7 +36,7 @@ export class ApprovalPolicy {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@mercoa/javascript",
"X-Fern-SDK-Version": "v0.2.0",
"X-Fern-SDK-Version": "v0.2.1",
},
contentType: "application/json",
timeoutMs: 60000,
Expand Down Expand Up @@ -105,8 +105,8 @@ export class ApprovalPolicy {
*/
public async create(
entityId: Mercoa.EntityId,
request: Mercoa.entity.ApprovalPolicyRequest
): Promise<Mercoa.entity.ApprovalPolicyResponse> {
request: Mercoa.ApprovalPolicyRequest
): Promise<Mercoa.ApprovalPolicyResponse> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.MercoaEnvironment.Production,
Expand All @@ -117,16 +117,14 @@ export class ApprovalPolicy {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@mercoa/javascript",
"X-Fern-SDK-Version": "v0.2.0",
"X-Fern-SDK-Version": "v0.2.1",
},
contentType: "application/json",
body: await serializers.entity.ApprovalPolicyRequest.jsonOrThrow(request, {
unrecognizedObjectKeys: "strip",
}),
body: await serializers.ApprovalPolicyRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
timeoutMs: 60000,
});
if (_response.ok) {
return await serializers.entity.ApprovalPolicyResponse.parseOrThrow(_response.body, {
return await serializers.ApprovalPolicyResponse.parseOrThrow(_response.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
Expand Down Expand Up @@ -206,7 +204,7 @@ export class ApprovalPolicy {
public async get(
entityId: Mercoa.EntityId,
policyId: Mercoa.ApprovalPolicyId
): Promise<Mercoa.entity.ApprovalPolicyResponse> {
): Promise<Mercoa.ApprovalPolicyResponse> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.MercoaEnvironment.Production,
Expand All @@ -219,13 +217,13 @@ export class ApprovalPolicy {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@mercoa/javascript",
"X-Fern-SDK-Version": "v0.2.0",
"X-Fern-SDK-Version": "v0.2.1",
},
contentType: "application/json",
timeoutMs: 60000,
});
if (_response.ok) {
return await serializers.entity.ApprovalPolicyResponse.parseOrThrow(_response.body, {
return await serializers.ApprovalPolicyResponse.parseOrThrow(_response.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
Expand Down Expand Up @@ -289,8 +287,8 @@ export class ApprovalPolicy {
public async update(
entityId: Mercoa.EntityId,
policyId: Mercoa.ApprovalPolicyId,
request: Mercoa.entity.ApprovalPolicyUpdateRequest
): Promise<Mercoa.entity.ApprovalPolicyResponse> {
request: Mercoa.ApprovalPolicyUpdateRequest
): Promise<Mercoa.ApprovalPolicyResponse> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.MercoaEnvironment.Production,
Expand All @@ -303,16 +301,16 @@ export class ApprovalPolicy {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@mercoa/javascript",
"X-Fern-SDK-Version": "v0.2.0",
"X-Fern-SDK-Version": "v0.2.1",
},
contentType: "application/json",
body: await serializers.entity.ApprovalPolicyUpdateRequest.jsonOrThrow(request, {
body: await serializers.ApprovalPolicyUpdateRequest.jsonOrThrow(request, {
unrecognizedObjectKeys: "strip",
}),
timeoutMs: 60000,
});
if (_response.ok) {
return await serializers.entity.ApprovalPolicyResponse.parseOrThrow(_response.body, {
return await serializers.ApprovalPolicyResponse.parseOrThrow(_response.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
Expand Down Expand Up @@ -402,7 +400,7 @@ export class ApprovalPolicy {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@mercoa/javascript",
"X-Fern-SDK-Version": "v0.2.0",
"X-Fern-SDK-Version": "v0.2.1",
},
contentType: "application/json",
timeoutMs: 60000,
Expand Down
1 change: 0 additions & 1 deletion src/api/resources/entity/resources/approvalPolicy/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from "./types";
export * from "./errors";
export * from "./client";
13 changes: 0 additions & 13 deletions src/api/resources/entity/resources/approvalPolicy/types/Rule.ts

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class Counterparty {
public async find(
entityId: Mercoa.EntityId,
request: Mercoa.entity.FindCounterpartiesRequest = {}
): Promise<Mercoa.entity.FindCounterpartiesResponse> {
): Promise<Mercoa.FindCounterpartiesResponse> {
const { paymentMethods } = request;
const _queryParams = new URLSearchParams();
if (paymentMethods != null) {
Expand All @@ -46,14 +46,14 @@ export class Counterparty {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@mercoa/javascript",
"X-Fern-SDK-Version": "v0.2.0",
"X-Fern-SDK-Version": "v0.2.1",
},
contentType: "application/json",
queryParameters: _queryParams,
timeoutMs: 60000,
});
if (_response.ok) {
return await serializers.entity.FindCounterpartiesResponse.parseOrThrow(_response.body, {
return await serializers.FindCounterpartiesResponse.parseOrThrow(_response.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
Expand Down
1 change: 0 additions & 1 deletion src/api/resources/entity/resources/counterparty/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from "./types";
export * from "./client";

This file was deleted.

Loading

0 comments on commit cb82a29

Please sign in to comment.