@fleetless/contracts 7.0.0 → 7.1.0-next.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/CHANGELOG.md +11 -0
- package/artifacts/openapi.json +390 -0
- package/artifacts/routes.json +89 -0
- package/artifacts/schema/billing-document-detail.schema.json +130 -0
- package/artifacts/schema/billing-document-file-query.schema.json +16 -0
- package/artifacts/schema/billing-document-list.schema.json +113 -0
- package/artifacts/schema/billing-document.schema.json +83 -0
- package/artifacts/schema/billing-documents-unavailable-details.schema.json +22 -0
- package/dist/billing.d.ts +167 -0
- package/dist/billing.js +110 -0
- package/dist/errors.d.ts +17 -1
- package/dist/errors.js +32 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +6 -2
- package/dist/routes.js +46 -1
- package/package.json +1 -1
package/dist/routes.js
CHANGED
|
@@ -12,7 +12,7 @@ import { jobRunListResponse, jobRunQuery, jobRunSummary, jobRunSummaryQuery } fr
|
|
|
12
12
|
import { MCP_APP_PATHS, mcpRobotDatasheet, mcpRolePreviewResponse } from './mcp.js';
|
|
13
13
|
import { authorizationServerMetadata, dynamicClientRegistrationRequest, dynamicClientRegistrationResponse, oauthAuthorizeQuery, oauthRedirectResponse, oauthTokenRequest, oauthTokenResponse, protectedResourceMetadata, } from './oauth.js';
|
|
14
14
|
import { adminPlanChangeRequest, orgPlan, planChangeRequest } from './plans.js';
|
|
15
|
-
import { purchaseIntentLookupQuery, purchaseIntentConfirmRequest, purchaseIntentResponse, invoicePayRequest, billingCancelRequest, billingChangeRequest, billingChangeResponse, billingDetailsUpdate, billingView, checkoutRequest, checkoutResponse, checkoutStatus, paymentMethodChangeRequest, vatIdCheckRequest, vatIdCheckResponse, } from './billing.js';
|
|
15
|
+
import { purchaseIntentLookupQuery, purchaseIntentConfirmRequest, purchaseIntentResponse, invoicePayRequest, billingCancelRequest, billingChangeRequest, billingChangeResponse, billingDetailsUpdate, billingDocumentDetail, billingDocumentFileQuery, billingDocumentList, billingView, checkoutRequest, checkoutResponse, checkoutStatus, paymentMethodChangeRequest, vatIdCheckRequest, vatIdCheckResponse, } from './billing.js';
|
|
16
16
|
import { cameraListResponse, cancelRequest, configDraftResponse, configVersionResponse, configVersionsResponse, createRobotRequest, createRobotResponse, datapointListResponse, datapointValue, exposureListResponse, fetchTypesRequest, fetchTypesResponse, historyQuery, historyResponse, introspectionResponse, invokeOrServiceResponse, invokeRequest, jobResponse, liveSessionResponse, orgHealthQuery, orgLatencyQuery, orgLatencyResponse, orgQuotaUsage, orgUsageQuery, orgUsageResponse, patchRobotRequest, patchRobotResponse, publishConfigResponse, publishRequest, putConfigDraftRequest, putRobotDetailsRequest, putRobotDetailsResponse, robotTokenRotateResponse, jointStatePutRequest, jointStatePutResponse, releaseLiveQuery, renameSlugRequest, renameSlugResponse, robotDeleteQuery, resourceHealthListResponse, robotDeletionSummary, robotDetailResponse, robotJobsResponse, robotListResponse, slugUsageResponse, snapshotMetaResponse, typesResponse, } from './rest.js';
|
|
17
17
|
export const ROUTE_SECTIONS = [
|
|
18
18
|
{ id: 'health', title: 'Health' },
|
|
@@ -3013,6 +3013,51 @@ export const ROUTES = [
|
|
|
3013
3013
|
notes: 'Rendered once, with `pdfkit`, when the invoice is issued, and stored as bytes — an issued invoice never changes, so this always ' +
|
|
3014
3014
|
'answers the same PDF for the same id. `404 not_found` for an unknown id or one from another org.',
|
|
3015
3015
|
},
|
|
3016
|
+
/* --- billing documents (2026-10-19, fleetless/fleetless#544) -------
|
|
3017
|
+
*
|
|
3018
|
+
* A read-only view of the Lexware vouchers issued to the org's company. Cloud resolves the org's own Lexware contact itself; the
|
|
3019
|
+
* contact is never supplied by the caller.
|
|
3020
|
+
*/
|
|
3021
|
+
{
|
|
3022
|
+
method: 'GET', path: '/api/billing/documents', section: 'billing',
|
|
3023
|
+
summary: "Lists the org's finalized Lexware billing documents.",
|
|
3024
|
+
audience: 'developer', auth: 'developer', rateLimited: true, ownerTier: true, status: 200,
|
|
3025
|
+
params: [], query: null, request: null, response: billingDocumentList,
|
|
3026
|
+
errors: [...DEVELOPER_GUARD, 'tier_required', 'billing_documents_unavailable', 'rate_limited'], transport: 'http',
|
|
3027
|
+
notes: "Cloud resolves the org's own Lexware contact itself; the contact is never client supplied. The list is complete (every page) " +
|
|
3028
|
+
'or an error — never a truncated page a caller could mistake for the whole thing: more than 10,000 documents answers ' +
|
|
3029
|
+
'503 list_limit_exceeded. A draft, a quotation, an order confirmation, a delivery note or a purchase voucher never appears; a ' +
|
|
3030
|
+
'voided document does. `complete: false` with `unsupported_count` set means a document of an unsupported type or status was ' +
|
|
3031
|
+
'skipped rather than listed. `available: false` when this cloud has no Lexware configured, its Lexware account failed the ' +
|
|
3032
|
+
"account check, or the org has no Lexware contact — then `documents` is always `[]`.",
|
|
3033
|
+
},
|
|
3034
|
+
{
|
|
3035
|
+
method: 'GET', path: '/api/billing/documents/:id', section: 'billing',
|
|
3036
|
+
summary: 'Reads one billing document, with its e-invoice profile and available files.',
|
|
3037
|
+
audience: 'developer', auth: 'developer', rateLimited: true, ownerTier: true, status: 200,
|
|
3038
|
+
params: [{ name: 'id', description: 'The Lexware voucher id from the document list.' }],
|
|
3039
|
+
query: null, request: null, response: billingDocumentDetail,
|
|
3040
|
+
errors: [...DEVELOPER_GUARD, 'tier_required', 'billing_documents_unavailable', 'rate_limited', 'not_found'], transport: 'http',
|
|
3041
|
+
notes: '`404 not_found` for an id from another organization or a guessed id — indistinguishable from an unknown one. `NONE` is a plain ' +
|
|
3042
|
+
'PDF and not an e-invoice; `EN16931` (ZUGFeRD) is a PDF with the e-invoice embedded in it; `XRechnung` is an XML e-invoice with a ' +
|
|
3043
|
+
'PDF that is only a preview. `electronic_document_profile` is `null` for a bookkeeping voucher — it has none. A fresh list must ' +
|
|
3044
|
+
'still contain the id. `502 billing_documents_unavailable` with reason `unsupported_document` for an e-invoice profile this ' +
|
|
3045
|
+
'cloud does not know.',
|
|
3046
|
+
},
|
|
3047
|
+
{
|
|
3048
|
+
method: 'GET', path: '/api/billing/documents/:id/file', section: 'billing',
|
|
3049
|
+
summary: "Downloads one billing document's file.",
|
|
3050
|
+
audience: 'developer', auth: 'developer', rateLimited: true, ownerTier: true, status: 200,
|
|
3051
|
+
params: [{ name: 'id', description: 'The Lexware voucher id from the document list.' }],
|
|
3052
|
+
query: billingDocumentFileQuery, request: null, response: null, contentType: 'application/pdf',
|
|
3053
|
+
errors: [...DEVELOPER_GUARD, 'tier_required', 'billing_documents_unavailable', 'rate_limited', 'not_found', 'validation_error'], transport: 'http',
|
|
3054
|
+
notes: '`format=xml` answers `application/xml` for an `XRechnung` document only; every other document answers 404 for `format=xml`, ' +
|
|
3055
|
+
'because it has no XML to serve — a NONE document is a plain PDF and not an e-invoice, so it never has one either. ' +
|
|
3056
|
+
"`Cache-Control: no-store`; the bytes are streamed from Lexware and never persisted on this cloud's own side. 404 for a document " +
|
|
3057
|
+
'of another organization or a guessed id — indistinguishable from an unknown one. A fresh list must still contain the id, and ' +
|
|
3058
|
+
"the org's Lexware contact is rechecked at file time, not only when the document was first listed. `502 " +
|
|
3059
|
+
'billing_documents_unavailable` with reason `unsupported_document` when Lexware answers something that is not the document itself.',
|
|
3060
|
+
},
|
|
3016
3061
|
{
|
|
3017
3062
|
method: 'POST', path: '/api/billing/invoices/:id/pay', section: 'billing',
|
|
3018
3063
|
summary: "Records an owner-confirmed payment intent for an open invoice or due charge.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fleetless/contracts",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.1.0-next.1",
|
|
4
4
|
"description": "Fleetless wire contracts: the bridge-cloud protocol, the REST API schemas and the error codes, as zod schemas with generated JSON Schema and OpenAPI artifacts.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Dehne Robotik GmbH",
|