planvortex 0.5.0 → 0.6.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 +1 -1
- package/dist/{index-CnTr9naC.d.cts → index-B7gbjlNe.d.cts} +164 -3
- package/dist/{index-CnTr9naC.d.ts → index-B7gbjlNe.d.ts} +164 -3
- package/dist/index.cjs +54 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +53 -12
- package/dist/index.d.ts +53 -12
- package/dist/index.js +54 -7
- package/dist/index.js.map +1 -1
- package/dist/webhooks/index.d.cts +1 -1
- package/dist/webhooks/index.d.ts +1 -1
- package/package.json +1 -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, A as Account, b as AccountMetrics, c as PersistentMenu, d as Publication, e as AiPlanCreateRequest, f as AiPlanCreateResult, g as AiPlan, h as ClientApp, i as ClientAppInput, j as SocialCapabilities, k as CommentActions, l as SocialLimits, m as PublicationLimits, n as AspectRatiosByNetwork, o as PlannerTemplate, p as CommentNetwork, q as Comment, r as CommentThread, s as CommentReplyResult, t as ContactExtraData, u as Contact, v as ContactCreate, w as ContactUpdate, D as Dashboard, M as MetricName, x as DashboardMetricsResult, y as PublicationsSummaryResult, T as TopPublicationsResult, z as PublicationsStatsResult, B as PlanUse, I as IntegrationProviderName, F as IntegrationProvider, G as Integration, H as IntegrationConnectRequest, J as IntegrationUpdate, K as IntegrationPickerConfig, L as MessageTemplate, N as Conversation, O as ConversationTotals, Q as Message, R as MessageInput, U as Client, V as Organization, W as AiSettings, X as ClientWithOrganizations, Y as PlanData, Z as ConnectToken, _ as AiContext, $ as SocialCredentialsInput, a0 as Product, a1 as ProductInput, a2 as ProductCatalog, a3 as ProductCatalogInput, a4 as PublicationInput, a5 as PublicationState, a6 as PublicationStats, a7 as PublicationStatsHistory, a8 as Upload } from './index-
|
|
2
|
-
export { a9 as AccountError, aa as AccountMetricRow, ab as AccountStateChange, ac as AccountWebhookChangeBase, ad as AccountWithError, ae as AiPlanCostEstimate, af as AiPlanError, ag as AiPlanNotice, ah as AiPlanOptions, ai as AiPlanOptionsInput, aj as AiPlanSource, ak as AiPlanSourceImageInput, al as AiPlanSourceInput, am as AiPlanSourceProduct, an as AiPlanState, ao as ApiErrorBody, ap as AspectRatios, aq as AuthError, ar as ClientPlan, as as CommentAuthor, at as CommentChange, au as ContactChannel, av as ContactError, aw as DashboardAiPlanRef, ax as DashboardPublicationRef, ay as DashboardRange, az as EngagementBase, aA as FileError, aB as FileFormat, aC as FileProperties, aD as FileType, aE as IntegrationError, aF as IntegrationErrorChange, aG as MessageChange, aH as MessageOptions, aI as MessageType, aJ as MessagingError, aK as MetricRow, aL as NO_ERROR_CODE, aM as OpenApiComponents, aN as OpenApiOperations, aO as OpenApiPaths, aP as OpenApiWebhooks, aQ as OpenEnum, aR as OrganizationError, aS as PLANVORTEX_ERROR_RANGES, aT as PlanLimitError, aU as PlanVortexAuthenticationError, aV as PlanVortexConfigError, aW as PlanVortexConnectionError, aX as PlanVortexError, aY as PlanVortexErrorOptions, aZ as PlanVortexErrorRange, a_ as PlannerTemplateField, a$ as PlannerTemplateFieldType, b0 as PlannerTemplateName, b1 as ProductError, b2 as PublicationError, b3 as PublicationErrorDetail, b4 as PublicationMetrics, b5 as PublicationStatsPoint, b6 as PublicationType, b7 as PublicationsSummary, b8 as RssConfig, b9 as SocialAuthorizationMethod, ba as SocialCredentials, bb as SocialIdentifier, bc as SocialIdentifierInput, bd as SocialLimitsMap, be as TOKEN_ERROR_CODES, bf as TopPublication, bg as UnknownWebhookChange, bh as UserError, bi as WebhookAlgorithm, bj as WebhookChange, bk as WebhookEvent, bl as WithAccount, bm as WithPublication, bn as account, bo as accountId, bp as errorFamilyForCode, bq as isPlanVortexError, br as isTokenError, bs as messageContact, bt as messageContactId, bu as messageDirection, bv as messageFileIds, bw as messageFiles, bx as publication, by as publicationId } from './index-
|
|
1
|
+
import { P as Paginated, S as SocialNetwork, C as ConnectLink, a as ConnectResult, E as EnableResult, A as Account, b as AccountMetrics, c as PersistentMenu, d as Publication, e as AiPlanCreateRequest, f as AiPlanCreateResult, g as AiPlan, h as ClientApp, i as ClientAppInput, j as SocialCapabilities, k as CommentActions, l as SocialLimits, m as PublicationLimits, n as AspectRatiosByNetwork, o as PlannerTemplate, p as CommentNetwork, q as Comment, r as CommentThread, s as CommentReplyResult, t as ContactExtraData, u as Contact, v as ContactCreate, w as ContactUpdate, D as Dashboard, M as MetricName, x as DashboardMetricsResult, y as PublicationsSummaryResult, T as TopPublicationsResult, z as PublicationsStatsResult, B as PlanUse, I as IntegrationProviderName, F as IntegrationProvider, G as Integration, H as IntegrationConnectRequest, J as IntegrationUpdate, K as IntegrationPickerConfig, L as MessageTemplate, N as Conversation, O as ConversationTotals, Q as Message, R as MessageInput, U as Client, V as Organization, W as AiSettings, X as ClientWithOrganizations, Y as PlanData, Z as ConnectToken, _ as AiContext, $ as SocialCredentialsInput, a0 as Product, a1 as ProductInput, a2 as ProductCatalog, a3 as ProductCatalogInput, a4 as PublicationInput, a5 as PublicationState, a6 as PublicationStats, a7 as PublicationStatsHistory, a8 as Upload } from './index-B7gbjlNe.cjs';
|
|
2
|
+
export { a9 as AccountError, aa as AccountMetricRow, ab as AccountStateChange, ac as AccountWebhookChangeBase, ad as AccountWithError, ae as AiPlanCostEstimate, af as AiPlanError, ag as AiPlanNotice, ah as AiPlanOptions, ai as AiPlanOptionsInput, aj as AiPlanSource, ak as AiPlanSourceImageInput, al as AiPlanSourceInput, am as AiPlanSourceProduct, an as AiPlanState, ao as ApiErrorBody, ap as AspectRatios, aq as AuthError, ar as ClientPlan, as as CommentAuthor, at as CommentChange, au as ContactChannel, av as ContactError, aw as DashboardAiPlanRef, ax as DashboardPublicationRef, ay as DashboardRange, az as EngagementBase, aA as FileError, aB as FileFormat, aC as FileProperties, aD as FileType, aE as IntegrationError, aF as IntegrationErrorChange, aG as MessageChange, aH as MessageOptions, aI as MessageType, aJ as MessagingError, aK as MetricRow, aL as NO_ERROR_CODE, aM as OpenApiComponents, aN as OpenApiOperations, aO as OpenApiPaths, aP as OpenApiWebhooks, aQ as OpenEnum, aR as OrganizationError, aS as PLANVORTEX_ERROR_RANGES, aT as PlanLimitError, aU as PlanVortexAuthenticationError, aV as PlanVortexConfigError, aW as PlanVortexConnectionError, aX as PlanVortexError, aY as PlanVortexErrorOptions, aZ as PlanVortexErrorRange, a_ as PlannerTemplateField, a$ as PlannerTemplateFieldType, b0 as PlannerTemplateName, b1 as ProductError, b2 as PublicationError, b3 as PublicationErrorDetail, b4 as PublicationMetrics, b5 as PublicationStatsPoint, b6 as PublicationType, b7 as PublicationsSummary, b8 as RssConfig, b9 as SocialAuthorizationMethod, ba as SocialCredentials, bb as SocialIdentifier, bc as SocialIdentifierInput, bd as SocialLimitsMap, be as TOKEN_ERROR_CODES, bf as TopPublication, bg as UnknownWebhookChange, bh as UserError, bi as WebhookAlgorithm, bj as WebhookChange, bk as WebhookEvent, bl as WithAccount, bm as WithPublication, bn as account, bo as accountId, bp as errorFamilyForCode, bq as isPlanVortexError, br as isTokenError, bs as messageContact, bt as messageContactId, bu as messageDirection, bv as messageFileIds, bw as messageFiles, bx as publication, by as publicationId } from './index-B7gbjlNe.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.6.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>;
|
|
@@ -343,7 +343,13 @@ declare class AccountsResource extends Resource {
|
|
|
343
343
|
* que lunes/miércoles/viernes con 3 cuentas son 9 publicaciones, no 21.
|
|
344
344
|
* - **Estas rutas cuelgan del CLIENTE**, no sólo de la organización: llevan los dos identificadores.
|
|
345
345
|
* - **Borrar es cancelar.** El plan pasa a `cancelled` y deja de aparecer en el listado, pero
|
|
346
|
-
* {@link AiPlansResource.get} lo sigue devolviendo.
|
|
346
|
+
* {@link AiPlansResource.get} lo sigue devolviendo. Lo que SÍ desaparece de verdad son sus
|
|
347
|
+
* publicaciones que aún no habían salido: las drafts y, si el plan ya estaba validado, lo que
|
|
348
|
+
* quedara programado.
|
|
349
|
+
* - **Archivar NO es borrar, y es la acción que casi siempre se busca.** {@link
|
|
350
|
+
* AiPlansResource.archive} saca el plan del listado y no toca una sola publicación —lo
|
|
351
|
+
* programado sigue publicándose—, vale en cualquier estado y se deshace. Los archivados se leen
|
|
352
|
+
* con `list(..., { archived: true })`, nunca junto a los activos.
|
|
347
353
|
*
|
|
348
354
|
* LAS PLANTILLAS: DE QUÉ SE GENERA EL PLAN
|
|
349
355
|
*
|
|
@@ -380,6 +386,14 @@ declare class AccountsResource extends Resource {
|
|
|
380
386
|
|
|
381
387
|
/** Qué se regenera de una publicación del plan. `image` exige que el plan permitiera imágenes. */
|
|
382
388
|
type AiPlanRegenerateTarget = "text" | "image";
|
|
389
|
+
/** Filtros del listado de planes. */
|
|
390
|
+
interface AiPlanListOptions extends PageOptions {
|
|
391
|
+
/**
|
|
392
|
+
* `true` devuelve los ARCHIVADOS en vez de los activos. Nunca los dos a la vez: archivar es
|
|
393
|
+
* mandar el plan a otro sitio, no ponerle una etiqueta que lo deje donde estaba.
|
|
394
|
+
*/
|
|
395
|
+
archived?: boolean | undefined;
|
|
396
|
+
}
|
|
383
397
|
/** Lo que devuelve regenerar: la publicación nueva y lo que lleva gastado el plan EN TOTAL. */
|
|
384
398
|
interface AiPlanRegenerateResult {
|
|
385
399
|
publication: Publication;
|
|
@@ -434,14 +448,20 @@ declare class AiPlansResource extends Resource {
|
|
|
434
448
|
*/
|
|
435
449
|
get(idClient: string, idOrganization: string, idAiPlan: string, options?: RequestOptions): Promise<AiPlan>;
|
|
436
450
|
/**
|
|
437
|
-
* Los planes de la organización, del más reciente al más antiguo.
|
|
451
|
+
* Los planes ACTIVOS de la organización, del más reciente al más antiguo.
|
|
438
452
|
*
|
|
439
|
-
* **Los cancelados no salen
|
|
440
|
-
* enteras: para eso está {@link get}.
|
|
453
|
+
* **Los cancelados no salen** —ni los archivados, que se piden con `archived: true`— y aquí
|
|
454
|
+
* `publications` son identificadores, no las publicaciones enteras: para eso está {@link get}.
|
|
455
|
+
* Sin `limit` vuelven todos.
|
|
456
|
+
*
|
|
457
|
+
* ```ts
|
|
458
|
+
* const activos = await pv.aiPlans.list(clientId, orgId);
|
|
459
|
+
* const guardados = await pv.aiPlans.list(clientId, orgId, { archived: true });
|
|
460
|
+
* ```
|
|
441
461
|
*/
|
|
442
|
-
list(idClient: string, idOrganization: string, options?:
|
|
462
|
+
list(idClient: string, idOrganization: string, options?: AiPlanListOptions & RequestOptions): Promise<Paginated<AiPlan>>;
|
|
443
463
|
/** Los planes de la organización, encadenando páginas. */
|
|
444
|
-
iterate(idClient: string, idOrganization: string, options?:
|
|
464
|
+
iterate(idClient: string, idOrganization: string, options?: AiPlanListOptions & RequestOptions): AsyncGenerator<AiPlan>;
|
|
445
465
|
/**
|
|
446
466
|
* Acepta el plan: las drafts generadas SIN errores pasan a `ready` y a partir de ahí las publica
|
|
447
467
|
* el robot como cualquier publicación programada.
|
|
@@ -471,8 +491,29 @@ declare class AiPlansResource extends Resource {
|
|
|
471
491
|
*/
|
|
472
492
|
regenerate(idClient: string, idOrganization: string, idAiPlan: string, idPublication: string, target: AiPlanRegenerateTarget, options?: RequestOptions): Promise<AiPlanRegenerateResult>;
|
|
473
493
|
/**
|
|
474
|
-
*
|
|
475
|
-
*
|
|
494
|
+
* Archiva el plan: sale del listado y pasa al de archivados (`list(..., { archived: true })`).
|
|
495
|
+
*
|
|
496
|
+
* Es **sólo visibilidad**. No toca ninguna publicación —lo que estuviera programado sigue
|
|
497
|
+
* publicándose—, no devuelve créditos y no cancela nada, así que vale en CUALQUIER estado,
|
|
498
|
+
* `generating` incluido: no interrumpe al job. Se deshace con {@link unarchive}.
|
|
499
|
+
*
|
|
500
|
+
* Es lo que se busca casi siempre que uno piensa en "quitar" un plan: {@link remove} se lleva
|
|
501
|
+
* por delante las publicaciones que aún no han salido, y esto no.
|
|
502
|
+
*/
|
|
503
|
+
archive(idClient: string, idOrganization: string, idAiPlan: string, options?: RequestOptions): Promise<AiPlan>;
|
|
504
|
+
/** Devuelve el plan al listado activo. Sobre un plan que no estaba archivado no hace nada. */
|
|
505
|
+
unarchive(idClient: string, idOrganization: string, idAiPlan: string, options?: RequestOptions): Promise<AiPlan>;
|
|
506
|
+
/**
|
|
507
|
+
* Borra el plan **y sus publicaciones que aún no han salido**: las drafts generadas y, si ya se
|
|
508
|
+
* había validado, las que quedaran programadas. Las ya publicadas se quedan —borrarlas aquí no
|
|
509
|
+
* las quitaría de la red, sólo perdería su historial— y la que se está publicando en ese
|
|
510
|
+
* instante tampoco se toca.
|
|
511
|
+
*
|
|
512
|
+
* El plan en sí no se borra del todo: pasa a `cancelled`, desaparece de {@link list} y
|
|
513
|
+
* {@link get} lo sigue devolviendo. Los créditos gastados no se devuelven y un plan
|
|
514
|
+
* `generating` no se puede borrar (2102): hay que esperar a que el job termine.
|
|
515
|
+
*
|
|
516
|
+
* Si lo que se quiere es dejar de verlo sin perder nada, {@link archive}.
|
|
476
517
|
*/
|
|
477
518
|
remove(idClient: string, idOrganization: string, idAiPlan: string, options?: RequestOptions): Promise<void>;
|
|
478
519
|
private path;
|
|
@@ -1966,4 +2007,4 @@ interface AuthProvider {
|
|
|
1966
2007
|
/** Margen con el que se pide un token nuevo antes de que caduque el que hay. */
|
|
1967
2008
|
declare const TOKEN_REFRESH_MARGIN_MS = 60000;
|
|
1968
2009
|
|
|
1969
|
-
export { Account, type AccountCapability, type AccountListOptions, AccountMetrics, type AccountMetricsOptions, AccountsResource, AiContext, AiPlan, AiPlanCreateRequest, AiPlanCreateResult, type AiPlanRegenerateResult, type AiPlanRegenerateTarget, 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, ConnectToken, type ConnectTokenOptions, Contact, ContactCreate, ContactExtraData, type ContactExtraFilter, type ContactListOptions, ContactUpdate, ContactsResource, Conversation, type ConversationGroupBy, ConversationTotals, type ConversationTotalsOptions, DEFAULT_PAGE_SIZE, DEFAULT_RETRY, DEFAULT_TIMEOUT_MS, Dashboard, DashboardMetricsResult, DashboardResource, EnableResult, type FetchLike, type FileInput, type FileSource, type HttpHooks, type HttpMethod, type HttpRequest, type HttpResponse, type ImportError, type ImportFileInput, type ImportResult, Integration, IntegrationConnectRequest, type IntegrationListOptions, IntegrationPickerConfig, 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, PlanVortex, type PlanVortexOptions, PlannerTemplate, Product, ProductCatalog, ProductCatalogInput, ProductInput, ProductsResource, Publication, PublicationInput, PublicationLimits, type PublicationListOptions, type PublicationRetryResult, PublicationState, PublicationStats, PublicationStatsHistory, PublicationsResource, type PublicationsStatsOptions, PublicationsStatsResult, PublicationsSummaryResult, 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 };
|
|
2010
|
+
export { Account, type AccountCapability, type AccountListOptions, AccountMetrics, type AccountMetricsOptions, AccountsResource, AiContext, AiPlan, AiPlanCreateRequest, AiPlanCreateResult, type AiPlanListOptions, type AiPlanRegenerateResult, type AiPlanRegenerateTarget, 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, ConnectToken, type ConnectTokenOptions, Contact, ContactCreate, ContactExtraData, type ContactExtraFilter, type ContactListOptions, ContactUpdate, ContactsResource, Conversation, type ConversationGroupBy, ConversationTotals, type ConversationTotalsOptions, DEFAULT_PAGE_SIZE, DEFAULT_RETRY, DEFAULT_TIMEOUT_MS, Dashboard, DashboardMetricsResult, DashboardResource, EnableResult, type FetchLike, type FileInput, type FileSource, type HttpHooks, type HttpMethod, type HttpRequest, type HttpResponse, type ImportError, type ImportFileInput, type ImportResult, Integration, IntegrationConnectRequest, type IntegrationListOptions, IntegrationPickerConfig, 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, PlanVortex, type PlanVortexOptions, PlannerTemplate, Product, ProductCatalog, ProductCatalogInput, ProductInput, ProductsResource, Publication, PublicationInput, PublicationLimits, type PublicationListOptions, type PublicationRetryResult, PublicationState, PublicationStats, PublicationStatsHistory, PublicationsResource, type PublicationsStatsOptions, PublicationsStatsResult, PublicationsSummaryResult, 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 };
|
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, A as Account, b as AccountMetrics, c as PersistentMenu, d as Publication, e as AiPlanCreateRequest, f as AiPlanCreateResult, g as AiPlan, h as ClientApp, i as ClientAppInput, j as SocialCapabilities, k as CommentActions, l as SocialLimits, m as PublicationLimits, n as AspectRatiosByNetwork, o as PlannerTemplate, p as CommentNetwork, q as Comment, r as CommentThread, s as CommentReplyResult, t as ContactExtraData, u as Contact, v as ContactCreate, w as ContactUpdate, D as Dashboard, M as MetricName, x as DashboardMetricsResult, y as PublicationsSummaryResult, T as TopPublicationsResult, z as PublicationsStatsResult, B as PlanUse, I as IntegrationProviderName, F as IntegrationProvider, G as Integration, H as IntegrationConnectRequest, J as IntegrationUpdate, K as IntegrationPickerConfig, L as MessageTemplate, N as Conversation, O as ConversationTotals, Q as Message, R as MessageInput, U as Client, V as Organization, W as AiSettings, X as ClientWithOrganizations, Y as PlanData, Z as ConnectToken, _ as AiContext, $ as SocialCredentialsInput, a0 as Product, a1 as ProductInput, a2 as ProductCatalog, a3 as ProductCatalogInput, a4 as PublicationInput, a5 as PublicationState, a6 as PublicationStats, a7 as PublicationStatsHistory, a8 as Upload } from './index-
|
|
2
|
-
export { a9 as AccountError, aa as AccountMetricRow, ab as AccountStateChange, ac as AccountWebhookChangeBase, ad as AccountWithError, ae as AiPlanCostEstimate, af as AiPlanError, ag as AiPlanNotice, ah as AiPlanOptions, ai as AiPlanOptionsInput, aj as AiPlanSource, ak as AiPlanSourceImageInput, al as AiPlanSourceInput, am as AiPlanSourceProduct, an as AiPlanState, ao as ApiErrorBody, ap as AspectRatios, aq as AuthError, ar as ClientPlan, as as CommentAuthor, at as CommentChange, au as ContactChannel, av as ContactError, aw as DashboardAiPlanRef, ax as DashboardPublicationRef, ay as DashboardRange, az as EngagementBase, aA as FileError, aB as FileFormat, aC as FileProperties, aD as FileType, aE as IntegrationError, aF as IntegrationErrorChange, aG as MessageChange, aH as MessageOptions, aI as MessageType, aJ as MessagingError, aK as MetricRow, aL as NO_ERROR_CODE, aM as OpenApiComponents, aN as OpenApiOperations, aO as OpenApiPaths, aP as OpenApiWebhooks, aQ as OpenEnum, aR as OrganizationError, aS as PLANVORTEX_ERROR_RANGES, aT as PlanLimitError, aU as PlanVortexAuthenticationError, aV as PlanVortexConfigError, aW as PlanVortexConnectionError, aX as PlanVortexError, aY as PlanVortexErrorOptions, aZ as PlanVortexErrorRange, a_ as PlannerTemplateField, a$ as PlannerTemplateFieldType, b0 as PlannerTemplateName, b1 as ProductError, b2 as PublicationError, b3 as PublicationErrorDetail, b4 as PublicationMetrics, b5 as PublicationStatsPoint, b6 as PublicationType, b7 as PublicationsSummary, b8 as RssConfig, b9 as SocialAuthorizationMethod, ba as SocialCredentials, bb as SocialIdentifier, bc as SocialIdentifierInput, bd as SocialLimitsMap, be as TOKEN_ERROR_CODES, bf as TopPublication, bg as UnknownWebhookChange, bh as UserError, bi as WebhookAlgorithm, bj as WebhookChange, bk as WebhookEvent, bl as WithAccount, bm as WithPublication, bn as account, bo as accountId, bp as errorFamilyForCode, bq as isPlanVortexError, br as isTokenError, bs as messageContact, bt as messageContactId, bu as messageDirection, bv as messageFileIds, bw as messageFiles, bx as publication, by as publicationId } from './index-
|
|
1
|
+
import { P as Paginated, S as SocialNetwork, C as ConnectLink, a as ConnectResult, E as EnableResult, A as Account, b as AccountMetrics, c as PersistentMenu, d as Publication, e as AiPlanCreateRequest, f as AiPlanCreateResult, g as AiPlan, h as ClientApp, i as ClientAppInput, j as SocialCapabilities, k as CommentActions, l as SocialLimits, m as PublicationLimits, n as AspectRatiosByNetwork, o as PlannerTemplate, p as CommentNetwork, q as Comment, r as CommentThread, s as CommentReplyResult, t as ContactExtraData, u as Contact, v as ContactCreate, w as ContactUpdate, D as Dashboard, M as MetricName, x as DashboardMetricsResult, y as PublicationsSummaryResult, T as TopPublicationsResult, z as PublicationsStatsResult, B as PlanUse, I as IntegrationProviderName, F as IntegrationProvider, G as Integration, H as IntegrationConnectRequest, J as IntegrationUpdate, K as IntegrationPickerConfig, L as MessageTemplate, N as Conversation, O as ConversationTotals, Q as Message, R as MessageInput, U as Client, V as Organization, W as AiSettings, X as ClientWithOrganizations, Y as PlanData, Z as ConnectToken, _ as AiContext, $ as SocialCredentialsInput, a0 as Product, a1 as ProductInput, a2 as ProductCatalog, a3 as ProductCatalogInput, a4 as PublicationInput, a5 as PublicationState, a6 as PublicationStats, a7 as PublicationStatsHistory, a8 as Upload } from './index-B7gbjlNe.js';
|
|
2
|
+
export { a9 as AccountError, aa as AccountMetricRow, ab as AccountStateChange, ac as AccountWebhookChangeBase, ad as AccountWithError, ae as AiPlanCostEstimate, af as AiPlanError, ag as AiPlanNotice, ah as AiPlanOptions, ai as AiPlanOptionsInput, aj as AiPlanSource, ak as AiPlanSourceImageInput, al as AiPlanSourceInput, am as AiPlanSourceProduct, an as AiPlanState, ao as ApiErrorBody, ap as AspectRatios, aq as AuthError, ar as ClientPlan, as as CommentAuthor, at as CommentChange, au as ContactChannel, av as ContactError, aw as DashboardAiPlanRef, ax as DashboardPublicationRef, ay as DashboardRange, az as EngagementBase, aA as FileError, aB as FileFormat, aC as FileProperties, aD as FileType, aE as IntegrationError, aF as IntegrationErrorChange, aG as MessageChange, aH as MessageOptions, aI as MessageType, aJ as MessagingError, aK as MetricRow, aL as NO_ERROR_CODE, aM as OpenApiComponents, aN as OpenApiOperations, aO as OpenApiPaths, aP as OpenApiWebhooks, aQ as OpenEnum, aR as OrganizationError, aS as PLANVORTEX_ERROR_RANGES, aT as PlanLimitError, aU as PlanVortexAuthenticationError, aV as PlanVortexConfigError, aW as PlanVortexConnectionError, aX as PlanVortexError, aY as PlanVortexErrorOptions, aZ as PlanVortexErrorRange, a_ as PlannerTemplateField, a$ as PlannerTemplateFieldType, b0 as PlannerTemplateName, b1 as ProductError, b2 as PublicationError, b3 as PublicationErrorDetail, b4 as PublicationMetrics, b5 as PublicationStatsPoint, b6 as PublicationType, b7 as PublicationsSummary, b8 as RssConfig, b9 as SocialAuthorizationMethod, ba as SocialCredentials, bb as SocialIdentifier, bc as SocialIdentifierInput, bd as SocialLimitsMap, be as TOKEN_ERROR_CODES, bf as TopPublication, bg as UnknownWebhookChange, bh as UserError, bi as WebhookAlgorithm, bj as WebhookChange, bk as WebhookEvent, bl as WithAccount, bm as WithPublication, bn as account, bo as accountId, bp as errorFamilyForCode, bq as isPlanVortexError, br as isTokenError, bs as messageContact, bt as messageContactId, bu as messageDirection, bv as messageFileIds, bw as messageFiles, bx as publication, by as publicationId } from './index-B7gbjlNe.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.6.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>;
|
|
@@ -343,7 +343,13 @@ declare class AccountsResource extends Resource {
|
|
|
343
343
|
* que lunes/miércoles/viernes con 3 cuentas son 9 publicaciones, no 21.
|
|
344
344
|
* - **Estas rutas cuelgan del CLIENTE**, no sólo de la organización: llevan los dos identificadores.
|
|
345
345
|
* - **Borrar es cancelar.** El plan pasa a `cancelled` y deja de aparecer en el listado, pero
|
|
346
|
-
* {@link AiPlansResource.get} lo sigue devolviendo.
|
|
346
|
+
* {@link AiPlansResource.get} lo sigue devolviendo. Lo que SÍ desaparece de verdad son sus
|
|
347
|
+
* publicaciones que aún no habían salido: las drafts y, si el plan ya estaba validado, lo que
|
|
348
|
+
* quedara programado.
|
|
349
|
+
* - **Archivar NO es borrar, y es la acción que casi siempre se busca.** {@link
|
|
350
|
+
* AiPlansResource.archive} saca el plan del listado y no toca una sola publicación —lo
|
|
351
|
+
* programado sigue publicándose—, vale en cualquier estado y se deshace. Los archivados se leen
|
|
352
|
+
* con `list(..., { archived: true })`, nunca junto a los activos.
|
|
347
353
|
*
|
|
348
354
|
* LAS PLANTILLAS: DE QUÉ SE GENERA EL PLAN
|
|
349
355
|
*
|
|
@@ -380,6 +386,14 @@ declare class AccountsResource extends Resource {
|
|
|
380
386
|
|
|
381
387
|
/** Qué se regenera de una publicación del plan. `image` exige que el plan permitiera imágenes. */
|
|
382
388
|
type AiPlanRegenerateTarget = "text" | "image";
|
|
389
|
+
/** Filtros del listado de planes. */
|
|
390
|
+
interface AiPlanListOptions extends PageOptions {
|
|
391
|
+
/**
|
|
392
|
+
* `true` devuelve los ARCHIVADOS en vez de los activos. Nunca los dos a la vez: archivar es
|
|
393
|
+
* mandar el plan a otro sitio, no ponerle una etiqueta que lo deje donde estaba.
|
|
394
|
+
*/
|
|
395
|
+
archived?: boolean | undefined;
|
|
396
|
+
}
|
|
383
397
|
/** Lo que devuelve regenerar: la publicación nueva y lo que lleva gastado el plan EN TOTAL. */
|
|
384
398
|
interface AiPlanRegenerateResult {
|
|
385
399
|
publication: Publication;
|
|
@@ -434,14 +448,20 @@ declare class AiPlansResource extends Resource {
|
|
|
434
448
|
*/
|
|
435
449
|
get(idClient: string, idOrganization: string, idAiPlan: string, options?: RequestOptions): Promise<AiPlan>;
|
|
436
450
|
/**
|
|
437
|
-
* Los planes de la organización, del más reciente al más antiguo.
|
|
451
|
+
* Los planes ACTIVOS de la organización, del más reciente al más antiguo.
|
|
438
452
|
*
|
|
439
|
-
* **Los cancelados no salen
|
|
440
|
-
* enteras: para eso está {@link get}.
|
|
453
|
+
* **Los cancelados no salen** —ni los archivados, que se piden con `archived: true`— y aquí
|
|
454
|
+
* `publications` son identificadores, no las publicaciones enteras: para eso está {@link get}.
|
|
455
|
+
* Sin `limit` vuelven todos.
|
|
456
|
+
*
|
|
457
|
+
* ```ts
|
|
458
|
+
* const activos = await pv.aiPlans.list(clientId, orgId);
|
|
459
|
+
* const guardados = await pv.aiPlans.list(clientId, orgId, { archived: true });
|
|
460
|
+
* ```
|
|
441
461
|
*/
|
|
442
|
-
list(idClient: string, idOrganization: string, options?:
|
|
462
|
+
list(idClient: string, idOrganization: string, options?: AiPlanListOptions & RequestOptions): Promise<Paginated<AiPlan>>;
|
|
443
463
|
/** Los planes de la organización, encadenando páginas. */
|
|
444
|
-
iterate(idClient: string, idOrganization: string, options?:
|
|
464
|
+
iterate(idClient: string, idOrganization: string, options?: AiPlanListOptions & RequestOptions): AsyncGenerator<AiPlan>;
|
|
445
465
|
/**
|
|
446
466
|
* Acepta el plan: las drafts generadas SIN errores pasan a `ready` y a partir de ahí las publica
|
|
447
467
|
* el robot como cualquier publicación programada.
|
|
@@ -471,8 +491,29 @@ declare class AiPlansResource extends Resource {
|
|
|
471
491
|
*/
|
|
472
492
|
regenerate(idClient: string, idOrganization: string, idAiPlan: string, idPublication: string, target: AiPlanRegenerateTarget, options?: RequestOptions): Promise<AiPlanRegenerateResult>;
|
|
473
493
|
/**
|
|
474
|
-
*
|
|
475
|
-
*
|
|
494
|
+
* Archiva el plan: sale del listado y pasa al de archivados (`list(..., { archived: true })`).
|
|
495
|
+
*
|
|
496
|
+
* Es **sólo visibilidad**. No toca ninguna publicación —lo que estuviera programado sigue
|
|
497
|
+
* publicándose—, no devuelve créditos y no cancela nada, así que vale en CUALQUIER estado,
|
|
498
|
+
* `generating` incluido: no interrumpe al job. Se deshace con {@link unarchive}.
|
|
499
|
+
*
|
|
500
|
+
* Es lo que se busca casi siempre que uno piensa en "quitar" un plan: {@link remove} se lleva
|
|
501
|
+
* por delante las publicaciones que aún no han salido, y esto no.
|
|
502
|
+
*/
|
|
503
|
+
archive(idClient: string, idOrganization: string, idAiPlan: string, options?: RequestOptions): Promise<AiPlan>;
|
|
504
|
+
/** Devuelve el plan al listado activo. Sobre un plan que no estaba archivado no hace nada. */
|
|
505
|
+
unarchive(idClient: string, idOrganization: string, idAiPlan: string, options?: RequestOptions): Promise<AiPlan>;
|
|
506
|
+
/**
|
|
507
|
+
* Borra el plan **y sus publicaciones que aún no han salido**: las drafts generadas y, si ya se
|
|
508
|
+
* había validado, las que quedaran programadas. Las ya publicadas se quedan —borrarlas aquí no
|
|
509
|
+
* las quitaría de la red, sólo perdería su historial— y la que se está publicando en ese
|
|
510
|
+
* instante tampoco se toca.
|
|
511
|
+
*
|
|
512
|
+
* El plan en sí no se borra del todo: pasa a `cancelled`, desaparece de {@link list} y
|
|
513
|
+
* {@link get} lo sigue devolviendo. Los créditos gastados no se devuelven y un plan
|
|
514
|
+
* `generating` no se puede borrar (2102): hay que esperar a que el job termine.
|
|
515
|
+
*
|
|
516
|
+
* Si lo que se quiere es dejar de verlo sin perder nada, {@link archive}.
|
|
476
517
|
*/
|
|
477
518
|
remove(idClient: string, idOrganization: string, idAiPlan: string, options?: RequestOptions): Promise<void>;
|
|
478
519
|
private path;
|
|
@@ -1966,4 +2007,4 @@ interface AuthProvider {
|
|
|
1966
2007
|
/** Margen con el que se pide un token nuevo antes de que caduque el que hay. */
|
|
1967
2008
|
declare const TOKEN_REFRESH_MARGIN_MS = 60000;
|
|
1968
2009
|
|
|
1969
|
-
export { Account, type AccountCapability, type AccountListOptions, AccountMetrics, type AccountMetricsOptions, AccountsResource, AiContext, AiPlan, AiPlanCreateRequest, AiPlanCreateResult, type AiPlanRegenerateResult, type AiPlanRegenerateTarget, 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, ConnectToken, type ConnectTokenOptions, Contact, ContactCreate, ContactExtraData, type ContactExtraFilter, type ContactListOptions, ContactUpdate, ContactsResource, Conversation, type ConversationGroupBy, ConversationTotals, type ConversationTotalsOptions, DEFAULT_PAGE_SIZE, DEFAULT_RETRY, DEFAULT_TIMEOUT_MS, Dashboard, DashboardMetricsResult, DashboardResource, EnableResult, type FetchLike, type FileInput, type FileSource, type HttpHooks, type HttpMethod, type HttpRequest, type HttpResponse, type ImportError, type ImportFileInput, type ImportResult, Integration, IntegrationConnectRequest, type IntegrationListOptions, IntegrationPickerConfig, 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, PlanVortex, type PlanVortexOptions, PlannerTemplate, Product, ProductCatalog, ProductCatalogInput, ProductInput, ProductsResource, Publication, PublicationInput, PublicationLimits, type PublicationListOptions, type PublicationRetryResult, PublicationState, PublicationStats, PublicationStatsHistory, PublicationsResource, type PublicationsStatsOptions, PublicationsStatsResult, PublicationsSummaryResult, 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 };
|
|
2010
|
+
export { Account, type AccountCapability, type AccountListOptions, AccountMetrics, type AccountMetricsOptions, AccountsResource, AiContext, AiPlan, AiPlanCreateRequest, AiPlanCreateResult, type AiPlanListOptions, type AiPlanRegenerateResult, type AiPlanRegenerateTarget, 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, ConnectToken, type ConnectTokenOptions, Contact, ContactCreate, ContactExtraData, type ContactExtraFilter, type ContactListOptions, ContactUpdate, ContactsResource, Conversation, type ConversationGroupBy, ConversationTotals, type ConversationTotalsOptions, DEFAULT_PAGE_SIZE, DEFAULT_RETRY, DEFAULT_TIMEOUT_MS, Dashboard, DashboardMetricsResult, DashboardResource, EnableResult, type FetchLike, type FileInput, type FileSource, type HttpHooks, type HttpMethod, type HttpRequest, type HttpResponse, type ImportError, type ImportFileInput, type ImportResult, Integration, IntegrationConnectRequest, type IntegrationListOptions, IntegrationPickerConfig, 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, PlanVortex, type PlanVortexOptions, PlannerTemplate, Product, ProductCatalog, ProductCatalogInput, ProductInput, ProductsResource, Publication, PublicationInput, PublicationLimits, type PublicationListOptions, type PublicationRetryResult, PublicationState, PublicationStats, PublicationStatsHistory, PublicationsResource, type PublicationsStatsOptions, PublicationsStatsResult, PublicationsSummaryResult, 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 };
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ 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.6.0";
|
|
8
8
|
|
|
9
9
|
// src/core/auth.ts
|
|
10
10
|
var TOKEN_REFRESH_MARGIN_MS = 6e4;
|
|
@@ -714,16 +714,28 @@ var AiPlansResource = class extends Resource {
|
|
|
714
714
|
);
|
|
715
715
|
}
|
|
716
716
|
/**
|
|
717
|
-
* Los planes de la organización, del más reciente al más antiguo.
|
|
717
|
+
* Los planes ACTIVOS de la organización, del más reciente al más antiguo.
|
|
718
718
|
*
|
|
719
|
-
* **Los cancelados no salen
|
|
720
|
-
* enteras: para eso está {@link get}.
|
|
719
|
+
* **Los cancelados no salen** —ni los archivados, que se piden con `archived: true`— y aquí
|
|
720
|
+
* `publications` son identificadores, no las publicaciones enteras: para eso está {@link get}.
|
|
721
|
+
* Sin `limit` vuelven todos.
|
|
722
|
+
*
|
|
723
|
+
* ```ts
|
|
724
|
+
* const activos = await pv.aiPlans.list(clientId, orgId);
|
|
725
|
+
* const guardados = await pv.aiPlans.list(clientId, orgId, { archived: true });
|
|
726
|
+
* ```
|
|
721
727
|
*/
|
|
722
728
|
async list(idClient, idOrganization, options = {}) {
|
|
723
729
|
return this.getList(
|
|
724
730
|
this.path(idClient, idOrganization),
|
|
725
731
|
"ai_plans",
|
|
726
|
-
{
|
|
732
|
+
{
|
|
733
|
+
offset: options.offset,
|
|
734
|
+
limit: options.limit,
|
|
735
|
+
//El servidor sólo entiende el literal "true"; un `false` explícito pediría lo
|
|
736
|
+
//mismo que no mandar nada, así que se omite en vez de viajar como ruido
|
|
737
|
+
archived: options.archived ? true : void 0
|
|
738
|
+
},
|
|
727
739
|
options
|
|
728
740
|
);
|
|
729
741
|
}
|
|
@@ -783,8 +795,43 @@ var AiPlansResource = class extends Resource {
|
|
|
783
795
|
);
|
|
784
796
|
}
|
|
785
797
|
/**
|
|
786
|
-
*
|
|
787
|
-
*
|
|
798
|
+
* Archiva el plan: sale del listado y pasa al de archivados (`list(..., { archived: true })`).
|
|
799
|
+
*
|
|
800
|
+
* Es **sólo visibilidad**. No toca ninguna publicación —lo que estuviera programado sigue
|
|
801
|
+
* publicándose—, no devuelve créditos y no cancela nada, así que vale en CUALQUIER estado,
|
|
802
|
+
* `generating` incluido: no interrumpe al job. Se deshace con {@link unarchive}.
|
|
803
|
+
*
|
|
804
|
+
* Es lo que se busca casi siempre que uno piensa en "quitar" un plan: {@link remove} se lleva
|
|
805
|
+
* por delante las publicaciones que aún no han salido, y esto no.
|
|
806
|
+
*/
|
|
807
|
+
async archive(idClient, idOrganization, idAiPlan, options = {}) {
|
|
808
|
+
return this.postOne(
|
|
809
|
+
`${this.one(idClient, idOrganization, idAiPlan)}/archive`,
|
|
810
|
+
"ai_plan",
|
|
811
|
+
void 0,
|
|
812
|
+
options
|
|
813
|
+
);
|
|
814
|
+
}
|
|
815
|
+
/** Devuelve el plan al listado activo. Sobre un plan que no estaba archivado no hace nada. */
|
|
816
|
+
async unarchive(idClient, idOrganization, idAiPlan, options = {}) {
|
|
817
|
+
return this.postOne(
|
|
818
|
+
`${this.one(idClient, idOrganization, idAiPlan)}/unarchive`,
|
|
819
|
+
"ai_plan",
|
|
820
|
+
void 0,
|
|
821
|
+
options
|
|
822
|
+
);
|
|
823
|
+
}
|
|
824
|
+
/**
|
|
825
|
+
* Borra el plan **y sus publicaciones que aún no han salido**: las drafts generadas y, si ya se
|
|
826
|
+
* había validado, las que quedaran programadas. Las ya publicadas se quedan —borrarlas aquí no
|
|
827
|
+
* las quitaría de la red, sólo perdería su historial— y la que se está publicando en ese
|
|
828
|
+
* instante tampoco se toca.
|
|
829
|
+
*
|
|
830
|
+
* El plan en sí no se borra del todo: pasa a `cancelled`, desaparece de {@link list} y
|
|
831
|
+
* {@link get} lo sigue devolviendo. Los créditos gastados no se devuelven y un plan
|
|
832
|
+
* `generating` no se puede borrar (2102): hay que esperar a que el job termine.
|
|
833
|
+
*
|
|
834
|
+
* Si lo que se quiere es dejar de verlo sin perder nada, {@link archive}.
|
|
788
835
|
*/
|
|
789
836
|
async remove(idClient, idOrganization, idAiPlan, options = {}) {
|
|
790
837
|
await this.httpDelete(
|