planvortex 0.25.0 → 0.26.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 +3 -1
- package/dist/{chunk-L2DNKFA2.js → chunk-JAA666FR.js} +5 -3
- package/dist/chunk-JAA666FR.js.map +1 -0
- package/dist/{index-CVJ6ace_.d.cts → index-C5hlx3fK.d.cts} +80 -20
- package/dist/{index-CVJ6ace_.d.ts → index-C5hlx3fK.d.ts} +80 -20
- package/dist/index.cjs +34 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +49 -14
- package/dist/index.d.ts +49 -14
- package/dist/index.js +33 -5
- package/dist/index.js.map +1 -1
- package/dist/webhooks/index.cjs +3 -1
- package/dist/webhooks/index.cjs.map +1 -1
- package/dist/webhooks/index.d.cts +1 -1
- package/dist/webhooks/index.d.ts +1 -1
- package/dist/webhooks/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-L2DNKFA2.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as Paginated, S as SocialNetwork, C as ConnectLink, a as ConnectResult, E as EnableResult, b as ConnectSession, A as Account, c as AccountMetrics, D as Destination, d as PublishSettings, e as PersistentMenu, f as Dashboard, M as MetricName, g as DashboardMetricsResult, h as PublicationsSummaryResult, T as TopPublicationsResult, i as PublicationsStatsResult, j as PlanUse, k as Publication, l as AiPlanResultsSort, m as PlannerTemplateName, n as AiPlanCreateRequest, o as AiPlanCreateResult, p as AiPlan, q as AiPlanResults, r as ClientApp, s as ClientAppInput, t as SocialCapabilities, u as CommentActions, v as SocialLimits, w as PublicationLimits, x as AspectRatiosByNetwork, y as PlannerTemplate, z as CommentNetwork, B as Comment, F as CommentThread, G as CommentReplyResult, H as ContactExtraData, I as Contact, J as ContactCreate, K as ContactUpdate, L as IntegrationProviderName, N as IntegrationProvider, O as Integration, Q as IntegrationConnectRequest, R as IntegrationUpdate, U as IntegrationPickerConfig, V as IntegrationCatalogPage, W as MessageTemplate, X as Conversation, Y as ConversationTotals, Z as Message, _ as MessageInput, $ as ConversationRead, a0 as Client, a1 as Organization, a2 as AiSettings, a3 as ClientWithOrganizations, a4 as AccountSelection, a5 as PlanData, a6 as PlanUseData, a7 as ConnectToken, a8 as AiContext, a9 as SocialCredentialsInput, aa as Product, ab as ProductInput, ac as ProductCatalog, ad as ProductCatalogInput, ae as PublicationInput, af as PublicationState, ag as PublicationStats, ah as PublicationStatsHistory, ai as Upload } from './index-
|
|
2
|
-
export { aj as AccountError, ak as AccountMetricRow, al as AccountStateChange, am as AccountWebhookChangeBase, an as AccountWithError, ao as AiImageOrigin, ap as AiPlanCostEstimate, aq as AiPlanDestination, ar as AiPlanError, as as AiPlanNotice, at as AiPlanOptions, au as AiPlanOptionsInput, av as AiPlanResult, aw as AiPlanResultsGroup, ax as AiPlanResultsTemplateGroup, ay as AiPlanSource, az as AiPlanSourceImageInput, aA as AiPlanSourceInput, aB as AiPlanSourceProduct, aC as AiPlanState, aD as ApiErrorBody, aE as AspectRatios, aF as AuthError, aG as ClientPlan, aH as CommentAuthor, aI as CommentChange, aJ as ConnectSessionAccount, aK as ContactChannel, aL as ContactError, aM as DashboardAiPlanRef, aN as DashboardPublicationRef, aO as DashboardRange, aP as EngagementBase, aQ as FileError, aR as FileFormat, aS as FileProperties, aT as FileType, aU as IntegrationCatalogProduct, aV as IntegrationConfig, aW as IntegrationError, aX as IntegrationErrorChange, aY as IntegrationFormField, aZ as MessageChange, a_ as MessageEchoChange, a$ as MessageOptions, b0 as MessageType, b1 as MessagingError, b2 as MetricRow, b3 as NO_ERROR_CODE, b4 as OpenApiComponents, b5 as OpenApiOperations, b6 as OpenApiPaths, b7 as OpenApiWebhooks, b8 as OpenEnum, b9 as OrganizationError, ba as PLANVORTEX_ERROR_RANGES, bb as PlanLimitError, bc as PlanVortexAuthenticationError, bd as PlanVortexConfigError, be as PlanVortexConnectionError, bf as PlanVortexError, bg as PlanVortexErrorOptions, bh as PlanVortexErrorRange, bi as PlannerTemplateField, bj as PlannerTemplateFieldType, bk as ProductError, bl as PublicationAiGenerated, bm as PublicationDestination, bn as PublicationError, bo as PublicationErrorDetail, bp as PublicationMetrics, bq as PublicationPending, br as PublicationStatsPoint, bs as PublicationType, bt as PublicationsSummary, bu as RssConfig, bv as SocialAuthorizationMethod, bw as SocialCredentials, bx as SocialIdentifier, by as SocialIdentifierInput, bz as SocialLimitsMap, bA as TOKEN_ERROR_CODES, bB as TopPublication, bC as UnknownWebhookChange, bD as UserError, bE as WebhookAlgorithm, bF as WebhookChange, bG as WebhookEvent, bH as WithAccount, bI as WithPublication, bJ as WooCommerceConnectRequest, bK as account, bL as accountId, bM as errorFamilyForCode, bN as isPlanVortexError, bO as isTokenError, bP as messageContact, bQ as messageContactId, bR as messageDirection, bS as messageFileIds, bT as messageFiles, bU as publication, bV as publicationId } from './index-
|
|
1
|
+
import { P as Paginated, S as SocialNetwork, C as ConnectLink, a as ConnectResult, E as EnableResult, b as ConnectSession, A as Account, c as AccountMetrics, D as Destination, d as PublishSettings, e as PersistentMenu, f as Dashboard, M as MetricName, g as DashboardMetricsResult, h as PublicationsSummaryResult, T as TopPublicationsResult, i as PublicationsStatsResult, j as PlanUse, k as Publication, l as AiPlanResultsSort, m as PlannerTemplateName, n as AiPlanCreateRequest, o as AiPlanCreateResult, p as AiPlan, q as AiPlanResults, r as ClientApp, s as ClientAppInput, t as SocialCapabilities, u as CommentActions, v as SocialLimits, w as PublicationLimits, x as AspectRatiosByNetwork, y as PlannerTemplate, z as CommentNetwork, B as Comment, F as CommentThread, G as CommentReplyResult, H as ContactExtraData, I as Contact, J as ContactCreate, K as ContactUpdate, L as IntegrationProviderName, N as IntegrationProvider, O as Integration, Q as IntegrationConnectRequest, R as IntegrationUpdate, U as IntegrationPickerConfig, V as IntegrationCatalogPage, W as MessageTemplate, X as Conversation, Y as ConversationTotals, Z as Message, _ as MessageInput, $ as ConversationRead, a0 as Client, a1 as Organization, a2 as AiSettings, a3 as ClientWithOrganizations, a4 as AccountSelection, a5 as PlanData, a6 as PlanUseData, a7 as ConnectToken, a8 as AiContext, a9 as SocialCredentialsInput, aa as Product, ab as ProductInput, ac as ProductCatalog, ad as ProductCatalogInput, ae as PublicationInput, af as PublicationState, ag as PublicationStats, ah as PublicationStatsHistory, ai as Upload } from './index-C5hlx3fK.cjs';
|
|
2
|
+
export { aj as AccountError, ak as AccountMetricRow, al as AccountStateChange, am as AccountWebhookChangeBase, an as AccountWithError, ao as AiImageOrigin, ap as AiPlanCostEstimate, aq as AiPlanDestination, ar as AiPlanError, as as AiPlanNotice, at as AiPlanOptions, au as AiPlanOptionsInput, av as AiPlanResult, aw as AiPlanResultsGroup, ax as AiPlanResultsTemplateGroup, ay as AiPlanSource, az as AiPlanSourceImageInput, aA as AiPlanSourceInput, aB as AiPlanSourceProduct, aC as AiPlanState, aD as ApiErrorBody, aE as AspectRatios, aF as AuthError, aG as ClientPlan, aH as CommentAuthor, aI as CommentChange, aJ as ConnectSessionAccount, aK as ContactChannel, aL as ContactError, aM as DashboardAiPlanRef, aN as DashboardPublicationRef, aO as DashboardRange, aP as EngagementBase, aQ as FileError, aR as FileFormat, aS as FileProperties, aT as FileType, aU as IntegrationCatalogProduct, aV as IntegrationConfig, aW as IntegrationError, aX as IntegrationErrorChange, aY as IntegrationFormField, aZ as MessageChange, a_ as MessageEchoChange, a$ as MessageOptions, b0 as MessageType, b1 as MessagingError, b2 as MetricRow, b3 as NO_ERROR_CODE, b4 as OpenApiComponents, b5 as OpenApiOperations, b6 as OpenApiPaths, b7 as OpenApiWebhooks, b8 as OpenEnum, b9 as OrganizationError, ba as PLANVORTEX_ERROR_RANGES, bb as PlanLimitError, bc as PlanVortexAuthenticationError, bd as PlanVortexConfigError, be as PlanVortexConnectionError, bf as PlanVortexError, bg as PlanVortexErrorOptions, bh as PlanVortexErrorRange, bi as PlannerTemplateField, bj as PlannerTemplateFieldType, bk as ProductError, bl as PublicationAiGenerated, bm as PublicationDestination, bn as PublicationError, bo as PublicationErrorDetail, bp as PublicationMetrics, bq as PublicationPending, br as PublicationStatsPoint, bs as PublicationType, bt as PublicationsSummary, bu as RssConfig, bv as SocialAuthorizationMethod, bw as SocialCredentials, bx as SocialIdentifier, by as SocialIdentifierInput, bz as SocialLimitsMap, bA as TOKEN_ERROR_CODES, bB as TopPublication, bC as UnknownWebhookChange, bD as UserError, bE as WebhookAlgorithm, bF as WebhookChange, bG as WebhookEvent, bH as WithAccount, bI as WithPublication, bJ as WooCommerceConnectRequest, bK as account, bL as accountId, bM as errorFamilyForCode, bN as isPlanVortexError, bO as isTokenError, bP as messageContact, bQ as messageContactId, bR as messageDirection, bS as messageFileIds, bT as messageFiles, bU as publication, bV as publicationId } from './index-C5hlx3fK.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Las dos constantes que todo lo demás necesita. Viven aparte de `index.ts` para que `client.ts`
|
|
@@ -15,7 +15,7 @@ declare const PLANVORTEX_API_URL = "https://api.planvortex.com/v1.0.0";
|
|
|
15
15
|
* de ejecución obliga a empaquetarlo y se rompe distinto en ESM y en CJS. La mantiene sincronizada
|
|
16
16
|
* un test.
|
|
17
17
|
*/
|
|
18
|
-
declare const VERSION = "0.
|
|
18
|
+
declare const VERSION = "0.26.0";
|
|
19
19
|
|
|
20
20
|
/** `fetch` con la firma que usamos. Se puede sustituir en tests o para meter un proxy. */
|
|
21
21
|
type FetchLike = (input: string, init: RequestInit) => Promise<Response>;
|
|
@@ -2205,8 +2205,24 @@ declare function guessContentType(filename: string): string | undefined;
|
|
|
2205
2205
|
* fichero grande falla a mitad de subida con un 802, un 803 o un 804 — no antes de empezar.
|
|
2206
2206
|
*/
|
|
2207
2207
|
|
|
2208
|
+
/**
|
|
2209
|
+
* Si un fichero está hecho o retocado con IA. **Ausente = que decida el fichero**: si trae la marca
|
|
2210
|
+
* en sus metadatos (un manifiesto C2PA o el XMP de IPTC que dejan Gemini, ChatGPT o Firefly), el
|
|
2211
|
+
* servidor lo guarda marcado como `detected`. `true` lo declara (`source: "user"`) y `false` dice
|
|
2212
|
+
* que no lo es aunque el fichero diga otra cosa.
|
|
2213
|
+
*
|
|
2214
|
+
* Por eso no mandes `false` «por defecto»: taparías la marca que traiga el fichero.
|
|
2215
|
+
*/
|
|
2216
|
+
interface AiDeclaration {
|
|
2217
|
+
ai_generated?: boolean | undefined;
|
|
2218
|
+
/** La herramienta, si la sabes («ElevenLabs»). Hasta 100 caracteres. */
|
|
2219
|
+
ai_tool?: string | undefined;
|
|
2220
|
+
}
|
|
2221
|
+
/** Lo que se sube: el fichero y, si quieres, si está hecho con IA. */
|
|
2222
|
+
interface UploadInput extends FileInput, AiDeclaration {
|
|
2223
|
+
}
|
|
2208
2224
|
/** Un fichero de una integración que se quiere traer a la biblioteca. */
|
|
2209
|
-
interface ImportFileInput {
|
|
2225
|
+
interface ImportFileInput extends AiDeclaration {
|
|
2210
2226
|
/** Identificador del fichero en el proveedor (el id del fichero en Drive). */
|
|
2211
2227
|
external_id: string;
|
|
2212
2228
|
/** Nombre que enseñó el selector. Se usa para el nombre visible y para decir cuál falló. */
|
|
@@ -2230,18 +2246,22 @@ interface ImportResult {
|
|
|
2230
2246
|
uploads: Upload[];
|
|
2231
2247
|
errors: ImportError[];
|
|
2232
2248
|
}
|
|
2233
|
-
/**
|
|
2234
|
-
|
|
2249
|
+
/**
|
|
2250
|
+
* Lo que un upload deja cambiar: la portada de un vídeo y si está hecho con IA. Sólo cambia lo
|
|
2251
|
+
* que mandes.
|
|
2252
|
+
*
|
|
2253
|
+
* `ai_generated: false` quita la marca, salvo en lo que generó el planificador de PlanVortex
|
|
2254
|
+
* (`source: "planvortex"`), que no se puede desmarcar (error `811`).
|
|
2255
|
+
*/
|
|
2256
|
+
interface UploadUpdate extends AiDeclaration {
|
|
2235
2257
|
/**
|
|
2236
2258
|
* Identificador de OTRO upload, que tiene que ser una imagen, para usarlo de portada.
|
|
2237
2259
|
* Reemplazar una portada borra la anterior.
|
|
2238
2260
|
*/
|
|
2239
2261
|
cover_image?: string | undefined;
|
|
2240
2262
|
/**
|
|
2241
|
-
* Momento del vídeo, en milisegundos, que se usa de fotograma de portada.
|
|
2242
|
-
*
|
|
2243
|
-
* CUIDADO: **se escribe siempre**, así que omitirlo borra el valor guardado. Si sólo quieres
|
|
2244
|
-
* cambiar `cover_image`, manda también el `cover_offset` que ya tenía.
|
|
2263
|
+
* Momento del vídeo, en milisegundos, que se usa de fotograma de portada. Sólo cambia si lo
|
|
2264
|
+
* mandas (hasta diciembre de 2026 se escribía siempre y omitirlo lo borraba).
|
|
2245
2265
|
*/
|
|
2246
2266
|
cover_offset?: number | undefined;
|
|
2247
2267
|
}
|
|
@@ -2254,9 +2274,14 @@ declare class UploadsResource extends Resource {
|
|
|
2254
2274
|
* ```ts
|
|
2255
2275
|
* await pv.uploads.create(orgId, { file: "./hogaza.jpg" });
|
|
2256
2276
|
* await pv.uploads.create(orgId, { file: bytes, filename: "hogaza.jpg" });
|
|
2277
|
+
* // hecho con IA: TikTok lo recibe como `is_aigc`
|
|
2278
|
+
* await pv.uploads.create(orgId, { file: "./promo.mp4", ai_generated: true, ai_tool: "ElevenLabs" });
|
|
2257
2279
|
* ```
|
|
2280
|
+
*
|
|
2281
|
+
* Sin `ai_generated`, decide el fichero: si trae la marca de IA en sus metadatos, vuelve con
|
|
2282
|
+
* `ai_generated.source === "detected"` (ver {@link AiDeclaration}).
|
|
2258
2283
|
*/
|
|
2259
|
-
create(idOrganization: string, input:
|
|
2284
|
+
create(idOrganization: string, input: UploadInput, options?: RequestOptions): Promise<Upload>;
|
|
2260
2285
|
/**
|
|
2261
2286
|
* Los ficheros de la biblioteca.
|
|
2262
2287
|
*
|
|
@@ -2268,7 +2293,14 @@ declare class UploadsResource extends Resource {
|
|
|
2268
2293
|
iterate(idOrganization: string, options?: PageOptions & RequestOptions): AsyncGenerator<Upload>;
|
|
2269
2294
|
/** Un fichero. Pídelo de nuevo cuando necesites un `public_path` vigente. */
|
|
2270
2295
|
get(idOrganization: string, idUpload: string, options?: RequestOptions): Promise<Upload>;
|
|
2271
|
-
/**
|
|
2296
|
+
/**
|
|
2297
|
+
* Cambia la portada de un vídeo o la marca de IA. Marcar o desmarcar recalcula también
|
|
2298
|
+
* `ai_generated.image` de las publicaciones que lo usan y aún no han salido.
|
|
2299
|
+
*
|
|
2300
|
+
* ```ts
|
|
2301
|
+
* await pv.uploads.update(orgId, uploadId, { ai_generated: true });
|
|
2302
|
+
* ```
|
|
2303
|
+
*/
|
|
2272
2304
|
update(idOrganization: string, idUpload: string, body: UploadUpdate, options?: RequestOptions): Promise<Upload>;
|
|
2273
2305
|
/**
|
|
2274
2306
|
* Borra un fichero.
|
|
@@ -2285,8 +2317,11 @@ declare class UploadsResource extends Resource {
|
|
|
2285
2317
|
* La respuesta es PARCIAL a propósito: mira `errors` aunque `uploads` traiga algo — de seis
|
|
2286
2318
|
* ficheros pueden entrar cuatro. Un `2204` significa que el proveedor no da los bytes: un
|
|
2287
2319
|
* documento nativo de Google no tiene fichero que descargar.
|
|
2320
|
+
*
|
|
2321
|
+
* `ai_generated` y `ai_tool` en `options` valen para toda la tanda; cada fichero puede traer
|
|
2322
|
+
* los suyos, que mandan.
|
|
2288
2323
|
*/
|
|
2289
|
-
import(idOrganization: string, idIntegration: string, files: readonly ImportFileInput[], options?: RequestOptions): Promise<ImportResult>;
|
|
2324
|
+
import(idOrganization: string, idIntegration: string, files: readonly ImportFileInput[], options?: AiDeclaration & RequestOptions): Promise<ImportResult>;
|
|
2290
2325
|
private path;
|
|
2291
2326
|
}
|
|
2292
2327
|
|
|
@@ -2396,4 +2431,4 @@ interface AuthProvider {
|
|
|
2396
2431
|
/** Margen con el que se pide un token nuevo antes de que caduque el que hay. */
|
|
2397
2432
|
declare const TOKEN_REFRESH_MARGIN_MS = 60000;
|
|
2398
2433
|
|
|
2399
|
-
export { Account, type AccountCapability, type AccountDestinationOptions, type AccountListOptions, AccountMetrics, type AccountMetricsOptions, AccountSelection, AccountsResource, AiContext, AiPlan, AiPlanCreateRequest, AiPlanCreateResult, type AiPlanListOptions, type AiPlanRegenerateResult, type AiPlanRegenerateTarget, AiPlanResults, type AiPlanResultsOptions, AiPlanResultsSort, AiPlansResource, AiSettings, AppsResource, AspectRatiosByNetwork, type AuthProvider, CatalogResource, type ChildOrganizationListOptions, Client, ClientApp, ClientAppInput, type ClientCredentialsToken, type ClientListOptions, ClientWithOrganizations, ClientsResource, Comment, CommentActions, type CommentListOptions, CommentNetwork, CommentReplyResult, CommentThread, type CommentThreadOptions, type CommentUpdate, CommentsResource, type ConnectCallbackParams, ConnectLink, type ConnectLinkOptions, type ConnectLinksOptions, ConnectResult, ConnectSession, ConnectToken, type ConnectTokenOptions, Contact, ContactCreate, ContactExtraData, type ContactExtraFilter, type ContactListOptions, ContactUpdate, ContactsResource, Conversation, type ConversationGroupBy, ConversationRead, ConversationTotals, type ConversationTotalsOptions, DEFAULT_PAGE_SIZE, DEFAULT_RETRY, DEFAULT_TIMEOUT_MS, Dashboard, DashboardMetricsResult, DashboardResource, Destination, type DownloadedFile, EnableResult, type FetchLike, type FileInput, type FileSource, type HttpHooks, type HttpMethod, type HttpRequest, type HttpResponse, type ImportError, type ImportFileInput, type ImportResult, Integration, IntegrationCatalogPage, IntegrationConnectRequest, type IntegrationListOptions, IntegrationPickerConfig, type IntegrationProductsOptions, IntegrationProvider, IntegrationProviderName, IntegrationUpdate, IntegrationsResource, MAX_PAGES, Message, MessageInput, MessageTemplate, type MessageTemplateResult, MessagesResource, MetricName, type MetricsGroupBy, type MetricsOptions, Organization, type OrganizationInput, type OrganizationListOptions, type OrganizationOptions, type OrganizationPlanInput, OrganizationsResource, PLANVORTEX_API_URL, type PageOptions, Paginated, PersistentMenu, PlanData, PlanUse, PlanUseData, PlanVortex, type PlanVortexOptions, PlannerTemplate, PlannerTemplateName, Product, ProductCatalog, ProductCatalogInput, ProductInput, ProductsResource, Publication, PublicationInput, PublicationLimits, type PublicationListOptions, type PublicationRetryResult, PublicationState, PublicationStats, PublicationStatsHistory, PublicationsResource, type PublicationsStatsOptions, PublicationsStatsResult, PublicationsSummaryResult, PublishSettings, type QueryValue, type RangeOptions, type RequestInfo, type RequestOptions, type RequestSender, type ResponseInfo, type RetryConfig, type RetryInfo, SocialCapabilities, SocialLimits, SocialNetwork, TOKEN_REFRESH_MARGIN_MS, type TopPublicationsOptions, TopPublicationsResult, Upload, type UploadUpdate, UploadsResource, VERSION, guessContentType };
|
|
2434
|
+
export { Account, type AccountCapability, type AccountDestinationOptions, type AccountListOptions, AccountMetrics, type AccountMetricsOptions, AccountSelection, AccountsResource, AiContext, type AiDeclaration, AiPlan, AiPlanCreateRequest, AiPlanCreateResult, type AiPlanListOptions, type AiPlanRegenerateResult, type AiPlanRegenerateTarget, AiPlanResults, type AiPlanResultsOptions, AiPlanResultsSort, AiPlansResource, AiSettings, AppsResource, AspectRatiosByNetwork, type AuthProvider, CatalogResource, type ChildOrganizationListOptions, Client, ClientApp, ClientAppInput, type ClientCredentialsToken, type ClientListOptions, ClientWithOrganizations, ClientsResource, Comment, CommentActions, type CommentListOptions, CommentNetwork, CommentReplyResult, CommentThread, type CommentThreadOptions, type CommentUpdate, CommentsResource, type ConnectCallbackParams, ConnectLink, type ConnectLinkOptions, type ConnectLinksOptions, ConnectResult, ConnectSession, ConnectToken, type ConnectTokenOptions, Contact, ContactCreate, ContactExtraData, type ContactExtraFilter, type ContactListOptions, ContactUpdate, ContactsResource, Conversation, type ConversationGroupBy, ConversationRead, ConversationTotals, type ConversationTotalsOptions, DEFAULT_PAGE_SIZE, DEFAULT_RETRY, DEFAULT_TIMEOUT_MS, Dashboard, DashboardMetricsResult, DashboardResource, Destination, type DownloadedFile, EnableResult, type FetchLike, type FileInput, type FileSource, type HttpHooks, type HttpMethod, type HttpRequest, type HttpResponse, type ImportError, type ImportFileInput, type ImportResult, Integration, IntegrationCatalogPage, IntegrationConnectRequest, type IntegrationListOptions, IntegrationPickerConfig, type IntegrationProductsOptions, IntegrationProvider, IntegrationProviderName, IntegrationUpdate, IntegrationsResource, MAX_PAGES, Message, MessageInput, MessageTemplate, type MessageTemplateResult, MessagesResource, MetricName, type MetricsGroupBy, type MetricsOptions, Organization, type OrganizationInput, type OrganizationListOptions, type OrganizationOptions, type OrganizationPlanInput, OrganizationsResource, PLANVORTEX_API_URL, type PageOptions, Paginated, PersistentMenu, PlanData, PlanUse, PlanUseData, PlanVortex, type PlanVortexOptions, PlannerTemplate, PlannerTemplateName, Product, ProductCatalog, ProductCatalogInput, ProductInput, ProductsResource, Publication, PublicationInput, PublicationLimits, type PublicationListOptions, type PublicationRetryResult, PublicationState, PublicationStats, PublicationStatsHistory, PublicationsResource, type PublicationsStatsOptions, PublicationsStatsResult, PublicationsSummaryResult, PublishSettings, type QueryValue, type RangeOptions, type RequestInfo, type RequestOptions, type RequestSender, type ResponseInfo, type RetryConfig, type RetryInfo, SocialCapabilities, SocialLimits, SocialNetwork, TOKEN_REFRESH_MARGIN_MS, type TopPublicationsOptions, TopPublicationsResult, Upload, type UploadInput, type UploadUpdate, UploadsResource, VERSION, guessContentType };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as Paginated, S as SocialNetwork, C as ConnectLink, a as ConnectResult, E as EnableResult, b as ConnectSession, A as Account, c as AccountMetrics, D as Destination, d as PublishSettings, e as PersistentMenu, f as Dashboard, M as MetricName, g as DashboardMetricsResult, h as PublicationsSummaryResult, T as TopPublicationsResult, i as PublicationsStatsResult, j as PlanUse, k as Publication, l as AiPlanResultsSort, m as PlannerTemplateName, n as AiPlanCreateRequest, o as AiPlanCreateResult, p as AiPlan, q as AiPlanResults, r as ClientApp, s as ClientAppInput, t as SocialCapabilities, u as CommentActions, v as SocialLimits, w as PublicationLimits, x as AspectRatiosByNetwork, y as PlannerTemplate, z as CommentNetwork, B as Comment, F as CommentThread, G as CommentReplyResult, H as ContactExtraData, I as Contact, J as ContactCreate, K as ContactUpdate, L as IntegrationProviderName, N as IntegrationProvider, O as Integration, Q as IntegrationConnectRequest, R as IntegrationUpdate, U as IntegrationPickerConfig, V as IntegrationCatalogPage, W as MessageTemplate, X as Conversation, Y as ConversationTotals, Z as Message, _ as MessageInput, $ as ConversationRead, a0 as Client, a1 as Organization, a2 as AiSettings, a3 as ClientWithOrganizations, a4 as AccountSelection, a5 as PlanData, a6 as PlanUseData, a7 as ConnectToken, a8 as AiContext, a9 as SocialCredentialsInput, aa as Product, ab as ProductInput, ac as ProductCatalog, ad as ProductCatalogInput, ae as PublicationInput, af as PublicationState, ag as PublicationStats, ah as PublicationStatsHistory, ai as Upload } from './index-
|
|
2
|
-
export { aj as AccountError, ak as AccountMetricRow, al as AccountStateChange, am as AccountWebhookChangeBase, an as AccountWithError, ao as AiImageOrigin, ap as AiPlanCostEstimate, aq as AiPlanDestination, ar as AiPlanError, as as AiPlanNotice, at as AiPlanOptions, au as AiPlanOptionsInput, av as AiPlanResult, aw as AiPlanResultsGroup, ax as AiPlanResultsTemplateGroup, ay as AiPlanSource, az as AiPlanSourceImageInput, aA as AiPlanSourceInput, aB as AiPlanSourceProduct, aC as AiPlanState, aD as ApiErrorBody, aE as AspectRatios, aF as AuthError, aG as ClientPlan, aH as CommentAuthor, aI as CommentChange, aJ as ConnectSessionAccount, aK as ContactChannel, aL as ContactError, aM as DashboardAiPlanRef, aN as DashboardPublicationRef, aO as DashboardRange, aP as EngagementBase, aQ as FileError, aR as FileFormat, aS as FileProperties, aT as FileType, aU as IntegrationCatalogProduct, aV as IntegrationConfig, aW as IntegrationError, aX as IntegrationErrorChange, aY as IntegrationFormField, aZ as MessageChange, a_ as MessageEchoChange, a$ as MessageOptions, b0 as MessageType, b1 as MessagingError, b2 as MetricRow, b3 as NO_ERROR_CODE, b4 as OpenApiComponents, b5 as OpenApiOperations, b6 as OpenApiPaths, b7 as OpenApiWebhooks, b8 as OpenEnum, b9 as OrganizationError, ba as PLANVORTEX_ERROR_RANGES, bb as PlanLimitError, bc as PlanVortexAuthenticationError, bd as PlanVortexConfigError, be as PlanVortexConnectionError, bf as PlanVortexError, bg as PlanVortexErrorOptions, bh as PlanVortexErrorRange, bi as PlannerTemplateField, bj as PlannerTemplateFieldType, bk as ProductError, bl as PublicationAiGenerated, bm as PublicationDestination, bn as PublicationError, bo as PublicationErrorDetail, bp as PublicationMetrics, bq as PublicationPending, br as PublicationStatsPoint, bs as PublicationType, bt as PublicationsSummary, bu as RssConfig, bv as SocialAuthorizationMethod, bw as SocialCredentials, bx as SocialIdentifier, by as SocialIdentifierInput, bz as SocialLimitsMap, bA as TOKEN_ERROR_CODES, bB as TopPublication, bC as UnknownWebhookChange, bD as UserError, bE as WebhookAlgorithm, bF as WebhookChange, bG as WebhookEvent, bH as WithAccount, bI as WithPublication, bJ as WooCommerceConnectRequest, bK as account, bL as accountId, bM as errorFamilyForCode, bN as isPlanVortexError, bO as isTokenError, bP as messageContact, bQ as messageContactId, bR as messageDirection, bS as messageFileIds, bT as messageFiles, bU as publication, bV as publicationId } from './index-
|
|
1
|
+
import { P as Paginated, S as SocialNetwork, C as ConnectLink, a as ConnectResult, E as EnableResult, b as ConnectSession, A as Account, c as AccountMetrics, D as Destination, d as PublishSettings, e as PersistentMenu, f as Dashboard, M as MetricName, g as DashboardMetricsResult, h as PublicationsSummaryResult, T as TopPublicationsResult, i as PublicationsStatsResult, j as PlanUse, k as Publication, l as AiPlanResultsSort, m as PlannerTemplateName, n as AiPlanCreateRequest, o as AiPlanCreateResult, p as AiPlan, q as AiPlanResults, r as ClientApp, s as ClientAppInput, t as SocialCapabilities, u as CommentActions, v as SocialLimits, w as PublicationLimits, x as AspectRatiosByNetwork, y as PlannerTemplate, z as CommentNetwork, B as Comment, F as CommentThread, G as CommentReplyResult, H as ContactExtraData, I as Contact, J as ContactCreate, K as ContactUpdate, L as IntegrationProviderName, N as IntegrationProvider, O as Integration, Q as IntegrationConnectRequest, R as IntegrationUpdate, U as IntegrationPickerConfig, V as IntegrationCatalogPage, W as MessageTemplate, X as Conversation, Y as ConversationTotals, Z as Message, _ as MessageInput, $ as ConversationRead, a0 as Client, a1 as Organization, a2 as AiSettings, a3 as ClientWithOrganizations, a4 as AccountSelection, a5 as PlanData, a6 as PlanUseData, a7 as ConnectToken, a8 as AiContext, a9 as SocialCredentialsInput, aa as Product, ab as ProductInput, ac as ProductCatalog, ad as ProductCatalogInput, ae as PublicationInput, af as PublicationState, ag as PublicationStats, ah as PublicationStatsHistory, ai as Upload } from './index-C5hlx3fK.js';
|
|
2
|
+
export { aj as AccountError, ak as AccountMetricRow, al as AccountStateChange, am as AccountWebhookChangeBase, an as AccountWithError, ao as AiImageOrigin, ap as AiPlanCostEstimate, aq as AiPlanDestination, ar as AiPlanError, as as AiPlanNotice, at as AiPlanOptions, au as AiPlanOptionsInput, av as AiPlanResult, aw as AiPlanResultsGroup, ax as AiPlanResultsTemplateGroup, ay as AiPlanSource, az as AiPlanSourceImageInput, aA as AiPlanSourceInput, aB as AiPlanSourceProduct, aC as AiPlanState, aD as ApiErrorBody, aE as AspectRatios, aF as AuthError, aG as ClientPlan, aH as CommentAuthor, aI as CommentChange, aJ as ConnectSessionAccount, aK as ContactChannel, aL as ContactError, aM as DashboardAiPlanRef, aN as DashboardPublicationRef, aO as DashboardRange, aP as EngagementBase, aQ as FileError, aR as FileFormat, aS as FileProperties, aT as FileType, aU as IntegrationCatalogProduct, aV as IntegrationConfig, aW as IntegrationError, aX as IntegrationErrorChange, aY as IntegrationFormField, aZ as MessageChange, a_ as MessageEchoChange, a$ as MessageOptions, b0 as MessageType, b1 as MessagingError, b2 as MetricRow, b3 as NO_ERROR_CODE, b4 as OpenApiComponents, b5 as OpenApiOperations, b6 as OpenApiPaths, b7 as OpenApiWebhooks, b8 as OpenEnum, b9 as OrganizationError, ba as PLANVORTEX_ERROR_RANGES, bb as PlanLimitError, bc as PlanVortexAuthenticationError, bd as PlanVortexConfigError, be as PlanVortexConnectionError, bf as PlanVortexError, bg as PlanVortexErrorOptions, bh as PlanVortexErrorRange, bi as PlannerTemplateField, bj as PlannerTemplateFieldType, bk as ProductError, bl as PublicationAiGenerated, bm as PublicationDestination, bn as PublicationError, bo as PublicationErrorDetail, bp as PublicationMetrics, bq as PublicationPending, br as PublicationStatsPoint, bs as PublicationType, bt as PublicationsSummary, bu as RssConfig, bv as SocialAuthorizationMethod, bw as SocialCredentials, bx as SocialIdentifier, by as SocialIdentifierInput, bz as SocialLimitsMap, bA as TOKEN_ERROR_CODES, bB as TopPublication, bC as UnknownWebhookChange, bD as UserError, bE as WebhookAlgorithm, bF as WebhookChange, bG as WebhookEvent, bH as WithAccount, bI as WithPublication, bJ as WooCommerceConnectRequest, bK as account, bL as accountId, bM as errorFamilyForCode, bN as isPlanVortexError, bO as isTokenError, bP as messageContact, bQ as messageContactId, bR as messageDirection, bS as messageFileIds, bT as messageFiles, bU as publication, bV as publicationId } from './index-C5hlx3fK.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Las dos constantes que todo lo demás necesita. Viven aparte de `index.ts` para que `client.ts`
|
|
@@ -15,7 +15,7 @@ declare const PLANVORTEX_API_URL = "https://api.planvortex.com/v1.0.0";
|
|
|
15
15
|
* de ejecución obliga a empaquetarlo y se rompe distinto en ESM y en CJS. La mantiene sincronizada
|
|
16
16
|
* un test.
|
|
17
17
|
*/
|
|
18
|
-
declare const VERSION = "0.
|
|
18
|
+
declare const VERSION = "0.26.0";
|
|
19
19
|
|
|
20
20
|
/** `fetch` con la firma que usamos. Se puede sustituir en tests o para meter un proxy. */
|
|
21
21
|
type FetchLike = (input: string, init: RequestInit) => Promise<Response>;
|
|
@@ -2205,8 +2205,24 @@ declare function guessContentType(filename: string): string | undefined;
|
|
|
2205
2205
|
* fichero grande falla a mitad de subida con un 802, un 803 o un 804 — no antes de empezar.
|
|
2206
2206
|
*/
|
|
2207
2207
|
|
|
2208
|
+
/**
|
|
2209
|
+
* Si un fichero está hecho o retocado con IA. **Ausente = que decida el fichero**: si trae la marca
|
|
2210
|
+
* en sus metadatos (un manifiesto C2PA o el XMP de IPTC que dejan Gemini, ChatGPT o Firefly), el
|
|
2211
|
+
* servidor lo guarda marcado como `detected`. `true` lo declara (`source: "user"`) y `false` dice
|
|
2212
|
+
* que no lo es aunque el fichero diga otra cosa.
|
|
2213
|
+
*
|
|
2214
|
+
* Por eso no mandes `false` «por defecto»: taparías la marca que traiga el fichero.
|
|
2215
|
+
*/
|
|
2216
|
+
interface AiDeclaration {
|
|
2217
|
+
ai_generated?: boolean | undefined;
|
|
2218
|
+
/** La herramienta, si la sabes («ElevenLabs»). Hasta 100 caracteres. */
|
|
2219
|
+
ai_tool?: string | undefined;
|
|
2220
|
+
}
|
|
2221
|
+
/** Lo que se sube: el fichero y, si quieres, si está hecho con IA. */
|
|
2222
|
+
interface UploadInput extends FileInput, AiDeclaration {
|
|
2223
|
+
}
|
|
2208
2224
|
/** Un fichero de una integración que se quiere traer a la biblioteca. */
|
|
2209
|
-
interface ImportFileInput {
|
|
2225
|
+
interface ImportFileInput extends AiDeclaration {
|
|
2210
2226
|
/** Identificador del fichero en el proveedor (el id del fichero en Drive). */
|
|
2211
2227
|
external_id: string;
|
|
2212
2228
|
/** Nombre que enseñó el selector. Se usa para el nombre visible y para decir cuál falló. */
|
|
@@ -2230,18 +2246,22 @@ interface ImportResult {
|
|
|
2230
2246
|
uploads: Upload[];
|
|
2231
2247
|
errors: ImportError[];
|
|
2232
2248
|
}
|
|
2233
|
-
/**
|
|
2234
|
-
|
|
2249
|
+
/**
|
|
2250
|
+
* Lo que un upload deja cambiar: la portada de un vídeo y si está hecho con IA. Sólo cambia lo
|
|
2251
|
+
* que mandes.
|
|
2252
|
+
*
|
|
2253
|
+
* `ai_generated: false` quita la marca, salvo en lo que generó el planificador de PlanVortex
|
|
2254
|
+
* (`source: "planvortex"`), que no se puede desmarcar (error `811`).
|
|
2255
|
+
*/
|
|
2256
|
+
interface UploadUpdate extends AiDeclaration {
|
|
2235
2257
|
/**
|
|
2236
2258
|
* Identificador de OTRO upload, que tiene que ser una imagen, para usarlo de portada.
|
|
2237
2259
|
* Reemplazar una portada borra la anterior.
|
|
2238
2260
|
*/
|
|
2239
2261
|
cover_image?: string | undefined;
|
|
2240
2262
|
/**
|
|
2241
|
-
* Momento del vídeo, en milisegundos, que se usa de fotograma de portada.
|
|
2242
|
-
*
|
|
2243
|
-
* CUIDADO: **se escribe siempre**, así que omitirlo borra el valor guardado. Si sólo quieres
|
|
2244
|
-
* cambiar `cover_image`, manda también el `cover_offset` que ya tenía.
|
|
2263
|
+
* Momento del vídeo, en milisegundos, que se usa de fotograma de portada. Sólo cambia si lo
|
|
2264
|
+
* mandas (hasta diciembre de 2026 se escribía siempre y omitirlo lo borraba).
|
|
2245
2265
|
*/
|
|
2246
2266
|
cover_offset?: number | undefined;
|
|
2247
2267
|
}
|
|
@@ -2254,9 +2274,14 @@ declare class UploadsResource extends Resource {
|
|
|
2254
2274
|
* ```ts
|
|
2255
2275
|
* await pv.uploads.create(orgId, { file: "./hogaza.jpg" });
|
|
2256
2276
|
* await pv.uploads.create(orgId, { file: bytes, filename: "hogaza.jpg" });
|
|
2277
|
+
* // hecho con IA: TikTok lo recibe como `is_aigc`
|
|
2278
|
+
* await pv.uploads.create(orgId, { file: "./promo.mp4", ai_generated: true, ai_tool: "ElevenLabs" });
|
|
2257
2279
|
* ```
|
|
2280
|
+
*
|
|
2281
|
+
* Sin `ai_generated`, decide el fichero: si trae la marca de IA en sus metadatos, vuelve con
|
|
2282
|
+
* `ai_generated.source === "detected"` (ver {@link AiDeclaration}).
|
|
2258
2283
|
*/
|
|
2259
|
-
create(idOrganization: string, input:
|
|
2284
|
+
create(idOrganization: string, input: UploadInput, options?: RequestOptions): Promise<Upload>;
|
|
2260
2285
|
/**
|
|
2261
2286
|
* Los ficheros de la biblioteca.
|
|
2262
2287
|
*
|
|
@@ -2268,7 +2293,14 @@ declare class UploadsResource extends Resource {
|
|
|
2268
2293
|
iterate(idOrganization: string, options?: PageOptions & RequestOptions): AsyncGenerator<Upload>;
|
|
2269
2294
|
/** Un fichero. Pídelo de nuevo cuando necesites un `public_path` vigente. */
|
|
2270
2295
|
get(idOrganization: string, idUpload: string, options?: RequestOptions): Promise<Upload>;
|
|
2271
|
-
/**
|
|
2296
|
+
/**
|
|
2297
|
+
* Cambia la portada de un vídeo o la marca de IA. Marcar o desmarcar recalcula también
|
|
2298
|
+
* `ai_generated.image` de las publicaciones que lo usan y aún no han salido.
|
|
2299
|
+
*
|
|
2300
|
+
* ```ts
|
|
2301
|
+
* await pv.uploads.update(orgId, uploadId, { ai_generated: true });
|
|
2302
|
+
* ```
|
|
2303
|
+
*/
|
|
2272
2304
|
update(idOrganization: string, idUpload: string, body: UploadUpdate, options?: RequestOptions): Promise<Upload>;
|
|
2273
2305
|
/**
|
|
2274
2306
|
* Borra un fichero.
|
|
@@ -2285,8 +2317,11 @@ declare class UploadsResource extends Resource {
|
|
|
2285
2317
|
* La respuesta es PARCIAL a propósito: mira `errors` aunque `uploads` traiga algo — de seis
|
|
2286
2318
|
* ficheros pueden entrar cuatro. Un `2204` significa que el proveedor no da los bytes: un
|
|
2287
2319
|
* documento nativo de Google no tiene fichero que descargar.
|
|
2320
|
+
*
|
|
2321
|
+
* `ai_generated` y `ai_tool` en `options` valen para toda la tanda; cada fichero puede traer
|
|
2322
|
+
* los suyos, que mandan.
|
|
2288
2323
|
*/
|
|
2289
|
-
import(idOrganization: string, idIntegration: string, files: readonly ImportFileInput[], options?: RequestOptions): Promise<ImportResult>;
|
|
2324
|
+
import(idOrganization: string, idIntegration: string, files: readonly ImportFileInput[], options?: AiDeclaration & RequestOptions): Promise<ImportResult>;
|
|
2290
2325
|
private path;
|
|
2291
2326
|
}
|
|
2292
2327
|
|
|
@@ -2396,4 +2431,4 @@ interface AuthProvider {
|
|
|
2396
2431
|
/** Margen con el que se pide un token nuevo antes de que caduque el que hay. */
|
|
2397
2432
|
declare const TOKEN_REFRESH_MARGIN_MS = 60000;
|
|
2398
2433
|
|
|
2399
|
-
export { Account, type AccountCapability, type AccountDestinationOptions, type AccountListOptions, AccountMetrics, type AccountMetricsOptions, AccountSelection, AccountsResource, AiContext, AiPlan, AiPlanCreateRequest, AiPlanCreateResult, type AiPlanListOptions, type AiPlanRegenerateResult, type AiPlanRegenerateTarget, AiPlanResults, type AiPlanResultsOptions, AiPlanResultsSort, AiPlansResource, AiSettings, AppsResource, AspectRatiosByNetwork, type AuthProvider, CatalogResource, type ChildOrganizationListOptions, Client, ClientApp, ClientAppInput, type ClientCredentialsToken, type ClientListOptions, ClientWithOrganizations, ClientsResource, Comment, CommentActions, type CommentListOptions, CommentNetwork, CommentReplyResult, CommentThread, type CommentThreadOptions, type CommentUpdate, CommentsResource, type ConnectCallbackParams, ConnectLink, type ConnectLinkOptions, type ConnectLinksOptions, ConnectResult, ConnectSession, ConnectToken, type ConnectTokenOptions, Contact, ContactCreate, ContactExtraData, type ContactExtraFilter, type ContactListOptions, ContactUpdate, ContactsResource, Conversation, type ConversationGroupBy, ConversationRead, ConversationTotals, type ConversationTotalsOptions, DEFAULT_PAGE_SIZE, DEFAULT_RETRY, DEFAULT_TIMEOUT_MS, Dashboard, DashboardMetricsResult, DashboardResource, Destination, type DownloadedFile, EnableResult, type FetchLike, type FileInput, type FileSource, type HttpHooks, type HttpMethod, type HttpRequest, type HttpResponse, type ImportError, type ImportFileInput, type ImportResult, Integration, IntegrationCatalogPage, IntegrationConnectRequest, type IntegrationListOptions, IntegrationPickerConfig, type IntegrationProductsOptions, IntegrationProvider, IntegrationProviderName, IntegrationUpdate, IntegrationsResource, MAX_PAGES, Message, MessageInput, MessageTemplate, type MessageTemplateResult, MessagesResource, MetricName, type MetricsGroupBy, type MetricsOptions, Organization, type OrganizationInput, type OrganizationListOptions, type OrganizationOptions, type OrganizationPlanInput, OrganizationsResource, PLANVORTEX_API_URL, type PageOptions, Paginated, PersistentMenu, PlanData, PlanUse, PlanUseData, PlanVortex, type PlanVortexOptions, PlannerTemplate, PlannerTemplateName, Product, ProductCatalog, ProductCatalogInput, ProductInput, ProductsResource, Publication, PublicationInput, PublicationLimits, type PublicationListOptions, type PublicationRetryResult, PublicationState, PublicationStats, PublicationStatsHistory, PublicationsResource, type PublicationsStatsOptions, PublicationsStatsResult, PublicationsSummaryResult, PublishSettings, type QueryValue, type RangeOptions, type RequestInfo, type RequestOptions, type RequestSender, type ResponseInfo, type RetryConfig, type RetryInfo, SocialCapabilities, SocialLimits, SocialNetwork, TOKEN_REFRESH_MARGIN_MS, type TopPublicationsOptions, TopPublicationsResult, Upload, type UploadUpdate, UploadsResource, VERSION, guessContentType };
|
|
2434
|
+
export { Account, type AccountCapability, type AccountDestinationOptions, type AccountListOptions, AccountMetrics, type AccountMetricsOptions, AccountSelection, AccountsResource, AiContext, type AiDeclaration, AiPlan, AiPlanCreateRequest, AiPlanCreateResult, type AiPlanListOptions, type AiPlanRegenerateResult, type AiPlanRegenerateTarget, AiPlanResults, type AiPlanResultsOptions, AiPlanResultsSort, AiPlansResource, AiSettings, AppsResource, AspectRatiosByNetwork, type AuthProvider, CatalogResource, type ChildOrganizationListOptions, Client, ClientApp, ClientAppInput, type ClientCredentialsToken, type ClientListOptions, ClientWithOrganizations, ClientsResource, Comment, CommentActions, type CommentListOptions, CommentNetwork, CommentReplyResult, CommentThread, type CommentThreadOptions, type CommentUpdate, CommentsResource, type ConnectCallbackParams, ConnectLink, type ConnectLinkOptions, type ConnectLinksOptions, ConnectResult, ConnectSession, ConnectToken, type ConnectTokenOptions, Contact, ContactCreate, ContactExtraData, type ContactExtraFilter, type ContactListOptions, ContactUpdate, ContactsResource, Conversation, type ConversationGroupBy, ConversationRead, ConversationTotals, type ConversationTotalsOptions, DEFAULT_PAGE_SIZE, DEFAULT_RETRY, DEFAULT_TIMEOUT_MS, Dashboard, DashboardMetricsResult, DashboardResource, Destination, type DownloadedFile, EnableResult, type FetchLike, type FileInput, type FileSource, type HttpHooks, type HttpMethod, type HttpRequest, type HttpResponse, type ImportError, type ImportFileInput, type ImportResult, Integration, IntegrationCatalogPage, IntegrationConnectRequest, type IntegrationListOptions, IntegrationPickerConfig, type IntegrationProductsOptions, IntegrationProvider, IntegrationProviderName, IntegrationUpdate, IntegrationsResource, MAX_PAGES, Message, MessageInput, MessageTemplate, type MessageTemplateResult, MessagesResource, MetricName, type MetricsGroupBy, type MetricsOptions, Organization, type OrganizationInput, type OrganizationListOptions, type OrganizationOptions, type OrganizationPlanInput, OrganizationsResource, PLANVORTEX_API_URL, type PageOptions, Paginated, PersistentMenu, PlanData, PlanUse, PlanUseData, PlanVortex, type PlanVortexOptions, PlannerTemplate, PlannerTemplateName, Product, ProductCatalog, ProductCatalogInput, ProductInput, ProductsResource, Publication, PublicationInput, PublicationLimits, type PublicationListOptions, type PublicationRetryResult, PublicationState, PublicationStats, PublicationStatsHistory, PublicationsResource, type PublicationsStatsOptions, PublicationsStatsResult, PublicationsSummaryResult, PublishSettings, type QueryValue, type RangeOptions, type RequestInfo, type RequestOptions, type RequestSender, type ResponseInfo, type RetryConfig, type RetryInfo, SocialCapabilities, SocialLimits, SocialNetwork, TOKEN_REFRESH_MARGIN_MS, type TopPublicationsOptions, TopPublicationsResult, Upload, type UploadInput, type UploadUpdate, UploadsResource, VERSION, guessContentType };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createErrorFromResponse, NO_ERROR_CODE, PlanVortexError, PlanVortexConfigError, isTokenError, PlanVortexConnectionError, PlanVortexAuthenticationError, isPlanVortexError } from './chunk-
|
|
2
|
-
export { AccountError, AiPlanError, AuthError, ContactError, FileError, IntegrationError, MessagingError, NO_ERROR_CODE, OrganizationError, PLANVORTEX_ERROR_RANGES, PlanLimitError, PlanVortexAuthenticationError, PlanVortexConfigError, PlanVortexConnectionError, PlanVortexError, ProductError, PublicationError, TOKEN_ERROR_CODES, UserError, errorFamilyForCode, isPlanVortexError, isTokenError } from './chunk-
|
|
1
|
+
import { createErrorFromResponse, NO_ERROR_CODE, PlanVortexError, PlanVortexConfigError, isTokenError, PlanVortexConnectionError, PlanVortexAuthenticationError, isPlanVortexError } from './chunk-JAA666FR.js';
|
|
2
|
+
export { AccountError, AiPlanError, AuthError, ContactError, FileError, IntegrationError, MessagingError, NO_ERROR_CODE, OrganizationError, PLANVORTEX_ERROR_RANGES, PlanLimitError, PlanVortexAuthenticationError, PlanVortexConfigError, PlanVortexConnectionError, PlanVortexError, ProductError, PublicationError, TOKEN_ERROR_CODES, UserError, errorFamilyForCode, isPlanVortexError, isTokenError } from './chunk-JAA666FR.js';
|
|
3
3
|
import { basename } from 'path';
|
|
4
4
|
|
|
5
5
|
// src/version.ts
|
|
6
6
|
var PLANVORTEX_API_URL = "https://api.planvortex.com/v1.0.0";
|
|
7
|
-
var VERSION = "0.
|
|
7
|
+
var VERSION = "0.26.0";
|
|
8
8
|
|
|
9
9
|
// src/core/auth.ts
|
|
10
10
|
var TOKEN_REFRESH_MARGIN_MS = 6e4;
|
|
@@ -2877,10 +2877,21 @@ var UploadsResource = class extends Resource {
|
|
|
2877
2877
|
* ```ts
|
|
2878
2878
|
* await pv.uploads.create(orgId, { file: "./hogaza.jpg" });
|
|
2879
2879
|
* await pv.uploads.create(orgId, { file: bytes, filename: "hogaza.jpg" });
|
|
2880
|
+
* // hecho con IA: TikTok lo recibe como `is_aigc`
|
|
2881
|
+
* await pv.uploads.create(orgId, { file: "./promo.mp4", ai_generated: true, ai_tool: "ElevenLabs" });
|
|
2880
2882
|
* ```
|
|
2883
|
+
*
|
|
2884
|
+
* Sin `ai_generated`, decide el fichero: si trae la marca de IA en sus metadatos, vuelve con
|
|
2885
|
+
* `ai_generated.source === "detected"` (ver {@link AiDeclaration}).
|
|
2881
2886
|
*/
|
|
2882
2887
|
async create(idOrganization, input, options = {}) {
|
|
2883
2888
|
const form = await buildUploadForm(input);
|
|
2889
|
+
if (input.ai_generated !== void 0) {
|
|
2890
|
+
form.append("ai_generated", String(input.ai_generated));
|
|
2891
|
+
}
|
|
2892
|
+
if (input.ai_tool) {
|
|
2893
|
+
form.append("ai_tool", input.ai_tool);
|
|
2894
|
+
}
|
|
2884
2895
|
return this.postOne(
|
|
2885
2896
|
`/organizations/${requireId(idOrganization, "idOrganization")}/uploads`,
|
|
2886
2897
|
"upload",
|
|
@@ -2910,7 +2921,14 @@ var UploadsResource = class extends Resource {
|
|
|
2910
2921
|
async get(idOrganization, idUpload, options = {}) {
|
|
2911
2922
|
return this.getOne(this.path(idOrganization, idUpload), "upload", void 0, options);
|
|
2912
2923
|
}
|
|
2913
|
-
/**
|
|
2924
|
+
/**
|
|
2925
|
+
* Cambia la portada de un vídeo o la marca de IA. Marcar o desmarcar recalcula también
|
|
2926
|
+
* `ai_generated.image` de las publicaciones que lo usan y aún no han salido.
|
|
2927
|
+
*
|
|
2928
|
+
* ```ts
|
|
2929
|
+
* await pv.uploads.update(orgId, uploadId, { ai_generated: true });
|
|
2930
|
+
* ```
|
|
2931
|
+
*/
|
|
2914
2932
|
async update(idOrganization, idUpload, body, options = {}) {
|
|
2915
2933
|
return this.putOne(this.path(idOrganization, idUpload), "upload", body, options);
|
|
2916
2934
|
}
|
|
@@ -2933,11 +2951,21 @@ var UploadsResource = class extends Resource {
|
|
|
2933
2951
|
* La respuesta es PARCIAL a propósito: mira `errors` aunque `uploads` traiga algo — de seis
|
|
2934
2952
|
* ficheros pueden entrar cuatro. Un `2204` significa que el proveedor no da los bytes: un
|
|
2935
2953
|
* documento nativo de Google no tiene fichero que descargar.
|
|
2954
|
+
*
|
|
2955
|
+
* `ai_generated` y `ai_tool` en `options` valen para toda la tanda; cada fichero puede traer
|
|
2956
|
+
* los suyos, que mandan.
|
|
2936
2957
|
*/
|
|
2937
2958
|
async import(idOrganization, idIntegration, files, options = {}) {
|
|
2959
|
+
const body = { id_integration: requireId(idIntegration, "idIntegration"), files };
|
|
2960
|
+
if (options.ai_generated !== void 0) {
|
|
2961
|
+
body.ai_generated = options.ai_generated;
|
|
2962
|
+
}
|
|
2963
|
+
if (options.ai_tool) {
|
|
2964
|
+
body.ai_tool = options.ai_tool;
|
|
2965
|
+
}
|
|
2938
2966
|
return this.httpPost(
|
|
2939
2967
|
`/organizations/${requireId(idOrganization, "idOrganization")}/uploads/import`,
|
|
2940
|
-
|
|
2968
|
+
body,
|
|
2941
2969
|
options
|
|
2942
2970
|
);
|
|
2943
2971
|
}
|