Skip to content
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Added

- `organizations.downloadManifiestoZipUrl(id)` to obtain a temporary URL for downloading the signed Carta Manifiesto ZIP associated with the organization's certificate RFC.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

la versión 6.0 ya la publicamos, aunque malamente está marcada como unreleased. Tenemos que actualizar eso

- Autocompletion and editor documentation for request fields, method arguments, and responses across SDK operations.
- More precise input types for CFDI variants, drafts, structured complements, and customer creation. Related fields are checked by TypeScript in supported cases, helping catch incomplete or incompatible inputs before sending a request.
- Invoice responses distinguish draft, pending, failed, and stamped states; checking the status exposes the guaranteed UUID and stamp fields.
Expand Down
2 changes: 1 addition & 1 deletion openapi/source.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"repository": "FacturAPI/facturapi-docs",
"revision": "fbcd72e8cf2b1d1b38d3fd5889ecde6545434c61",
"revision": "6a81247386e6e9036c618e99c2e91c2b7e74ab77",
"path": "website/openapi_v2.yaml"
}
6 changes: 6 additions & 0 deletions scripts/sdk/resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,12 @@
]
},
"deleteCertificate": "deleteOrganizationCertificate",
"downloadManifiestoZipUrl": {
"operation": "getOrganizationManifiestoDownloadUrl",
"argumentNames": {
"organization_id": "id"
}
},
"del": "deleteOrganization",
"getTestApiKey": "getTestApiKey",
"renewTestApiKey": "renewTestApiKey",
Expand Down
1 change: 1 addition & 0 deletions src/generated/dates.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions src/generated/input.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions src/generated/output.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions src/resources/organizations.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions test/node/signed-download-urls.node.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,32 @@ describe('signed download URLs', () => {
expect(result.filename).toBe('receipt.pdf');
});

it('requests a signed URL for the organization manifiesto ZIP', async () => {
const client = new Facturapi('sk_test_123');
client.BASE_URL = 'https://api.test.local/v2';
globalThis.fetch = vi.fn(async (url, options) => {
expect(url).toBe(
'https://api.test.local/v2/organizations/org_123/manifiesto/download-url',
);
expect(options?.method).toBe('GET');
return signedUrlResponse(
'application/zip',
'manifiesto_AAA010101AAA.zip',
);
}) as typeof fetch;

const result =
await client.organizations.downloadManifiestoZipUrl('org_123');

expect(result).toEqual(
expect.objectContaining({
content_type: 'application/zip',
filename: 'manifiesto_AAA010101AAA.zip',
expires_at: new Date('2030-01-01T00:00:00.000Z'),
}),
);
});

it.each([
[
'PDF',
Expand Down Expand Up @@ -189,6 +215,9 @@ describe('signed download URLs', () => {
await expect(client.retentions.downloadZipUrl('')).rejects.toThrow(
'id is required',
);
await expect(
client.organizations.downloadManifiestoZipUrl(''),
).rejects.toThrow('id is required');
expect(fetchMock).not.toHaveBeenCalled();
});
});
Loading