@vecsnap/sdk 0.1.0 → 0.2.0
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/README.md +9 -0
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/index.js +1 -1
- package/dist/generated/sdk.gen.d.ts +67 -13
- package/dist/generated/sdk.gen.js +106 -12
- package/dist/generated/types.gen.d.ts +2710 -814
- package/dist/index.d.ts +21 -0
- package/dist/index.js +62 -11
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -22,3 +22,12 @@ const event = await verifyWebhook(rawBody, request.headers, process.env.VECSNAP_
|
|
|
22
22
|
|
|
23
23
|
Every other operation a key may call: `vecsnap.api.<operationId>(…)` — generated from the API's document.
|
|
24
24
|
Docs: https://vecsnap.com/docs/sdks/node
|
|
25
|
+
|
|
26
|
+
## Changes in 0.2.0
|
|
27
|
+
|
|
28
|
+
- The operations the API gained since 0.1.0, generated: `getConversionAnchors`, `getConversionCleaned`,
|
|
29
|
+
`getConversionMachines`, `getConversionOriginalFacts`, `getConversionTileBatch`, `getIdentity`, `liftConversionShape`,
|
|
30
|
+
`listCreditHistory`, `tryConversionEdits`.
|
|
31
|
+
- New options: single lines (`preset: "centerline"`) with `options.lineEnds`, a crop, PDF uploads, `retrace` on a
|
|
32
|
+
machine's download, `variant` on more of a result's reads.
|
|
33
|
+
- `ENDED` (a conversion's final states) and `unwrap` are exported.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { cancelConversion, createConversion, createConversionVariant, createImageConversion, createPalette, createUpload, deleteConversion, deleteImage, deleteImages, deletePalette, downloadConversion, eraseImage, eraseImages, getConversion, getConversionFacts, getConversionFeedback, getConversionOriginal, getConversionPaints, getConversionPalette, getConversionShapes, getConversionTiles, getCredits, getImage, getLimits, listConversions, listConversionVariants, listImages, listPalettes, type Options, previewConversion, putConversionFeedback, renameImage, restoreImage, restoreImages, unlockConversion, unlockImages, updatePalette, vectorize, watchConversion } from './sdk.gen.ts';
|
|
2
|
-
export type { CancelConversionData, CancelConversionError, CancelConversionErrors, CancelConversionResponse, CancelConversionResponses, ClientOptions, Conversion, ConversionOptions, ConversionResult, CreateConversionData, CreateConversionError, CreateConversionErrors, CreateConversionResponse, CreateConversionResponses, CreateConversionVariantData, CreateConversionVariantError, CreateConversionVariantErrors, CreateConversionVariantResponse, CreateConversionVariantResponses, CreatedConversion, CreateImageConversionData, CreateImageConversionError, CreateImageConversionErrors, CreateImageConversionResponse, CreateImageConversionResponses, CreatePaletteData, CreatePaletteError, CreatePaletteErrors, CreatePaletteResponse, CreatePaletteResponses, CreateUploadData, CreateUploadError, CreateUploadErrors, CreateUploadResponse, CreateUploadResponses, DeleteConversionData, DeleteConversionError, DeleteConversionErrors, DeleteConversionResponse, DeleteConversionResponses, DeleteImageData, DeleteImageError, DeleteImageErrors, DeleteImageResponse, DeleteImageResponses, DeleteImagesData, DeleteImagesError, DeleteImagesErrors, DeleteImagesResponse, DeleteImagesResponses, DeletePaletteData, DeletePaletteError, DeletePaletteErrors, DeletePaletteResponse, DeletePaletteResponses, DownloadConversionData, DownloadConversionError, DownloadConversionErrors, DownloadConversionResponse, DownloadConversionResponses, EraseImageData, EraseImageError, EraseImageErrors, EraseImageResponse, EraseImageResponses, EraseImagesData, EraseImagesError, EraseImagesErrors, EraseImagesResponse, EraseImagesResponses, Error, Failure, Format, GetConversionData, GetConversionError, GetConversionErrors, GetConversionFactsData, GetConversionFactsError, GetConversionFactsErrors, GetConversionFactsResponse, GetConversionFactsResponses, GetConversionFeedbackData, GetConversionFeedbackError, GetConversionFeedbackErrors, GetConversionFeedbackResponse, GetConversionFeedbackResponses, GetConversionOriginalData, GetConversionOriginalError, GetConversionOriginalErrors, GetConversionOriginalResponse, GetConversionOriginalResponses, GetConversionPaintsData, GetConversionPaintsError, GetConversionPaintsErrors, GetConversionPaintsResponse, GetConversionPaintsResponses, GetConversionPaletteData, GetConversionPaletteError, GetConversionPaletteErrors, GetConversionPaletteResponse, GetConversionPaletteResponses, GetConversionResponse, GetConversionResponses, GetConversionShapesData, GetConversionShapesError, GetConversionShapesErrors, GetConversionShapesResponse, GetConversionShapesResponses, GetConversionTilesData, GetConversionTilesError, GetConversionTilesErrors, GetConversionTilesResponse, GetConversionTilesResponses, GetCreditsData, GetCreditsError, GetCreditsErrors, GetCreditsResponse, GetCreditsResponses, GetImageData, GetImageError, GetImageErrors, GetImageResponse, GetImageResponses, GetLimitsData, GetLimitsError, GetLimitsErrors, GetLimitsResponse, GetLimitsResponses, Image, ImageDetail, ImageList, ImageVersion, LibraryCounts, Link, ListConversionsData, ListConversionsError, ListConversionsErrors, ListConversionsResponse, ListConversionsResponses, ListConversionVariantsData, ListConversionVariantsError, ListConversionVariantsErrors, ListConversionVariantsResponse, ListConversionVariantsResponses, ListImagesData, ListImagesError, ListImagesErrors, ListImagesResponse, ListImagesResponses, ListPalettesData, ListPalettesError, ListPalettesErrors, ListPalettesResponse, ListPalettesResponses, Palette, Picture, PostConversionCompletedWebhookPayload, PostConversionCompletedWebhookRequest, PostConversionExpiredWebhookPayload, PostConversionExpiredWebhookRequest, PostConversionFailedWebhookPayload, PostConversionFailedWebhookRequest, PreviewConversionData, PreviewConversionError, PreviewConversionErrors, PreviewConversionResponse, PreviewConversionResponses, PutConversionFeedbackData, PutConversionFeedbackError, PutConversionFeedbackErrors, PutConversionFeedbackResponse, PutConversionFeedbackResponses, RenameImageData, RenameImageError, RenameImageErrors, RenameImageResponse, RenameImageResponses, RestoreImageData, RestoreImageError, RestoreImageErrors, RestoreImageResponse, RestoreImageResponses, RestoreImagesData, RestoreImagesError, RestoreImagesErrors, RestoreImagesResponse, RestoreImagesResponses, UnlockConversionData, UnlockConversionError, UnlockConversionErrors, UnlockConversionResponse, UnlockConversionResponses, UnlockImagesData, UnlockImagesError, UnlockImagesErrors, UnlockImagesResponse, UnlockImagesResponses, UpdatePaletteData, UpdatePaletteError, UpdatePaletteErrors, UpdatePaletteResponse, UpdatePaletteResponses, Vectorized, VectorizeData, VectorizeError, VectorizeErrors, VectorizeResponse, VectorizeResponses, WatchConversionData, WatchConversionError, WatchConversionErrors, WatchConversionResponse, WatchConversionResponses, WebhookEvent, Webhooks } from './types.gen.ts';
|
|
1
|
+
export { cancelConversion, createConversion, createConversionVariant, createImageConversion, createPalette, createUpload, deleteConversion, deleteImage, deleteImages, deletePalette, downloadConversion, eraseImage, eraseImages, getConversion, getConversionAnchors, getConversionCleaned, getConversionFacts, getConversionFeedback, getConversionMachines, getConversionOriginal, getConversionOriginalFacts, getConversionPaints, getConversionPalette, getConversionShapes, getConversionTileBatch, getConversionTiles, getCredits, getIdentity, getImage, getLimits, liftConversionShape, listConversions, listConversionVariants, listCreditHistory, listImages, listPalettes, type Options, previewConversion, putConversionFeedback, renameImage, restoreImage, restoreImages, tryConversionEdits, unlockConversion, unlockImages, updatePalette, vectorize, watchConversion } from './sdk.gen.ts';
|
|
2
|
+
export type { CancelConversionData, CancelConversionError, CancelConversionErrors, CancelConversionResponse, CancelConversionResponses, CleanOptions, CleanReport, ClientOptions, Conversion, ConversionOptions, ConversionResult, CreateConversionData, CreateConversionError, CreateConversionErrors, CreateConversionResponse, CreateConversionResponses, CreateConversionVariantData, CreateConversionVariantError, CreateConversionVariantErrors, CreateConversionVariantResponse, CreateConversionVariantResponses, CreatedConversion, CreateImageConversionData, CreateImageConversionError, CreateImageConversionErrors, CreateImageConversionResponse, CreateImageConversionResponses, CreatePaletteData, CreatePaletteError, CreatePaletteErrors, CreatePaletteResponse, CreatePaletteResponses, CreateUploadData, CreateUploadError, CreateUploadErrors, CreateUploadResponse, CreateUploadResponses, CreditHistoryEntry, Crop, DeleteConversionData, DeleteConversionError, DeleteConversionErrors, DeleteConversionResponse, DeleteConversionResponses, DeleteImageData, DeleteImageError, DeleteImageErrors, DeleteImageResponse, DeleteImageResponses, DeleteImagesData, DeleteImagesError, DeleteImagesErrors, DeleteImagesResponse, DeleteImagesResponses, DeletePaletteData, DeletePaletteError, DeletePaletteErrors, DeletePaletteResponse, DeletePaletteResponses, DownloadConversionData, DownloadConversionError, DownloadConversionErrors, DownloadConversionResponse, DownloadConversionResponses, EraseImageData, EraseImageError, EraseImageErrors, EraseImageResponse, EraseImageResponses, EraseImagesData, EraseImagesError, EraseImagesErrors, EraseImagesResponse, EraseImagesResponses, Error, Failure, Format, GetConversionAnchorsData, GetConversionAnchorsError, GetConversionAnchorsErrors, GetConversionAnchorsResponse, GetConversionAnchorsResponses, GetConversionCleanedData, GetConversionCleanedError, GetConversionCleanedErrors, GetConversionCleanedResponse, GetConversionCleanedResponses, GetConversionData, GetConversionError, GetConversionErrors, GetConversionFactsData, GetConversionFactsError, GetConversionFactsErrors, GetConversionFactsResponse, GetConversionFactsResponses, GetConversionFeedbackData, GetConversionFeedbackError, GetConversionFeedbackErrors, GetConversionFeedbackResponse, GetConversionFeedbackResponses, GetConversionMachinesData, GetConversionMachinesError, GetConversionMachinesErrors, GetConversionMachinesResponse, GetConversionMachinesResponses, GetConversionOriginalData, GetConversionOriginalError, GetConversionOriginalErrors, GetConversionOriginalFactsData, GetConversionOriginalFactsError, GetConversionOriginalFactsErrors, GetConversionOriginalFactsResponse, GetConversionOriginalFactsResponses, GetConversionOriginalResponse, GetConversionOriginalResponses, GetConversionPaintsData, GetConversionPaintsError, GetConversionPaintsErrors, GetConversionPaintsResponse, GetConversionPaintsResponses, GetConversionPaletteData, GetConversionPaletteError, GetConversionPaletteErrors, GetConversionPaletteResponse, GetConversionPaletteResponses, GetConversionResponse, GetConversionResponses, GetConversionShapesData, GetConversionShapesError, GetConversionShapesErrors, GetConversionShapesResponse, GetConversionShapesResponses, GetConversionTileBatchData, GetConversionTileBatchError, GetConversionTileBatchErrors, GetConversionTileBatchResponse, GetConversionTileBatchResponses, GetConversionTilesData, GetConversionTilesError, GetConversionTilesErrors, GetConversionTilesResponse, GetConversionTilesResponses, GetCreditsData, GetCreditsError, GetCreditsErrors, GetCreditsResponse, GetCreditsResponses, GetIdentityData, GetIdentityError, GetIdentityErrors, GetIdentityResponse, GetIdentityResponses, GetImageData, GetImageError, GetImageErrors, GetImageResponse, GetImageResponses, GetLimitsData, GetLimitsError, GetLimitsErrors, GetLimitsResponse, GetLimitsResponses, Image, ImageDetail, ImageList, ImageVersion, LibraryCounts, LiftConversionShapeData, LiftConversionShapeError, LiftConversionShapeErrors, LiftConversionShapeResponse, LiftConversionShapeResponses, Link, ListConversionsData, ListConversionsError, ListConversionsErrors, ListConversionsResponse, ListConversionsResponses, ListConversionVariantsData, ListConversionVariantsError, ListConversionVariantsErrors, ListConversionVariantsResponse, ListConversionVariantsResponses, ListCreditHistoryData, ListCreditHistoryError, ListCreditHistoryErrors, ListCreditHistoryResponse, ListCreditHistoryResponses, ListImagesData, ListImagesError, ListImagesErrors, ListImagesResponse, ListImagesResponses, ListPalettesData, ListPalettesError, ListPalettesErrors, ListPalettesResponse, ListPalettesResponses, OriginalFacts, Palette, Picture, PostConversionCompletedWebhookPayload, PostConversionCompletedWebhookRequest, PostConversionExpiredWebhookPayload, PostConversionExpiredWebhookRequest, PostConversionFailedWebhookPayload, PostConversionFailedWebhookRequest, PreviewConversionData, PreviewConversionError, PreviewConversionErrors, PreviewConversionResponse, PreviewConversionResponses, PutConversionFeedbackData, PutConversionFeedbackError, PutConversionFeedbackErrors, PutConversionFeedbackResponse, PutConversionFeedbackResponses, RenameImageData, RenameImageError, RenameImageErrors, RenameImageResponse, RenameImageResponses, RestoreImageData, RestoreImageError, RestoreImageErrors, RestoreImageResponse, RestoreImageResponses, RestoreImagesData, RestoreImagesError, RestoreImagesErrors, RestoreImagesResponse, RestoreImagesResponses, Tool, TryConversionEditsData, TryConversionEditsError, TryConversionEditsErrors, TryConversionEditsResponse, TryConversionEditsResponses, UnlockConversionData, UnlockConversionError, UnlockConversionErrors, UnlockConversionResponse, UnlockConversionResponses, UnlockImagesData, UnlockImagesError, UnlockImagesErrors, UnlockImagesResponse, UnlockImagesResponses, UpdatePaletteData, UpdatePaletteError, UpdatePaletteErrors, UpdatePaletteResponse, UpdatePaletteResponses, Vectorized, VectorizeData, VectorizeError, VectorizeErrors, VectorizeResponse, VectorizeResponses, WatchConversionData, WatchConversionError, WatchConversionErrors, WatchConversionResponse, WatchConversionResponses, WebhookEvent, Webhooks } from './types.gen.ts';
|
package/dist/generated/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
-
export { cancelConversion, createConversion, createConversionVariant, createImageConversion, createPalette, createUpload, deleteConversion, deleteImage, deleteImages, deletePalette, downloadConversion, eraseImage, eraseImages, getConversion, getConversionFacts, getConversionFeedback, getConversionOriginal, getConversionPaints, getConversionPalette, getConversionShapes, getConversionTiles, getCredits, getImage, getLimits, listConversions, listConversionVariants, listImages, listPalettes, previewConversion, putConversionFeedback, renameImage, restoreImage, restoreImages, unlockConversion, unlockImages, updatePalette, vectorize, watchConversion } from "./sdk.gen.js";
|
|
2
|
+
export { cancelConversion, createConversion, createConversionVariant, createImageConversion, createPalette, createUpload, deleteConversion, deleteImage, deleteImages, deletePalette, downloadConversion, eraseImage, eraseImages, getConversion, getConversionAnchors, getConversionCleaned, getConversionFacts, getConversionFeedback, getConversionMachines, getConversionOriginal, getConversionOriginalFacts, getConversionPaints, getConversionPalette, getConversionShapes, getConversionTileBatch, getConversionTiles, getCredits, getIdentity, getImage, getLimits, liftConversionShape, listConversions, listConversionVariants, listCreditHistory, listImages, listPalettes, previewConversion, putConversionFeedback, renameImage, restoreImage, restoreImages, tryConversionEdits, unlockConversion, unlockImages, updatePalette, vectorize, watchConversion } from "./sdk.gen.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Client, ClientMeta, Options as Options2, RequestResult, ServerSentEventsResult, TDataShape } from './client/index.ts';
|
|
2
|
-
import type { CancelConversionData, CancelConversionErrors, CancelConversionResponses, CreateConversionData, CreateConversionErrors, CreateConversionResponses, CreateConversionVariantData, CreateConversionVariantErrors, CreateConversionVariantResponses, CreateImageConversionData, CreateImageConversionErrors, CreateImageConversionResponses, CreatePaletteData, CreatePaletteErrors, CreatePaletteResponses, CreateUploadData, CreateUploadErrors, CreateUploadResponses, DeleteConversionData, DeleteConversionErrors, DeleteConversionResponses, DeleteImageData, DeleteImageErrors, DeleteImageResponses, DeleteImagesData, DeleteImagesErrors, DeleteImagesResponses, DeletePaletteData, DeletePaletteErrors, DeletePaletteResponses, DownloadConversionData, DownloadConversionErrors, DownloadConversionResponses, EraseImageData, EraseImageErrors, EraseImageResponses, EraseImagesData, EraseImagesErrors, EraseImagesResponses, GetConversionData, GetConversionErrors, GetConversionFactsData, GetConversionFactsErrors, GetConversionFactsResponses, GetConversionFeedbackData, GetConversionFeedbackErrors, GetConversionFeedbackResponses, GetConversionOriginalData, GetConversionOriginalErrors, GetConversionOriginalResponses, GetConversionPaintsData, GetConversionPaintsErrors, GetConversionPaintsResponses, GetConversionPaletteData, GetConversionPaletteErrors, GetConversionPaletteResponses, GetConversionResponses, GetConversionShapesData, GetConversionShapesErrors, GetConversionShapesResponses, GetConversionTilesData, GetConversionTilesErrors, GetConversionTilesResponses, GetCreditsData, GetCreditsErrors, GetCreditsResponses, GetImageData, GetImageErrors, GetImageResponses, GetLimitsData, GetLimitsErrors, GetLimitsResponses, ListConversionsData, ListConversionsErrors, ListConversionsResponses, ListConversionVariantsData, ListConversionVariantsErrors, ListConversionVariantsResponses, ListImagesData, ListImagesErrors, ListImagesResponses, ListPalettesData, ListPalettesErrors, ListPalettesResponses, PreviewConversionData, PreviewConversionErrors, PreviewConversionResponses, PutConversionFeedbackData, PutConversionFeedbackErrors, PutConversionFeedbackResponses, RenameImageData, RenameImageErrors, RenameImageResponses, RestoreImageData, RestoreImageErrors, RestoreImageResponses, RestoreImagesData, RestoreImagesErrors, RestoreImagesResponses, UnlockConversionData, UnlockConversionErrors, UnlockConversionResponses, UnlockImagesData, UnlockImagesErrors, UnlockImagesResponses, UpdatePaletteData, UpdatePaletteErrors, UpdatePaletteResponses, VectorizeData, VectorizeErrors, VectorizeResponses, WatchConversionData, WatchConversionResponse, WatchConversionResponses } from './types.gen.ts';
|
|
2
|
+
import type { CancelConversionData, CancelConversionErrors, CancelConversionResponses, CreateConversionData, CreateConversionErrors, CreateConversionResponses, CreateConversionVariantData, CreateConversionVariantErrors, CreateConversionVariantResponses, CreateImageConversionData, CreateImageConversionErrors, CreateImageConversionResponses, CreatePaletteData, CreatePaletteErrors, CreatePaletteResponses, CreateUploadData, CreateUploadErrors, CreateUploadResponses, DeleteConversionData, DeleteConversionErrors, DeleteConversionResponses, DeleteImageData, DeleteImageErrors, DeleteImageResponses, DeleteImagesData, DeleteImagesErrors, DeleteImagesResponses, DeletePaletteData, DeletePaletteErrors, DeletePaletteResponses, DownloadConversionData, DownloadConversionErrors, DownloadConversionResponses, EraseImageData, EraseImageErrors, EraseImageResponses, EraseImagesData, EraseImagesErrors, EraseImagesResponses, GetConversionAnchorsData, GetConversionAnchorsErrors, GetConversionAnchorsResponses, GetConversionCleanedData, GetConversionCleanedErrors, GetConversionCleanedResponses, GetConversionData, GetConversionErrors, GetConversionFactsData, GetConversionFactsErrors, GetConversionFactsResponses, GetConversionFeedbackData, GetConversionFeedbackErrors, GetConversionFeedbackResponses, GetConversionMachinesData, GetConversionMachinesErrors, GetConversionMachinesResponses, GetConversionOriginalData, GetConversionOriginalErrors, GetConversionOriginalFactsData, GetConversionOriginalFactsErrors, GetConversionOriginalFactsResponses, GetConversionOriginalResponses, GetConversionPaintsData, GetConversionPaintsErrors, GetConversionPaintsResponses, GetConversionPaletteData, GetConversionPaletteErrors, GetConversionPaletteResponses, GetConversionResponses, GetConversionShapesData, GetConversionShapesErrors, GetConversionShapesResponses, GetConversionTileBatchData, GetConversionTileBatchErrors, GetConversionTileBatchResponses, GetConversionTilesData, GetConversionTilesErrors, GetConversionTilesResponses, GetCreditsData, GetCreditsErrors, GetCreditsResponses, GetIdentityData, GetIdentityErrors, GetIdentityResponses, GetImageData, GetImageErrors, GetImageResponses, GetLimitsData, GetLimitsErrors, GetLimitsResponses, LiftConversionShapeData, LiftConversionShapeErrors, LiftConversionShapeResponses, ListConversionsData, ListConversionsErrors, ListConversionsResponses, ListConversionVariantsData, ListConversionVariantsErrors, ListConversionVariantsResponses, ListCreditHistoryData, ListCreditHistoryErrors, ListCreditHistoryResponses, ListImagesData, ListImagesErrors, ListImagesResponses, ListPalettesData, ListPalettesErrors, ListPalettesResponses, PreviewConversionData, PreviewConversionErrors, PreviewConversionResponses, PutConversionFeedbackData, PutConversionFeedbackErrors, PutConversionFeedbackResponses, RenameImageData, RenameImageErrors, RenameImageResponses, RestoreImageData, RestoreImageErrors, RestoreImageResponses, RestoreImagesData, RestoreImagesErrors, RestoreImagesResponses, TryConversionEditsData, TryConversionEditsErrors, TryConversionEditsResponses, UnlockConversionData, UnlockConversionErrors, UnlockConversionResponses, UnlockImagesData, UnlockImagesErrors, UnlockImagesResponses, UpdatePaletteData, UpdatePaletteErrors, UpdatePaletteResponses, VectorizeData, VectorizeErrors, VectorizeResponses, WatchConversionData, WatchConversionResponse, WatchConversionResponses } from './types.gen.ts';
|
|
3
3
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
|
|
4
4
|
/**
|
|
5
5
|
* You can provide a client instance returned by `createClient()` instead of
|
|
@@ -16,7 +16,7 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
|
|
|
16
16
|
/**
|
|
17
17
|
* Vectorize an image
|
|
18
18
|
*
|
|
19
|
-
* Converts one image and hands you its SVG in the same request. Send exactly one of `file` (multipart), `url` or `inputKey`. If it finishes within `wait` seconds the answer is 200 with the result and its files; otherwise 202 with the conversion, which finishes on its own (`Location` names it: read it, stream its events, or await your webhook). Every client MUST handle the 202: most images take seconds, a few take minutes. It
|
|
19
|
+
* Converts one image and hands you its SVG in the same request. Send exactly one of `file` (multipart), `url` or `inputKey`. If it finishes within `wait` seconds the answer is 200 with the result and its files; otherwise 202 with the conversion, which finishes on its own (`Location` names it: read it, stream its events, or await your webhook). Every client MUST handle the 202: most images take seconds, a few take minutes. It UNLOCKS unless `unlock` is false: 1 credit per image, held now and refunded if the conversion fails; an image already unlocked costs nothing again. Past your limit of conversions at once it waits its turn instead of refusing. Test keys: free (the sample result). With `Accept: image/svg+xml` a finished conversion answers 303 to the web file itself.
|
|
20
20
|
*/
|
|
21
21
|
export declare const vectorize: <ThrowOnError extends boolean = false>(options: Options<VectorizeData, ThrowOnError>) => RequestResult<VectorizeResponses, VectorizeErrors, ThrowOnError>;
|
|
22
22
|
/**
|
|
@@ -34,7 +34,7 @@ export declare const listConversions: <ThrowOnError extends boolean = false>(opt
|
|
|
34
34
|
/**
|
|
35
35
|
* Create a conversion
|
|
36
36
|
*
|
|
37
|
-
* Converting is FREE: 1 credit = 1 image, spent when the image is UNLOCKED (here with `unlock: true`, or later with POST /conversions/{id}/unlock). A free conversion counts against the daily caps (guests 3 a UTC day, free accounts 10, customers 100). A guest never unlocks: `unlock: true` answers it 403 `account_required
|
|
37
|
+
* Converting is FREE: 1 credit = 1 image, spent when the image is UNLOCKED (here with `unlock: true`, or later with POST /conversions/{id}/unlock). A free conversion counts against the daily caps (guests 3 a UTC day, free accounts 10, customers 100). A guest never unlocks: `unlock: true` answers it 403 `account_required`; nor does a connected app's pass (403 `pass_not_allowed`: the person unlocks). Accepted formats: PNG, JPG, WebP, AVIF, GIF, BMP, TIFF, SVG and PDF (read by their bytes; an animation or a multi-page TIFF at its first frame), at most 4096×4096. HEIC, SVGZ: send a PNG (the website converts it in the browser). Repeating an `idempotencyKey` answers 200 with the conversion it already made, never a second one and never a second charge.
|
|
38
38
|
*/
|
|
39
39
|
export declare const createConversion: <ThrowOnError extends boolean = false>(options: Options<CreateConversionData, ThrowOnError>) => RequestResult<CreateConversionResponses, CreateConversionErrors, ThrowOnError>;
|
|
40
40
|
/**
|
|
@@ -70,43 +70,85 @@ export declare const watchConversion: <ThrowOnError extends boolean = false>(opt
|
|
|
70
70
|
/**
|
|
71
71
|
* Download a file of the result
|
|
72
72
|
*
|
|
73
|
-
* A short-lived URL for one of the result's files: `format` names one of `result.formats` by id (absent, the web default). Served from the storage domain as an attachment, never inline from this origin: SVG is an active document format. Allowed once the conversion's IMAGE is unlocked, on every plan; then every format and re-download is free. A locked image answers 402 `unlock_required` (this GET never spends). `as` takes the format as a print-ready PDF (`pdf`, a design file's of outlines, never its `editableText` twin) or a picture (`png`, a web file's with a preview, `size` px on its long side): made from the stored result on first ask, after the unlock check.
|
|
73
|
+
* A short-lived URL for one of the result's files: `format` names one of `result.formats` by id (absent, the web default). Served from the storage domain as an attachment, never inline from this origin: SVG is an active document format. Allowed once the conversion's IMAGE is unlocked, on every plan; then every format and re-download is free. A locked image answers 402 `unlock_required` (this GET never spends). `as` takes the format as a print-ready PDF (`pdf`, a design file's of outlines, never its `editableText` twin) or a picture (`png`, a web file's with a preview, `size` px on its long side). Any design file, its `editableText` twin included, takes `layers`: its LAYER TREE, the drawing as JSON data for a design tool's own layers (groups, ellipses, rectangles, paths, components, text; the vocabulary is VecSnap's `LayerTree`). A design file of outlines also takes a maker's file: cut-ready (`cut`, each shape minus what is painted over it, for a cutting machine), a DXF (`dxf`, `units` mm or in, for a laser or a CNC), an EPS (`eps`, for a print shop), a 3D print raised `height` mm (`stl`, one body; `3mf`, one object per color, for a printer with several filaments), or its LINES: each edge drawn once, in a machine's order (`plot`, an SVG; `plot-dxf`, a DXF in `units`): a single-line version's lines, any other drawing's outlines. Each is made from the stored result on first ask, after the unlock check.
|
|
74
74
|
*/
|
|
75
75
|
export declare const downloadConversion: <ThrowOnError extends boolean = false>(options: Options<DownloadConversionData, ThrowOnError>) => RequestResult<DownloadConversionResponses, DownloadConversionErrors, ThrowOnError>;
|
|
76
76
|
/**
|
|
77
77
|
* Preview the result
|
|
78
78
|
*
|
|
79
|
-
* A short-lived URL for a web file's rendered PNG, on EVERY tier: the free tier is the product demo, a full-quality conversion, this preview and its figures, with the SVG withheld. Served inline (a PNG is inert). `format` names a web file of `result.formats` that is not `currentColor` (its background kept or dropped); absent, the web default's. 2048 px on its long side, at the drawing's own aspect. `layer=outline`: the anchor-point view at the same size, lying exactly on it (black hairlines and squares on transparency).
|
|
79
|
+
* A short-lived URL for a web file's rendered PNG, on EVERY tier: the free tier is the product demo, a full-quality conversion, this preview and its figures, with the SVG withheld. Served inline (a PNG is inert). `format` names a web file of `result.formats` that is not `currentColor` (its background kept or dropped); absent, the web default's. 2048 px on its long side, at the drawing's own aspect. `layer=outline`: the anchor-point view at the same size, lying exactly on it (black hairlines and squares on transparency). `layer=plot`: what a machine draws at the same size, in one ink; with `variant`, under its edits and colors, as its file downloads, with that drawing's figures in `plot`. `layer=cut`: the CUT-READY picture of the DESIGN file `format` names (a design file of outlines: what a cutter's blade follows), a revision's too.
|
|
80
80
|
*/
|
|
81
81
|
export declare const previewConversion: <ThrowOnError extends boolean = false>(options: Options<PreviewConversionData, ThrowOnError>) => RequestResult<PreviewConversionResponses, PreviewConversionErrors, ThrowOnError>;
|
|
82
|
+
/**
|
|
83
|
+
* Figures for each machine
|
|
84
|
+
*
|
|
85
|
+
* A single-line version's figures for each kind of machine: `pen` (what a pen draws: a few short stretches gone over twice so it lifts less: its lines, the closed ones, its colors, the lines too short to draw cleanly) and `once` (the file a laser, a blade or CAD draws, each stretch once). With `variant`, a revision's, under its edits. A version's are made with it; a revision's are made on the first ask, under the long files' wait. A drawing the engine refuses, or too dense to walk in time, is refused (`file_not_makeable`), final. Both are null for a version that is not single lines. No credit is spent (figures, never the file); a walk made on the first ask counts toward the day's compute (`compute_limit_reached`).
|
|
86
|
+
*/
|
|
87
|
+
export declare const getConversionMachines: <ThrowOnError extends boolean = false>(options: Options<GetConversionMachinesData, ThrowOnError>) => RequestResult<GetConversionMachinesResponses, GetConversionMachinesErrors, ThrowOnError>;
|
|
82
88
|
/**
|
|
83
89
|
* Tiles of a deeper zoom
|
|
84
90
|
*
|
|
85
|
-
* Every tier, like the preview: pictures of the file, never the SVG. Level L draws the drawing 2048·2^L px long, cut into 512-px squares (1 ≤ L ≤ 3); a tile is [x, y] within the square grid of its level. Missing tiles are made first, then served from storage.
|
|
91
|
+
* Every tier, like the preview: pictures of the file, never the SVG. Level L draws the drawing 2048·2^L px long, cut into 512-px squares (1 ≤ L ≤ 3); a tile is [x, y] within the square grid of its level. Missing tiles are made first, then served from storage. Several layers at once: POST /conversions/{id}/tiles/batch.
|
|
86
92
|
*/
|
|
87
93
|
export declare const getConversionTiles: <ThrowOnError extends boolean = false>(options: Options<GetConversionTilesData, ThrowOnError>) => RequestResult<GetConversionTilesResponses, GetConversionTilesErrors, ThrowOnError>;
|
|
94
|
+
/**
|
|
95
|
+
* Tiles of several layers at once
|
|
96
|
+
*
|
|
97
|
+
* The tiles of every layer one view shows (the picture, its Shapes ID picture, the outline), in one request: each ask is POST /conversions/{id}/tiles's, answered in the same order. At most 24 tiles in all, of one revision (`variant`) and one preview count (`palette`) at most; ask another's apart; it succeeds or fails whole. One request at a time per account makes files: another meanwhile waits its turn (up to 15 s), then, or with 8 already waiting, is refused with 429 `derive_busy` (nothing done; ask again after Retry-After).
|
|
98
|
+
*/
|
|
99
|
+
export declare const getConversionTileBatch: <ThrowOnError extends boolean = false>(options: Options<GetConversionTileBatchData, ThrowOnError>) => RequestResult<GetConversionTileBatchResponses, GetConversionTileBatchErrors, ThrowOnError>;
|
|
88
100
|
/**
|
|
89
101
|
* The original image
|
|
90
102
|
*
|
|
91
|
-
* A short-lived URL for the image the conversion was made from: the upload, kept with its result for the comparison (deleted with the result or the account, never in the shared cache). While it waits or runs, the upload itself, so a client can show the image being converted. Served inline, as the type its bytes proved at upload. A result made before originals were kept, a running conversion whose upload is gone,
|
|
103
|
+
* A short-lived URL for the image the conversion was made from: the upload, kept with its result for the comparison (deleted with the result or the account, never in the shared cache). While it waits or runs, the upload itself, so a client can show the image being converted. Served inline, as the type its bytes proved at upload; an upload no page shows as itself (a TIFF, an SVG) is answered as its PICTURE, a PNG the engine drew of it, never the file. A result made before originals were kept, or a running conversion whose upload is gone, has none: 404 `original_unavailable`.
|
|
92
104
|
*/
|
|
93
105
|
export declare const getConversionOriginal: <ThrowOnError extends boolean = false>(options: Options<GetConversionOriginalData, ThrowOnError>) => RequestResult<GetConversionOriginalResponses, GetConversionOriginalErrors, ThrowOnError>;
|
|
106
|
+
/**
|
|
107
|
+
* What an uploaded SVG was
|
|
108
|
+
*
|
|
109
|
+
* Every tier, an SVG upload's only, either tool: its anchor points, its size and its colors as the engine read them, and a short-lived link to its points as data. Written at conversion: an upload of another format, one the engine's SVG reader cannot read, or a result made before these existed has none: 404 `not_found`. A connected app's pass reads the counts alone: its `points` is null.
|
|
110
|
+
*/
|
|
111
|
+
export declare const getConversionOriginalFacts: <ThrowOnError extends boolean = false>(options: Options<GetConversionOriginalFactsData, ThrowOnError>) => RequestResult<GetConversionOriginalFactsResponses, GetConversionOriginalFactsErrors, ThrowOnError>;
|
|
94
112
|
/**
|
|
95
113
|
* The result's facts
|
|
96
114
|
*
|
|
97
|
-
* Every tier: the engine's facts of the default file, in the ENGINE's names (the same object the site's examples show): the counts a layers panel would sum (anchor points, paths, circles, rectangles, rings, strokes, repeats, elements, the words kept as text) and every color the file draws with what it paints and its share of the frame.
|
|
115
|
+
* Every tier: the engine's facts of the default file, in the ENGINE's names (the same object the site's examples show): the counts a layers panel would sum (anchor points, paths, circles, rectangles, rings, strokes, repeats, elements, the words kept as text) and every color the file draws with what it paints and its share of the frame. `lane`: whether the upload looks like what VecSnap is built for (`in`: logos, icons, illustrations) or like a photograph (`photo`), read by the engine before converting; null when not read (a result converted before it). `lineArt`: whether the drawing is made of lines, so a single-line version may suit it. `plot`: a single-line version's figures for a machine.
|
|
98
116
|
*/
|
|
99
117
|
export declare const getConversionFacts: <ThrowOnError extends boolean = false>(options: Options<GetConversionFactsData, ThrowOnError>) => RequestResult<GetConversionFactsResponses, GetConversionFactsErrors, ThrowOnError>;
|
|
118
|
+
/**
|
|
119
|
+
* What a Clean did
|
|
120
|
+
*
|
|
121
|
+
* Every tier, a Clean's only (`tool: clean`): the upload's anchor points and the result's, the upload's size, the distance every outline was kept within, and each step that acted, by its setting's name (`cleanOptions`). A Redraw has none: 404 `not_found`.
|
|
122
|
+
*/
|
|
123
|
+
export declare const getConversionCleaned: <ThrowOnError extends boolean = false>(options: Options<GetConversionCleanedData, ThrowOnError>) => RequestResult<GetConversionCleanedResponses, GetConversionCleanedErrors, ThrowOnError>;
|
|
100
124
|
/**
|
|
101
125
|
* The result's shapes
|
|
102
126
|
*
|
|
103
|
-
* Every tier, like the preview: a web file's shapes in the engine's order, and a link to its ID PICTURE at the preview's size: every pixel's color − 1 is the shape on top there, transparent where none is, never a blended pixel. Decode it with color conversion and premultiplying off. Its deeper zoom: POST /conversions/{id}/tiles with the layer `ids-{format}`.
|
|
127
|
+
* Every tier, like the preview: a web file's shapes in the engine's order, and a link to its ID PICTURE at the preview's size: every pixel's color − 1 is the shape on top there, transparent where none is, never a blended pixel. Decode it with color conversion and premultiplying off. Its deeper zoom: POST /conversions/{id}/tiles with the layer `ids-{format}`. The default web file's is made with the conversion; another's on the first ask; then served.
|
|
104
128
|
*/
|
|
105
129
|
export declare const getConversionShapes: <ThrowOnError extends boolean = false>(options: Options<GetConversionShapesData, ThrowOnError>) => RequestResult<GetConversionShapesResponses, GetConversionShapesErrors, ThrowOnError>;
|
|
130
|
+
/**
|
|
131
|
+
* Lift a shape
|
|
132
|
+
*
|
|
133
|
+
* Every tier, like the preview: two short-lived URLs to MOVE a shape on screen before the move is saved. `without` is the web file without the shape (its preview with one hide more, never saved), `alone` the shape alone, every other one hidden and drawn whole where another covered it; both 2048 px on the long side, lying exactly on the preview. `shape` is its number in a revision's edits (the Shapes table's `shape`); the ground can only be hidden, never lifted. Moving it is then ONE `place` edit (POST /conversions/{id}/variants).
|
|
134
|
+
*/
|
|
135
|
+
export declare const liftConversionShape: <ThrowOnError extends boolean = false>(options: Options<LiftConversionShapeData, ThrowOnError>) => RequestResult<LiftConversionShapeResponses, LiftConversionShapeErrors, ThrowOnError>;
|
|
136
|
+
/**
|
|
137
|
+
* Read a shape's anchors
|
|
138
|
+
*
|
|
139
|
+
* Once the image is UNLOCKED (402 `unlock_required` before: the anchors are the file's geometry): a shape's anchor points as data, numbered exactly as the anchor edits name them (`point`, `corner`, `add_point`, `delete_point`, `fillet`, saved by POST /conversions/{id}/variants), on the shape as the revision edits it. `x` and `y` are in the file's own units (the Shapes table's). `reach` is the largest `fillet` radius that fits there (`reachExact`: every radius up to it fits, between two straight sides); `segment` the one leaving the anchor (`add_point`'s `at` is a place on it; an arc takes none). A shape no anchor edit addresses answers an empty list.
|
|
140
|
+
*/
|
|
141
|
+
export declare const getConversionAnchors: <ThrowOnError extends boolean = false>(options: Options<GetConversionAnchorsData, ThrowOnError>) => RequestResult<GetConversionAnchorsResponses, GetConversionAnchorsErrors, ThrowOnError>;
|
|
142
|
+
/**
|
|
143
|
+
* Try edits
|
|
144
|
+
*
|
|
145
|
+
* Every tier, like the preview: a short-lived URL to the web file's preview with EDITS after a revision's own (or the result's), NEVER saved: what a press would draw before it is pressed. `edits` is a JSON list of 1 to 8 edits, in a revision's numbering and vocabulary (POST /conversions/{id}/variants); saving the same edits later draws from the same picture. Counted on its own budget, apart from what saving needs. An edit only the engine draws (simplify, round, point, corner, add_point, delete_point, fillet, merge, subtract, intersect, exclude, offset, outline, weight) is tried once the image is unlocked (402 `unlock_required` before).
|
|
146
|
+
*/
|
|
147
|
+
export declare const tryConversionEdits: <ThrowOnError extends boolean = false>(options: Options<TryConversionEditsData, ThrowOnError>) => RequestResult<TryConversionEditsResponses, TryConversionEditsErrors, ThrowOnError>;
|
|
106
148
|
/**
|
|
107
149
|
* The result's paint map
|
|
108
150
|
*
|
|
109
|
-
* Every tier, like the preview: the paints the file draws with its ground left out, in index order, each with its share of the frame, the ground, and a link to `paints.bin`: zlib of an index plane then a weight plane (width × height × 4 bytes each: every pixel's four largest paints, 255 = none, and their weights × 255). A pixel of any recolor is Σ w·c′ (premultiplied), with the ground under it as (1 − Σ w)·ground. Made on the first ask; a drawing of more than 24 paints has none.
|
|
151
|
+
* Every tier, like the preview: the paints the file draws with its ground left out, in index order, each with its share of the frame, the ground, and a link to `paints.bin`: zlib of an index plane then a weight plane (width × height × 4 bytes each: every pixel's four largest paints, 255 = none, and their weights × 255). A pixel of any recolor is Σ w·c′ (premultiplied), with the ground under it as (1 − Σ w)·ground. Made with the conversion (an older result's on the first ask); a drawing of more than 24 paints has none.
|
|
110
152
|
*/
|
|
111
153
|
export declare const getConversionPaints: <ThrowOnError extends boolean = false>(options: Options<GetConversionPaintsData, ThrowOnError>) => RequestResult<GetConversionPaintsResponses, GetConversionPaintsErrors, ThrowOnError>;
|
|
112
154
|
/**
|
|
@@ -122,9 +164,9 @@ export declare const getConversionPalette: <ThrowOnError extends boolean = false
|
|
|
122
164
|
*/
|
|
123
165
|
export declare const listConversionVariants: <ThrowOnError extends boolean = false>(options: Options<ListConversionVariantsData, ThrowOnError>) => RequestResult<ListConversionVariantsResponses, ListConversionVariantsErrors, ThrowOnError>;
|
|
124
166
|
/**
|
|
125
|
-
*
|
|
167
|
+
* Change a result: recolor it, edit its shapes
|
|
126
168
|
*
|
|
127
|
-
* `colors` maps the file's own colors to new ones, every use of each (fills, strokes, gradient stops, the ground); two to one value merge them. Keys are the result's paints and its ground (`/facts`); the
|
|
169
|
+
* A REVISION of the result. `colors` maps the file's own colors to new ones, every use of each (fills, strokes, gradient stops, the ground); two to one value merge them. Keys are the result's paints and its ground (`/facts`). `edits` (at most 1000; at most 25 of them slow to replay: simplify, merge, subtract, intersect, exclude, offset, outline, fillet) change its shapes, applied in order before the colors: hide, duplicate, place, simplify, round, point, corner, add_point, delete_point, fillet, merge, arrange, paint, subtract, intersect, exclude, flip, offset, outline, stretch, align, weight. Each addresses a shape by its index in the table with the background kept; the background can only be hidden, and is no edit's other shape (into, by, with). It is stored canonical, and the same one saved again is the same variant, used now. Free; its files download under the image's unlock (`/download?variant=`). An edit only the engine draws, the file's own geometry (simplify, round, point, corner, add_point, delete_point, fillet, merge, subtract, intersect, exclude, offset, outline, weight), is added once the image is unlocked (402 `unlock_required` before, nothing saved); one a saved revision of the result already holds is kept.
|
|
128
170
|
*/
|
|
129
171
|
export declare const createConversionVariant: <ThrowOnError extends boolean = false>(options: Options<CreateConversionVariantData, ThrowOnError>) => RequestResult<CreateConversionVariantResponses, CreateConversionVariantErrors, ThrowOnError>;
|
|
130
172
|
/**
|
|
@@ -178,7 +220,7 @@ export declare const eraseImage: <ThrowOnError extends boolean = false>(options:
|
|
|
178
220
|
/**
|
|
179
221
|
* Convert an image again
|
|
180
222
|
*
|
|
181
|
-
* A new version of the image with today's engine, from the bytes it was made from: the API copies them (its result's kept original, else a version's upload while kept), so nothing is uploaded again. Every rule of POST /conversions applies: free (an unlocked image's re-runs always are), counted by the daily caps. `options`
|
|
223
|
+
* A new version of the image with today's engine, from the bytes it was made from: the API copies them (its result's kept original, else a version's upload while kept), so nothing is uploaded again. Every rule of POST /conversions applies: free (an unlocked image's re-runs always are), counted by the daily caps. With no `tool`, `preset`, `options` or `cleanOptions`, the newest version's own recipe is kept; `{"maxColors": N}` redraws it with at most N colors (GET /conversions/{id}/palette previews it first); a `preset` that is not the version's redraws it in that preset, without the version's options. For an SVG, `tool: redraw` redraws a Clean's image and `tool: clean` with `cleanOptions` cleans it again with other settings. 409 `original_not_kept` when the image's file is no longer kept: upload it again.
|
|
182
224
|
*/
|
|
183
225
|
export declare const createImageConversion: <ThrowOnError extends boolean = false>(options: Options<CreateImageConversionData, ThrowOnError>) => RequestResult<CreateImageConversionResponses, CreateImageConversionErrors, ThrowOnError>;
|
|
184
226
|
/**
|
|
@@ -229,12 +271,24 @@ export declare const deletePalette: <ThrowOnError extends boolean = false>(optio
|
|
|
229
271
|
* Its name and colors, whole. Another's is 404 `palette_not_found`, the same as none.
|
|
230
272
|
*/
|
|
231
273
|
export declare const updatePalette: <ThrowOnError extends boolean = false>(options: Options<UpdatePaletteData, ThrowOnError>) => RequestResult<UpdatePaletteResponses, UpdatePaletteErrors, ThrowOnError>;
|
|
274
|
+
/**
|
|
275
|
+
* Retrieve whose account this is
|
|
276
|
+
*
|
|
277
|
+
* The email of the account the caller acts for, so a connected app can show its person which account it is connected to. A test key acts as the account's sandbox, which has none: `email` is null.
|
|
278
|
+
*/
|
|
279
|
+
export declare const getIdentity: <ThrowOnError extends boolean = false>(options?: Options<GetIdentityData, ThrowOnError>) => RequestResult<GetIdentityResponses, GetIdentityErrors, ThrowOnError>;
|
|
232
280
|
/**
|
|
233
281
|
* Retrieve the credit balance
|
|
234
282
|
*
|
|
235
283
|
* Derived from the ledger on every call: there is no balance column, since a cached total drifts under partial failure and the customer is the one who finds out. `unlockCost` is what unlocking one image costs, published so a client never hardcodes it; `tier` says which caps apply.
|
|
236
284
|
*/
|
|
237
285
|
export declare const getCredits: <ThrowOnError extends boolean = false>(options?: Options<GetCreditsData, ThrowOnError>) => RequestResult<GetCreditsResponses, GetCreditsErrors, ThrowOnError>;
|
|
286
|
+
/**
|
|
287
|
+
* List the credit history
|
|
288
|
+
*
|
|
289
|
+
* Every entry that moved the caller's balance, newest first, a page at a time: what added credits (the sign-up grant, packs, a plan's months) and what spent them (unlocks, conversions paid in credits), each with what it meant. Pass a page's `nextCursor` back as `cursor`. Their sum is the balance (`GET /credits`).
|
|
290
|
+
*/
|
|
291
|
+
export declare const listCreditHistory: <ThrowOnError extends boolean = false>(options?: Options<ListCreditHistoryData, ThrowOnError>) => RequestResult<ListCreditHistoryResponses, ListCreditHistoryErrors, ThrowOnError>;
|
|
238
292
|
/**
|
|
239
293
|
* Retrieve today's limits
|
|
240
294
|
*
|
|
@@ -3,7 +3,7 @@ import { client } from "./client.gen.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Vectorize an image
|
|
5
5
|
*
|
|
6
|
-
* Converts one image and hands you its SVG in the same request. Send exactly one of `file` (multipart), `url` or `inputKey`. If it finishes within `wait` seconds the answer is 200 with the result and its files; otherwise 202 with the conversion, which finishes on its own (`Location` names it: read it, stream its events, or await your webhook). Every client MUST handle the 202: most images take seconds, a few take minutes. It
|
|
6
|
+
* Converts one image and hands you its SVG in the same request. Send exactly one of `file` (multipart), `url` or `inputKey`. If it finishes within `wait` seconds the answer is 200 with the result and its files; otherwise 202 with the conversion, which finishes on its own (`Location` names it: read it, stream its events, or await your webhook). Every client MUST handle the 202: most images take seconds, a few take minutes. It UNLOCKS unless `unlock` is false: 1 credit per image, held now and refunded if the conversion fails; an image already unlocked costs nothing again. Past your limit of conversions at once it waits its turn instead of refusing. Test keys: free (the sample result). With `Accept: image/svg+xml` a finished conversion answers 303 to the web file itself.
|
|
7
7
|
*/
|
|
8
8
|
export const vectorize = (options) => (options.client ?? client).post({
|
|
9
9
|
security: [{ scheme: 'bearer', type: 'http' }],
|
|
@@ -41,7 +41,7 @@ export const listConversions = (options) => (options?.client ?? client).get({
|
|
|
41
41
|
/**
|
|
42
42
|
* Create a conversion
|
|
43
43
|
*
|
|
44
|
-
* Converting is FREE: 1 credit = 1 image, spent when the image is UNLOCKED (here with `unlock: true`, or later with POST /conversions/{id}/unlock). A free conversion counts against the daily caps (guests 3 a UTC day, free accounts 10, customers 100). A guest never unlocks: `unlock: true` answers it 403 `account_required
|
|
44
|
+
* Converting is FREE: 1 credit = 1 image, spent when the image is UNLOCKED (here with `unlock: true`, or later with POST /conversions/{id}/unlock). A free conversion counts against the daily caps (guests 3 a UTC day, free accounts 10, customers 100). A guest never unlocks: `unlock: true` answers it 403 `account_required`; nor does a connected app's pass (403 `pass_not_allowed`: the person unlocks). Accepted formats: PNG, JPG, WebP, AVIF, GIF, BMP, TIFF, SVG and PDF (read by their bytes; an animation or a multi-page TIFF at its first frame), at most 4096×4096. HEIC, SVGZ: send a PNG (the website converts it in the browser). Repeating an `idempotencyKey` answers 200 with the conversion it already made, never a second one and never a second charge.
|
|
45
45
|
*/
|
|
46
46
|
export const createConversion = (options) => (options.client ?? client).post({
|
|
47
47
|
security: [{ scheme: 'bearer', type: 'http' }],
|
|
@@ -105,7 +105,7 @@ export const watchConversion = (options) => (options.client ?? client).sse.get({
|
|
|
105
105
|
/**
|
|
106
106
|
* Download a file of the result
|
|
107
107
|
*
|
|
108
|
-
* A short-lived URL for one of the result's files: `format` names one of `result.formats` by id (absent, the web default). Served from the storage domain as an attachment, never inline from this origin: SVG is an active document format. Allowed once the conversion's IMAGE is unlocked, on every plan; then every format and re-download is free. A locked image answers 402 `unlock_required` (this GET never spends). `as` takes the format as a print-ready PDF (`pdf`, a design file's of outlines, never its `editableText` twin) or a picture (`png`, a web file's with a preview, `size` px on its long side): made from the stored result on first ask, after the unlock check.
|
|
108
|
+
* A short-lived URL for one of the result's files: `format` names one of `result.formats` by id (absent, the web default). Served from the storage domain as an attachment, never inline from this origin: SVG is an active document format. Allowed once the conversion's IMAGE is unlocked, on every plan; then every format and re-download is free. A locked image answers 402 `unlock_required` (this GET never spends). `as` takes the format as a print-ready PDF (`pdf`, a design file's of outlines, never its `editableText` twin) or a picture (`png`, a web file's with a preview, `size` px on its long side). Any design file, its `editableText` twin included, takes `layers`: its LAYER TREE, the drawing as JSON data for a design tool's own layers (groups, ellipses, rectangles, paths, components, text; the vocabulary is VecSnap's `LayerTree`). A design file of outlines also takes a maker's file: cut-ready (`cut`, each shape minus what is painted over it, for a cutting machine), a DXF (`dxf`, `units` mm or in, for a laser or a CNC), an EPS (`eps`, for a print shop), a 3D print raised `height` mm (`stl`, one body; `3mf`, one object per color, for a printer with several filaments), or its LINES: each edge drawn once, in a machine's order (`plot`, an SVG; `plot-dxf`, a DXF in `units`): a single-line version's lines, any other drawing's outlines. Each is made from the stored result on first ask, after the unlock check.
|
|
109
109
|
*/
|
|
110
110
|
export const downloadConversion = (options) => (options.client ?? client).get({
|
|
111
111
|
security: [{ scheme: 'bearer', type: 'http' }],
|
|
@@ -115,17 +115,27 @@ export const downloadConversion = (options) => (options.client ?? client).get({
|
|
|
115
115
|
/**
|
|
116
116
|
* Preview the result
|
|
117
117
|
*
|
|
118
|
-
* A short-lived URL for a web file's rendered PNG, on EVERY tier: the free tier is the product demo, a full-quality conversion, this preview and its figures, with the SVG withheld. Served inline (a PNG is inert). `format` names a web file of `result.formats` that is not `currentColor` (its background kept or dropped); absent, the web default's. 2048 px on its long side, at the drawing's own aspect. `layer=outline`: the anchor-point view at the same size, lying exactly on it (black hairlines and squares on transparency).
|
|
118
|
+
* A short-lived URL for a web file's rendered PNG, on EVERY tier: the free tier is the product demo, a full-quality conversion, this preview and its figures, with the SVG withheld. Served inline (a PNG is inert). `format` names a web file of `result.formats` that is not `currentColor` (its background kept or dropped); absent, the web default's. 2048 px on its long side, at the drawing's own aspect. `layer=outline`: the anchor-point view at the same size, lying exactly on it (black hairlines and squares on transparency). `layer=plot`: what a machine draws at the same size, in one ink; with `variant`, under its edits and colors, as its file downloads, with that drawing's figures in `plot`. `layer=cut`: the CUT-READY picture of the DESIGN file `format` names (a design file of outlines: what a cutter's blade follows), a revision's too.
|
|
119
119
|
*/
|
|
120
120
|
export const previewConversion = (options) => (options.client ?? client).get({
|
|
121
121
|
security: [{ scheme: 'bearer', type: 'http' }],
|
|
122
122
|
url: '/conversions/{id}/preview',
|
|
123
123
|
...options
|
|
124
124
|
});
|
|
125
|
+
/**
|
|
126
|
+
* Figures for each machine
|
|
127
|
+
*
|
|
128
|
+
* A single-line version's figures for each kind of machine: `pen` (what a pen draws: a few short stretches gone over twice so it lifts less: its lines, the closed ones, its colors, the lines too short to draw cleanly) and `once` (the file a laser, a blade or CAD draws, each stretch once). With `variant`, a revision's, under its edits. A version's are made with it; a revision's are made on the first ask, under the long files' wait. A drawing the engine refuses, or too dense to walk in time, is refused (`file_not_makeable`), final. Both are null for a version that is not single lines. No credit is spent (figures, never the file); a walk made on the first ask counts toward the day's compute (`compute_limit_reached`).
|
|
129
|
+
*/
|
|
130
|
+
export const getConversionMachines = (options) => (options.client ?? client).get({
|
|
131
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
132
|
+
url: '/conversions/{id}/machines',
|
|
133
|
+
...options
|
|
134
|
+
});
|
|
125
135
|
/**
|
|
126
136
|
* Tiles of a deeper zoom
|
|
127
137
|
*
|
|
128
|
-
* Every tier, like the preview: pictures of the file, never the SVG. Level L draws the drawing 2048·2^L px long, cut into 512-px squares (1 ≤ L ≤ 3); a tile is [x, y] within the square grid of its level. Missing tiles are made first, then served from storage.
|
|
138
|
+
* Every tier, like the preview: pictures of the file, never the SVG. Level L draws the drawing 2048·2^L px long, cut into 512-px squares (1 ≤ L ≤ 3); a tile is [x, y] within the square grid of its level. Missing tiles are made first, then served from storage. Several layers at once: POST /conversions/{id}/tiles/batch.
|
|
129
139
|
*/
|
|
130
140
|
export const getConversionTiles = (options) => (options.client ?? client).post({
|
|
131
141
|
security: [{ scheme: 'bearer', type: 'http' }],
|
|
@@ -136,40 +146,104 @@ export const getConversionTiles = (options) => (options.client ?? client).post({
|
|
|
136
146
|
...options.headers
|
|
137
147
|
}
|
|
138
148
|
});
|
|
149
|
+
/**
|
|
150
|
+
* Tiles of several layers at once
|
|
151
|
+
*
|
|
152
|
+
* The tiles of every layer one view shows (the picture, its Shapes ID picture, the outline), in one request: each ask is POST /conversions/{id}/tiles's, answered in the same order. At most 24 tiles in all, of one revision (`variant`) and one preview count (`palette`) at most; ask another's apart; it succeeds or fails whole. One request at a time per account makes files: another meanwhile waits its turn (up to 15 s), then, or with 8 already waiting, is refused with 429 `derive_busy` (nothing done; ask again after Retry-After).
|
|
153
|
+
*/
|
|
154
|
+
export const getConversionTileBatch = (options) => (options.client ?? client).post({
|
|
155
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
156
|
+
url: '/conversions/{id}/tiles/batch',
|
|
157
|
+
...options,
|
|
158
|
+
headers: {
|
|
159
|
+
'Content-Type': 'application/json',
|
|
160
|
+
...options.headers
|
|
161
|
+
}
|
|
162
|
+
});
|
|
139
163
|
/**
|
|
140
164
|
* The original image
|
|
141
165
|
*
|
|
142
|
-
* A short-lived URL for the image the conversion was made from: the upload, kept with its result for the comparison (deleted with the result or the account, never in the shared cache). While it waits or runs, the upload itself, so a client can show the image being converted. Served inline, as the type its bytes proved at upload. A result made before originals were kept, a running conversion whose upload is gone,
|
|
166
|
+
* A short-lived URL for the image the conversion was made from: the upload, kept with its result for the comparison (deleted with the result or the account, never in the shared cache). While it waits or runs, the upload itself, so a client can show the image being converted. Served inline, as the type its bytes proved at upload; an upload no page shows as itself (a TIFF, an SVG) is answered as its PICTURE, a PNG the engine drew of it, never the file. A result made before originals were kept, or a running conversion whose upload is gone, has none: 404 `original_unavailable`.
|
|
143
167
|
*/
|
|
144
168
|
export const getConversionOriginal = (options) => (options.client ?? client).get({
|
|
145
169
|
security: [{ scheme: 'bearer', type: 'http' }],
|
|
146
170
|
url: '/conversions/{id}/original',
|
|
147
171
|
...options
|
|
148
172
|
});
|
|
173
|
+
/**
|
|
174
|
+
* What an uploaded SVG was
|
|
175
|
+
*
|
|
176
|
+
* Every tier, an SVG upload's only, either tool: its anchor points, its size and its colors as the engine read them, and a short-lived link to its points as data. Written at conversion: an upload of another format, one the engine's SVG reader cannot read, or a result made before these existed has none: 404 `not_found`. A connected app's pass reads the counts alone: its `points` is null.
|
|
177
|
+
*/
|
|
178
|
+
export const getConversionOriginalFacts = (options) => (options.client ?? client).get({
|
|
179
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
180
|
+
url: '/conversions/{id}/original/facts',
|
|
181
|
+
...options
|
|
182
|
+
});
|
|
149
183
|
/**
|
|
150
184
|
* The result's facts
|
|
151
185
|
*
|
|
152
|
-
* Every tier: the engine's facts of the default file, in the ENGINE's names (the same object the site's examples show): the counts a layers panel would sum (anchor points, paths, circles, rectangles, rings, strokes, repeats, elements, the words kept as text) and every color the file draws with what it paints and its share of the frame.
|
|
186
|
+
* Every tier: the engine's facts of the default file, in the ENGINE's names (the same object the site's examples show): the counts a layers panel would sum (anchor points, paths, circles, rectangles, rings, strokes, repeats, elements, the words kept as text) and every color the file draws with what it paints and its share of the frame. `lane`: whether the upload looks like what VecSnap is built for (`in`: logos, icons, illustrations) or like a photograph (`photo`), read by the engine before converting; null when not read (a result converted before it). `lineArt`: whether the drawing is made of lines, so a single-line version may suit it. `plot`: a single-line version's figures for a machine.
|
|
153
187
|
*/
|
|
154
188
|
export const getConversionFacts = (options) => (options.client ?? client).get({
|
|
155
189
|
security: [{ scheme: 'bearer', type: 'http' }],
|
|
156
190
|
url: '/conversions/{id}/facts',
|
|
157
191
|
...options
|
|
158
192
|
});
|
|
193
|
+
/**
|
|
194
|
+
* What a Clean did
|
|
195
|
+
*
|
|
196
|
+
* Every tier, a Clean's only (`tool: clean`): the upload's anchor points and the result's, the upload's size, the distance every outline was kept within, and each step that acted, by its setting's name (`cleanOptions`). A Redraw has none: 404 `not_found`.
|
|
197
|
+
*/
|
|
198
|
+
export const getConversionCleaned = (options) => (options.client ?? client).get({
|
|
199
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
200
|
+
url: '/conversions/{id}/cleaned',
|
|
201
|
+
...options
|
|
202
|
+
});
|
|
159
203
|
/**
|
|
160
204
|
* The result's shapes
|
|
161
205
|
*
|
|
162
|
-
* Every tier, like the preview: a web file's shapes in the engine's order, and a link to its ID PICTURE at the preview's size: every pixel's color − 1 is the shape on top there, transparent where none is, never a blended pixel. Decode it with color conversion and premultiplying off. Its deeper zoom: POST /conversions/{id}/tiles with the layer `ids-{format}`.
|
|
206
|
+
* Every tier, like the preview: a web file's shapes in the engine's order, and a link to its ID PICTURE at the preview's size: every pixel's color − 1 is the shape on top there, transparent where none is, never a blended pixel. Decode it with color conversion and premultiplying off. Its deeper zoom: POST /conversions/{id}/tiles with the layer `ids-{format}`. The default web file's is made with the conversion; another's on the first ask; then served.
|
|
163
207
|
*/
|
|
164
208
|
export const getConversionShapes = (options) => (options.client ?? client).get({
|
|
165
209
|
security: [{ scheme: 'bearer', type: 'http' }],
|
|
166
210
|
url: '/conversions/{id}/shapes',
|
|
167
211
|
...options
|
|
168
212
|
});
|
|
213
|
+
/**
|
|
214
|
+
* Lift a shape
|
|
215
|
+
*
|
|
216
|
+
* Every tier, like the preview: two short-lived URLs to MOVE a shape on screen before the move is saved. `without` is the web file without the shape (its preview with one hide more, never saved), `alone` the shape alone, every other one hidden and drawn whole where another covered it; both 2048 px on the long side, lying exactly on the preview. `shape` is its number in a revision's edits (the Shapes table's `shape`); the ground can only be hidden, never lifted. Moving it is then ONE `place` edit (POST /conversions/{id}/variants).
|
|
217
|
+
*/
|
|
218
|
+
export const liftConversionShape = (options) => (options.client ?? client).get({
|
|
219
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
220
|
+
url: '/conversions/{id}/lift',
|
|
221
|
+
...options
|
|
222
|
+
});
|
|
223
|
+
/**
|
|
224
|
+
* Read a shape's anchors
|
|
225
|
+
*
|
|
226
|
+
* Once the image is UNLOCKED (402 `unlock_required` before: the anchors are the file's geometry): a shape's anchor points as data, numbered exactly as the anchor edits name them (`point`, `corner`, `add_point`, `delete_point`, `fillet`, saved by POST /conversions/{id}/variants), on the shape as the revision edits it. `x` and `y` are in the file's own units (the Shapes table's). `reach` is the largest `fillet` radius that fits there (`reachExact`: every radius up to it fits, between two straight sides); `segment` the one leaving the anchor (`add_point`'s `at` is a place on it; an arc takes none). A shape no anchor edit addresses answers an empty list.
|
|
227
|
+
*/
|
|
228
|
+
export const getConversionAnchors = (options) => (options.client ?? client).get({
|
|
229
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
230
|
+
url: '/conversions/{id}/anchors',
|
|
231
|
+
...options
|
|
232
|
+
});
|
|
233
|
+
/**
|
|
234
|
+
* Try edits
|
|
235
|
+
*
|
|
236
|
+
* Every tier, like the preview: a short-lived URL to the web file's preview with EDITS after a revision's own (or the result's), NEVER saved: what a press would draw before it is pressed. `edits` is a JSON list of 1 to 8 edits, in a revision's numbering and vocabulary (POST /conversions/{id}/variants); saving the same edits later draws from the same picture. Counted on its own budget, apart from what saving needs. An edit only the engine draws (simplify, round, point, corner, add_point, delete_point, fillet, merge, subtract, intersect, exclude, offset, outline, weight) is tried once the image is unlocked (402 `unlock_required` before).
|
|
237
|
+
*/
|
|
238
|
+
export const tryConversionEdits = (options) => (options.client ?? client).get({
|
|
239
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
240
|
+
url: '/conversions/{id}/try',
|
|
241
|
+
...options
|
|
242
|
+
});
|
|
169
243
|
/**
|
|
170
244
|
* The result's paint map
|
|
171
245
|
*
|
|
172
|
-
* Every tier, like the preview: the paints the file draws with its ground left out, in index order, each with its share of the frame, the ground, and a link to `paints.bin`: zlib of an index plane then a weight plane (width × height × 4 bytes each: every pixel's four largest paints, 255 = none, and their weights × 255). A pixel of any recolor is Σ w·c′ (premultiplied), with the ground under it as (1 − Σ w)·ground. Made on the first ask; a drawing of more than 24 paints has none.
|
|
246
|
+
* Every tier, like the preview: the paints the file draws with its ground left out, in index order, each with its share of the frame, the ground, and a link to `paints.bin`: zlib of an index plane then a weight plane (width × height × 4 bytes each: every pixel's four largest paints, 255 = none, and their weights × 255). A pixel of any recolor is Σ w·c′ (premultiplied), with the ground under it as (1 − Σ w)·ground. Made with the conversion (an older result's on the first ask); a drawing of more than 24 paints has none.
|
|
173
247
|
*/
|
|
174
248
|
export const getConversionPaints = (options) => (options.client ?? client).get({
|
|
175
249
|
security: [{ scheme: 'bearer', type: 'http' }],
|
|
@@ -197,9 +271,9 @@ export const listConversionVariants = (options) => (options.client ?? client).ge
|
|
|
197
271
|
...options
|
|
198
272
|
});
|
|
199
273
|
/**
|
|
200
|
-
*
|
|
274
|
+
* Change a result: recolor it, edit its shapes
|
|
201
275
|
*
|
|
202
|
-
* `colors` maps the file's own colors to new ones, every use of each (fills, strokes, gradient stops, the ground); two to one value merge them. Keys are the result's paints and its ground (`/facts`); the
|
|
276
|
+
* A REVISION of the result. `colors` maps the file's own colors to new ones, every use of each (fills, strokes, gradient stops, the ground); two to one value merge them. Keys are the result's paints and its ground (`/facts`). `edits` (at most 1000; at most 25 of them slow to replay: simplify, merge, subtract, intersect, exclude, offset, outline, fillet) change its shapes, applied in order before the colors: hide, duplicate, place, simplify, round, point, corner, add_point, delete_point, fillet, merge, arrange, paint, subtract, intersect, exclude, flip, offset, outline, stretch, align, weight. Each addresses a shape by its index in the table with the background kept; the background can only be hidden, and is no edit's other shape (into, by, with). It is stored canonical, and the same one saved again is the same variant, used now. Free; its files download under the image's unlock (`/download?variant=`). An edit only the engine draws, the file's own geometry (simplify, round, point, corner, add_point, delete_point, fillet, merge, subtract, intersect, exclude, offset, outline, weight), is added once the image is unlocked (402 `unlock_required` before, nothing saved); one a saved revision of the result already holds is kept.
|
|
203
277
|
*/
|
|
204
278
|
export const createConversionVariant = (options) => (options.client ?? client).post({
|
|
205
279
|
security: [{ scheme: 'bearer', type: 'http' }],
|
|
@@ -301,7 +375,7 @@ export const eraseImage = (options) => (options.client ?? client).post({
|
|
|
301
375
|
/**
|
|
302
376
|
* Convert an image again
|
|
303
377
|
*
|
|
304
|
-
* A new version of the image with today's engine, from the bytes it was made from: the API copies them (its result's kept original, else a version's upload while kept), so nothing is uploaded again. Every rule of POST /conversions applies: free (an unlocked image's re-runs always are), counted by the daily caps. `options`
|
|
378
|
+
* A new version of the image with today's engine, from the bytes it was made from: the API copies them (its result's kept original, else a version's upload while kept), so nothing is uploaded again. Every rule of POST /conversions applies: free (an unlocked image's re-runs always are), counted by the daily caps. With no `tool`, `preset`, `options` or `cleanOptions`, the newest version's own recipe is kept; `{"maxColors": N}` redraws it with at most N colors (GET /conversions/{id}/palette previews it first); a `preset` that is not the version's redraws it in that preset, without the version's options. For an SVG, `tool: redraw` redraws a Clean's image and `tool: clean` with `cleanOptions` cleans it again with other settings. 409 `original_not_kept` when the image's file is no longer kept: upload it again.
|
|
305
379
|
*/
|
|
306
380
|
export const createImageConversion = (options) => (options.client ?? client).post({
|
|
307
381
|
security: [{ scheme: 'bearer', type: 'http' }],
|
|
@@ -416,6 +490,16 @@ export const updatePalette = (options) => (options.client ?? client).patch({
|
|
|
416
490
|
...options.headers
|
|
417
491
|
}
|
|
418
492
|
});
|
|
493
|
+
/**
|
|
494
|
+
* Retrieve whose account this is
|
|
495
|
+
*
|
|
496
|
+
* The email of the account the caller acts for, so a connected app can show its person which account it is connected to. A test key acts as the account's sandbox, which has none: `email` is null.
|
|
497
|
+
*/
|
|
498
|
+
export const getIdentity = (options) => (options?.client ?? client).get({
|
|
499
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
500
|
+
url: '/identity',
|
|
501
|
+
...options
|
|
502
|
+
});
|
|
419
503
|
/**
|
|
420
504
|
* Retrieve the credit balance
|
|
421
505
|
*
|
|
@@ -426,6 +510,16 @@ export const getCredits = (options) => (options?.client ?? client).get({
|
|
|
426
510
|
url: '/credits',
|
|
427
511
|
...options
|
|
428
512
|
});
|
|
513
|
+
/**
|
|
514
|
+
* List the credit history
|
|
515
|
+
*
|
|
516
|
+
* Every entry that moved the caller's balance, newest first, a page at a time: what added credits (the sign-up grant, packs, a plan's months) and what spent them (unlocks, conversions paid in credits), each with what it meant. Pass a page's `nextCursor` back as `cursor`. Their sum is the balance (`GET /credits`).
|
|
517
|
+
*/
|
|
518
|
+
export const listCreditHistory = (options) => (options?.client ?? client).get({
|
|
519
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
520
|
+
url: '/credits/history',
|
|
521
|
+
...options
|
|
522
|
+
});
|
|
429
523
|
/**
|
|
430
524
|
* Retrieve today's limits
|
|
431
525
|
*
|