@code.store/arcxp-sdk-ts 5.1.3 → 5.1.6
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/dist/api/abstract-api.d.ts +1 -0
- package/dist/api/sales/index.d.ts +4 -2
- package/dist/api/sales/types.d.ts +8 -1
- package/dist/index.cjs +22 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/utils/index.ts","../src/api/error.ts","../src/api/abstract-api.ts","../src/api/author/index.ts","../src/api/content-ops/index.ts","../src/api/content/index.ts","../src/api/custom/index.ts","../src/api/draft/index.ts","../src/api/global-settings/index.ts","../src/api/identity/index.ts","../src/lib/platform/node.ts","../src/lib/platform/index.ts","../src/api/ifx/index.ts","../src/api/migration-center/index.ts","../src/api/photo-center/index.ts","../src/api/redirect/index.ts","../src/api/ws.client.ts","../src/api/retail-events/index.ts","../src/api/developer-retail/index.ts","../src/api/sales/index.ts","../src/api/signing-service/index.ts","../src/api/site/index.ts","../src/api/tags/index.ts","../src/api/websked/index.ts","../src/api/index.ts","../src/types/ans-types.ts","../src/api/migration-center/types.ts","../src/utils/arc/ans.ts","../src/content-elements/content-elements.ts","../src/utils/arc/content.ts","../src/utils/arc/id.ts","../src/utils/arc/section.ts","../src/utils/arc/index.ts","../src/mapper/doc.ts","../src/mapper/story.ts","../src/content-elements/html/html.constants.ts","../src/content-elements/html/html.utils.ts","../src/content-elements/html/html.processor.ts"],"sourcesContent":["export const safeJSONParse = (data: string): any => {\n try {\n return JSON.parse(data);\n } catch {\n return {};\n }\n};\n\nexport const safeJSONStringify = (data: any): string => {\n try {\n return JSON.stringify(data) || '';\n } catch {\n return '';\n }\n};\n\nexport const withTimeout = <T>(fn: Promise<T>, timeout: number): Promise<T> => {\n return new Promise((resolve, reject) => {\n const nodeTimeout = setTimeout(() => {\n reject(`Timeout ${timeout} exceed`);\n }, timeout);\n\n fn.then(\n (data) => {\n clearTimeout(nodeTimeout);\n resolve(data);\n },\n (error) => {\n clearTimeout(nodeTimeout);\n reject(error);\n }\n );\n });\n};\n\nexport const AxiosResponseErrorInterceptor = <T = any, E extends Error = any>(\n errorConstructor: (e: any) => E\n): [onFulfilled?: (value: T) => T | Promise<T>, onRejected?: (error: any) => any] => {\n return [\n (response) => response,\n (error) => {\n throw errorConstructor(error);\n },\n ];\n};\n\nexport const sleep = (ms = 1000) => new Promise((resolve) => setTimeout(resolve, ms));\n\nexport const timestampFromNow = (ms = 0) => {\n return Date.now() + ms;\n};\n","import type { AxiosError, InternalAxiosRequestConfig } from 'axios';\nimport { safeJSONStringify } from '../utils/index.js';\n\nexport class ArcError extends Error {\n public responseData: unknown;\n public responseStatus?: number;\n public responseConfig?: InternalAxiosRequestConfig<any>;\n public ratelimitRemaining?: string;\n public ratelimitReset?: string;\n public service?: string;\n\n constructor(service: string, e: AxiosError) {\n const ratelimitRemaining = e.response?.headers['arcpub-ratelimit-remaining'];\n const ratelimitReset = e.response?.headers['arcpub-ratelimit-reset'];\n const data = {\n name: `${service}Error`,\n message: e.message,\n responseData: e.response?.data,\n responseStatus: e.response?.status,\n responseConfig: e.response?.config,\n ratelimitRemaining,\n ratelimitReset,\n service,\n };\n const message = safeJSONStringify(data);\n\n super(message);\n\n Object.assign(this, data);\n this.stack = e.stack;\n }\n}\n","import axios, { type AxiosError } from 'axios';\nimport * as rateLimit from 'axios-rate-limit';\nimport axiosRetry from 'axios-retry';\nimport { AxiosResponseErrorInterceptor } from '../utils/index.js';\nimport { ArcError } from './error.js';\n\nexport type ArcAbstractAPIOptions = {\n credentials: { organizationName: string; accessToken: string };\n apiPath: string;\n maxRPS?: number;\n};\n\nexport type ArcAPIOptions = Omit<ArcAbstractAPIOptions, 'apiPath'>;\n\nexport abstract class ArcAbstractAPI {\n protected name = this.constructor.name;\n protected client: rateLimit.RateLimitedAxiosInstance;\n\n private token = '';\n private host = '';\n private headers = {\n Authorization: '',\n };\n\n constructor(options: ArcAbstractAPIOptions) {\n this.host = `api.${options.credentials.organizationName}.arcpublishing.com`;\n this.token = `Bearer ${options.credentials.accessToken}`;\n this.headers.Authorization = this.token;\n\n const instance = axios.create({\n baseURL: `https://${this.host}/${options.apiPath}`,\n headers: this.headers,\n });\n\n // apply rate limiting\n this.client = (rateLimit as any).default(instance, { maxRPS: options.maxRPS || 10 });\n\n // apply retry\n const retry = typeof axiosRetry === 'function' ? axiosRetry : (axiosRetry as any).default;\n retry(this.client, {\n retries: 5,\n retryDelay: axiosRetry.exponentialDelay,\n retryCondition: (err: AxiosError) => this.retryCondition(err),\n });\n\n // wrap response errors\n this.client.interceptors.response.use(\n ...AxiosResponseErrorInterceptor((e) => {\n if (e instanceof ArcError) return e;\n return new ArcError(this.name, e);\n })\n );\n }\n\n setMaxRPS(rps: number) {\n this.client.setMaxRPS(rps);\n }\n\n retryCondition(error: AxiosError) {\n const status = error.response?.status;\n\n switch (status) {\n case axios.HttpStatusCode.RequestTimeout:\n case axios.HttpStatusCode.TooManyRequests:\n case axios.HttpStatusCode.InternalServerError:\n case axios.HttpStatusCode.BadGateway:\n case axios.HttpStatusCode.ServiceUnavailable:\n case axios.HttpStatusCode.GatewayTimeout:\n return true;\n default:\n return false;\n }\n }\n}\n","import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type { ListAuthorsParams, ListAuthorsResponse } from './types.js';\n\nexport class ArcAuthor extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'author' });\n }\n\n async listAuthors(params?: ListAuthorsParams): Promise<ListAuthorsResponse> {\n const { data } = await this.client.get('/v2/author-service', { params });\n\n return data;\n }\n\n async delete(userId: string): Promise<void> {\n const { data } = await this.client.delete(`/v2/author-service/${userId}`);\n\n return data;\n }\n}\n","import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type { ScheduleOperationPayload, UnscheduleOperationPayload } from './types.js';\n\nexport class ArcContentOps extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'contentops/v1' });\n }\n\n async schedulePublish(payload: ScheduleOperationPayload) {\n const { data } = await this.client.put<void>('/publish', payload);\n\n return data;\n }\n\n async scheduleUnpublish(payload: ScheduleOperationPayload) {\n const { data } = await this.client.put<void>('/unpublish', payload);\n\n return data;\n }\n\n async unscheduleUnpublish(payload: UnscheduleOperationPayload) {\n const { data } = await this.client.put<void>('/unschedule_unpublish', payload);\n\n return data;\n }\n\n async unschedulePublish(payload: UnscheduleOperationPayload) {\n const { data } = await this.client.put<void>('/unschedule_publish', payload);\n\n return data;\n }\n}\n","import type { ANS } from '../../types/index.js';\nimport { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type {\n GetStoriesByIdsParams,\n GetStoryParams,\n ScanParams,\n ScanResponse,\n SearchParams,\n SearchResponse,\n} from './types.js';\n\nexport class ArcContent extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'content/v4' });\n }\n\n async getStory(params: GetStoryParams): Promise<ANS.AStory> {\n const { data } = await this.client.get('/stories', { params });\n return data;\n }\n\n async search(params: SearchParams): Promise<SearchResponse> {\n const { data } = await this.client.get('/search', { params });\n return data;\n }\n\n async scan(params: ScanParams): Promise<ScanResponse> {\n const { data } = await this.client.get('/scan', { params });\n return data;\n }\n\n async getStoriesByIds(params: GetStoriesByIdsParams): Promise<SearchResponse> {\n const { data } = await this.client.get('/ids', {\n params: { ...params, ids: params.ids.join(',') },\n });\n return data;\n }\n}\n","import type { AxiosRequestConfig, AxiosResponse } from 'axios';\nimport { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\n\nexport interface RequestConfig extends AxiosRequestConfig {}\n\nexport class Custom extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: '' });\n }\n\n public async request<T = unknown>(\n endpoint: `/${string}`,\n config: AxiosRequestConfig = {}\n ): Promise<AxiosResponse<T>> {\n const response: AxiosResponse<T> = await this.client.request<T>({\n url: endpoint,\n ...config,\n });\n\n return response;\n }\n}\n","import type { ANS } from '../../types/index.js';\nimport { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type {\n Circulations,\n CreateDocumentRedirectPayload,\n CreateExternalRedirectPayload,\n CreateRedirectPayload,\n Document,\n DocumentRedirect,\n ExternalRedirect,\n Revision,\n Revisions,\n UpdateDraftRevisionPayload,\n} from './types.js';\n\nexport class ArcDraft extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'draft/v1' });\n }\n\n async generateId(id: string) {\n const { data } = await this.client.get<{ id: string }>('/arcuuid', { params: { id } });\n return data.id;\n }\n\n async createDocument(ans: ANS.AStory, type = 'story') {\n const { data } = await this.client.post<Document>(`/${type}`, ans);\n return data;\n }\n\n async publishDocument(id: string, type = 'story') {\n const { data } = await this.client.post<Revision>(`/${type}/${id}/revision/published`);\n return data;\n }\n\n async unpublishDocument(id: string, type = 'story') {\n const { data } = await this.client.delete<Revision>(`/${type}/${id}/revision/published`);\n return data;\n }\n\n async deleteDocument(id: string, type = 'story') {\n const { data } = await this.client.delete<Document>(`/${type}/${id}`);\n return data;\n }\n\n async getPublishedRevision(id: string, type = 'story') {\n const { data } = await this.client.get<Revision>(`/${type}/${id}/revision/published`);\n return data;\n }\n\n async getDraftRevision(id: string, type = 'story') {\n const { data } = await this.client.get<Revision>(`/${type}/${id}/revision/draft`);\n return data;\n }\n\n async getCirculations(id: string, type = 'story', after?: string) {\n const { data } = await this.client.get<Circulations>(`/${type}/${id}/circulation`, { params: { after } });\n return data;\n }\n\n async getRevisions(id: string, type = 'story', after?: string) {\n const { data } = await this.client.get<Revisions>(`/${type}/${id}/revision`, { params: { after } });\n return data;\n }\n\n async getRevision(id: string, revisionId: string, type = 'story') {\n const { data } = await this.client.get<Revision>(`/${type}/${id}/revision/${revisionId}`);\n return data;\n }\n\n async createRedirect<\n P extends CreateRedirectPayload,\n R = P extends CreateExternalRedirectPayload\n ? ExternalRedirect\n : P extends CreateDocumentRedirectPayload\n ? DocumentRedirect\n : never,\n >(website: string, websiteUrl: string, payload: P) {\n const { data } = await this.client.post<R>(`/redirect/${website}/${websiteUrl}`, payload);\n return data;\n }\n\n async getRedirect(website: string, websiteUrl: string) {\n const { data } = await this.client.get<ExternalRedirect | DocumentRedirect>(`/redirect/${website}/${websiteUrl}`);\n return data;\n }\n\n async updateDraftRevision(id: string, payload: UpdateDraftRevisionPayload, type = 'story') {\n const { data } = await this.client.put<Revision>(`/${type}/${id}/revision/draft`, payload);\n return data;\n }\n}\n","import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type { CreateDistributorPayload, Distributor, GetDistributorsParams, GetDistributorsResponse } from './types.js';\n\nexport class GlobalSettings extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'settings/v1' });\n }\n\n async getDistributors(params?: GetDistributorsParams) {\n const { data } = await this.client.get<GetDistributorsResponse>('/distributor', { params });\n\n return data;\n }\n\n async createDistributors(payload: CreateDistributorPayload): Promise<Distributor> {\n const { data } = await this.client.post('/distributor', payload);\n\n return data;\n }\n}\n","import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type { GetUserResponse, MigrateBatchUsersPayload, MigrateBatchUsersResponse, UserProfile } from './types.js';\n\nexport class ArcIdentity extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'identity/api/v1' });\n }\n\n async migrateBatch(payload: MigrateBatchUsersPayload) {\n const { data } = await this.client.post<MigrateBatchUsersResponse>('/migrate', payload);\n\n return data;\n }\n\n async *migrateBatchGenerator(\n payload: MigrateBatchUsersPayload,\n batchSize = 100\n ): AsyncGenerator<MigrateBatchUsersResponse> {\n const copy = [...payload.records];\n\n while (copy.length) {\n const records = copy.splice(0, batchSize);\n const response = await this.migrateBatch({ records });\n\n yield response;\n }\n }\n\n async getUser(id: string): Promise<GetUserResponse> {\n const { data } = await this.client.get(`/user?search=uuid=${id}`);\n\n return data;\n }\n\n async getUserByEmail(email: string): Promise<GetUserResponse> {\n const { data } = await this.client.get(`/user?search=email=${email}`);\n\n return data;\n }\n\n async updateUserProfile(id: string, payload: Partial<UserProfile>): Promise<UserProfile> {\n const { data } = await this.client.patch(`/profile/${id}`, payload);\n\n return data;\n }\n}\n","const importNodeModule = async (moduleId: string) => await import(moduleId);\n\nconst modules = {\n // make it like that so static analyzer of webpack won't bundle it\n fs: () => importNodeModule('node:fs') as Promise<typeof import('node:fs')>,\n path: () => importNodeModule('node:path') as Promise<typeof import('node:path')>,\n form_data: () => importNodeModule('form-data') as Promise<typeof import('form-data')>,\n};\n\nexport default modules;\n","import node from './node';\n\nexport default {\n ...node,\n};\n","import platform from '../../lib/platform/index.js';\nimport { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type {\n AddSecretPayload,\n Bundle,\n CreateIntegrationPayload,\n GenereteDeleteTokenResponse,\n GetBundlesResponse,\n GetSubscriptionsResponse,\n Integration,\n SubscribePayload,\n UpdateIntegrationPayload,\n} from './types.js';\n\nexport class ArcIFX extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'ifx/api/v1' });\n }\n\n async createIntegration(payload: CreateIntegrationPayload) {\n await this.client.post('/admin/integration', payload);\n }\n\n async updateIntegration(integrationName: string, payload: UpdateIntegrationPayload) {\n await this.client.put(`/admin/integration/${integrationName}`, payload);\n }\n\n async deleteIntegration(integrationName: string, token: string) {\n await this.client.delete(`/admin/integration/${integrationName}`, { params: { token } });\n }\n\n async generateDeleteIntegrationToken(integrationName: string) {\n const response = await this.client.get<GenereteDeleteTokenResponse>(`/admin/integration/${integrationName}/token`);\n\n return response.data;\n }\n\n async getIntegrations() {\n const { data } = await this.client.get<Integration[]>('/admin/integrations');\n return data;\n }\n\n async getJobs(integrationName: string) {\n const { data } = await this.client.get(`/admin/jobs/status/${integrationName}`);\n return data;\n }\n\n async getStatus(integrationName: string) {\n const { data } = await this.client.get(`/admin/integration/${integrationName}/provisionStatus`);\n return data;\n }\n\n async initializeQuery(integrationName: string, query?: string) {\n const { data } = await this.client.get<{ queryId: string }>(`/admin/logs/integration/${integrationName}?${query}`);\n return data;\n }\n\n async getLogs(queryId: string, raw = true) {\n const { data } = await this.client.get('/admin/logs/results', { params: { queryId, raw } });\n return data;\n }\n\n async subscribe(payload: SubscribePayload) {\n const { data } = await this.client.post('/admin/events/subscriptions', payload);\n return data;\n }\n\n async updateSubscription(payload: SubscribePayload) {\n const { data } = await this.client.put('/admin/events/subscriptions', payload);\n return data;\n }\n\n async getSubscriptions() {\n const { data } = await this.client.get<GetSubscriptionsResponse>('/admin/events/subscriptions');\n return data;\n }\n\n async addSecret(payload: AddSecretPayload) {\n const { data } = await this.client.post(`/admin/secret?integrationName=${payload.integrationName}`, {\n secretName: payload.secretName,\n secretValue: payload.secretValue,\n });\n return data;\n }\n\n async getSecrets(integrationName: string) {\n const { data } = await this.client.get(`/admin/secret?integrationName=${integrationName}`);\n return data;\n }\n\n async getBundles(integrationName: string) {\n const { data } = await this.client.get<GetBundlesResponse>(`/admin/bundles/${integrationName}`);\n return data;\n }\n\n async uploadBundle(integrationName: string, name: string, bundlePath: string) {\n const fs = await platform.fs();\n const FormData = await platform.form_data();\n\n const form = new FormData();\n\n console.log('platform', platform);\n console.log(form);\n const bundle = fs.createReadStream(bundlePath);\n\n form.append('bundle', bundle);\n form.append('name', name);\n\n const { data } = await this.client.post<Bundle>(`/admin/bundles/${integrationName}`, form, {\n headers: form.getHeaders(),\n });\n return data;\n }\n\n async deployBundle(integrationName: string, name: string) {\n const { data } = await this.client.post<Bundle>(`/admin/bundles/${integrationName}/deploy/${name}`);\n return data;\n }\n\n async promoteBundle(integrationName: string, version: number) {\n const { data } = await this.client.post<Bundle>(`/admin/bundles/${integrationName}/promote/${version}`);\n return data;\n }\n}\n","import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type {\n Count,\n CountParams,\n DetailReport,\n DetailReportParams,\n GetANSParams,\n GetRecentGroupIdsResponse,\n GetRemainingTimeParams,\n GetRemainingTimeResponse,\n PostANSParams,\n PostANSPayload,\n Summary,\n SummaryReportParams,\n} from './types.js';\n\nexport class ArcMigrationCenter extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'migrations/v3' });\n }\n\n async summary(params?: SummaryReportParams) {\n const { data, headers } = await this.client.get<Summary>('/report/summary', { params });\n const nextFromId: string | undefined = headers['amc-record-id'];\n\n return { records: data, nextFromId };\n }\n\n async detailed(params?: DetailReportParams) {\n const { data } = await this.client.get<DetailReport>('/report/detail', { params });\n return data;\n }\n\n async count(params?: CountParams) {\n const { data } = await this.client.get<Count>('/report/status/count', {\n params: {\n startDate: params?.startDate?.toISOString(),\n endDate: params?.endDate?.toISOString(),\n },\n });\n return data;\n }\n\n async postAns(params: PostANSParams, payload: PostANSPayload) {\n const { data } = await this.client.post('/content/ans', payload, { params });\n return data;\n }\n\n async getAns(params: GetANSParams) {\n const { data } = await this.client.get('/content/ans', { params });\n return data;\n }\n\n async getRemainingTime(params: GetRemainingTimeParams) {\n const { data } = await this.client.get<GetRemainingTimeResponse>('/report/remaining-time', { params });\n return data;\n }\n\n async getRecentGroupIds() {\n const { data } = await this.client.get<GetRecentGroupIdsResponse>('/report/group-ids');\n return data;\n }\n}\n","import type { ReadStream } from 'node:fs';\nimport platform from '../../lib/platform/index.js';\nimport type { ANS } from '../../types/index.js';\nimport { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type { GetGalleriesParams, GetGalleriesResponse, GetImagesParams, GetImagesResponse } from './types.js';\n\nexport class ArcProtoCenter extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'photo/api' });\n }\n async getImageDataById(imageId: string): Promise<ANS.AnImage> {\n const { data } = await this.client.get(`/v2/photos/${imageId}`);\n return data;\n }\n\n async uploadImageANS(image: ANS.AnImage) {\n const FormData = await platform.form_data();\n const form = new FormData();\n\n form.append('ans', JSON.stringify(image), {\n filename: 'ans.json',\n contentType: 'application/json',\n });\n const { data } = await this.client.post<ANS.AnImage>('/v2/photos', form, { headers: form.getHeaders() });\n return data;\n }\n\n async uploadImageStream(\n readableStream: ReadStream,\n options?: { contentType?: string; filename?: string }\n ): Promise<ANS.AnImage> {\n const path = await platform.path();\n const FormData = await platform.form_data();\n const form = new FormData();\n const contentType = options?.contentType ?? 'application/octet-stream';\n const filename = path.basename(String(options?.filename || readableStream.path || 'file.jpg'));\n\n form.append('file', readableStream, {\n filename: filename,\n contentType,\n });\n\n const { data } = await this.client.post('/v2/photos', form, { headers: form.getHeaders() });\n\n return data;\n }\n\n async deleteImage(imageId: string) {\n const { data } = await this.client.delete(`/v2/photos/${imageId}`);\n return data;\n }\n\n async deleteGallery(galleryId: string) {\n const { data } = await this.client.delete(`/v2/galleries/${galleryId}`);\n return data;\n }\n\n async getImages(params: GetImagesParams) {\n const { data } = await this.client.get<GetImagesResponse>('/v2/photos', { params });\n return data;\n }\n\n async getGalleries(params: GetGalleriesParams) {\n const { data } = await this.client.get<GetGalleriesResponse>('/v2/galleries', { params });\n return data;\n }\n\n async getGallery(galleryId: string) {\n const { data } = await this.client.get<ANS.AGallery>(`/v2/galleries/${galleryId}`);\n return data;\n }\n\n async updateImage(imageId: string, photoDto: ANS.AnImage) {\n const { data } = await this.client.put<ANS.AnImage>(`/v2/photos/${imageId}`, photoDto);\n return data;\n }\n}\n","import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type { ArcRedirectRuleContentType, ArcRedirectRuleType, ArcRedirectRulesResponse } from './types.js';\n\nexport class ArcRedirect extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'delivery-api/v1/cloudlet/redirector/site' });\n }\n\n async getRedirects(orgSiteEnv: string): Promise<ArcRedirectRulesResponse> {\n const { data } = await this.client.get(`/${orgSiteEnv}/rule?limit=1000`);\n return data;\n }\n\n async updateArcRedirectRule(\n orgSiteEnv: string,\n redirectID: string,\n redirectRuleContent: ArcRedirectRuleContentType\n ): Promise<ArcRedirectRuleType> {\n const { data } = await this.client.put(`/${orgSiteEnv}/rule/${redirectID}`, redirectRuleContent);\n return data;\n }\n\n async activateRedirectsVersion(orgSiteEnv: string): Promise<{ task_id: string }> {\n const { data } = await this.client.post(`/${orgSiteEnv}/version`);\n return data;\n }\n}\n","import * as ws from 'ws';\n\nexport type PromiseOr<T> = Promise<T> | T;\nexport type Callback<Args extends any[] = any[]> = (...args: Args) => PromiseOr<void>;\n\nexport class WsClient {\n private socket?: ws.WebSocket;\n\n constructor(\n private address: string,\n private readonly options: ws.ClientOptions\n ) {}\n\n onOpen?: Callback<[]>;\n onMessage?: Callback<[any]>;\n onClose?: Callback<[ws.CloseEvent | undefined]>;\n\n async connect() {\n if (this.socket && this.socket.readyState === this.socket.OPEN) return;\n\n const socket = new ws.WebSocket(this.address, this.options);\n this._closing = false;\n socket.onclose = (event) => this.close(event);\n\n await new Promise((resolve, reject) => {\n socket.onerror = (error) => reject(error);\n socket.onopen = () => resolve(true);\n });\n socket.onmessage = ({ data }) => {\n let message: Record<string, any>;\n try {\n message = JSON.parse(data.toString());\n } catch {\n throw new Error('failed to parse message');\n }\n\n this.onMessage?.(message);\n };\n\n this.socket = socket;\n this.onOpen?.();\n }\n\n private _closing = false;\n close(event?: ws.CloseEvent) {\n if (this._closing) return;\n this._closing = true;\n this.socket?.close();\n this.onClose?.(event);\n }\n\n async send(data: string) {\n this.throwIfNotOpen();\n\n await new Promise((resolve, reject) => {\n this.socket!.send(data, (error) => {\n error ? reject(error) : resolve(undefined);\n });\n });\n }\n\n private throwIfNotOpen() {\n if (!this.socket) {\n throw new Error('Client is not connected');\n }\n\n const { readyState, OPEN } = this.socket;\n if (readyState === OPEN) return;\n if (readyState < OPEN) {\n throw new Error('socket is still connecting');\n }\n if (readyState > OPEN) {\n throw new Error('socket was closed');\n }\n }\n}\n","import type { ArcAPIOptions } from '../abstract-api.js';\nimport { WsClient } from '../ws.client.js';\n\nexport class ArcRetailEvents {\n constructor(private readonly options: Pick<ArcAPIOptions, 'credentials'>) {}\n\n createWsClient(index: '0' | '1' | string = '0') {\n const address = `wss://api.${this.options.credentials.organizationName}.arcpublishing.com/retail/api/v1/event/stream/${index}`;\n const headers = {\n Authorization: `Bearer ${this.options.credentials.accessToken}`,\n };\n\n return new WsClient(address, { headers });\n }\n}\n","import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type {\n GetAllRetailCampaignCategoriesParams,\n GetAllRetailCampaignCategoriesResponse,\n GetAllRetailCampaignsParams,\n GetAllRetailCampaignsResponse,\n GetAllRetailConditionCategoriesParams,\n GetAllRetailConditionCategoriesResponse,\n GetAllRetailOfferAttributesParams,\n GetAllRetailOfferAttributesResponse,\n GetAllRetailOffersParams,\n GetAllRetailOffersResponse,\n GetAllRetailPricingRatesParams,\n GetAllRetailPricingRatesResponse,\n GetAllRetailPricingStrategiesParams,\n GetAllRetailPricingStrategiesResponse,\n GetAllRetailProductAttributesParams,\n GetAllRetailProductAttributesResponse,\n GetAllRetailProductsParams,\n GetAllRetailProductsResponse,\n GetRetailCampaignByIdParams,\n GetRetailCampaignByNameParams,\n GetRetailCampaignCategoryByIdParams,\n GetRetailOfferAttributeByIdParams,\n GetRetailOfferByIdParams,\n GetRetailPricingCycleParams,\n GetRetailPricingRateByIdParams,\n GetRetailPricingStrategyByIdParams,\n GetRetailProductAttributeByIdParams,\n GetRetailProductByIdParams,\n GetRetailProductByPriceCodeParams,\n GetRetailProductBySkuParams,\n RetailCampaign,\n RetailCampaignCategory,\n RetailOffer,\n RetailOfferAttribute,\n RetailPricingCycle,\n RetailPricingRate,\n RetailPricingStrategy,\n RetailProduct,\n RetailProductAttribute,\n} from './types.js';\n\nexport class ArcDeveloperRetail extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'retail/api/v1' });\n }\n\n // ============================================\n // Product Methods\n // ============================================\n\n async getProductById(id: number, params?: GetRetailProductByIdParams): Promise<RetailProduct> {\n const { data } = await this.client.get(`/product/${id}`, { params });\n return data;\n }\n\n async getProductBySku(sku: string, params?: GetRetailProductBySkuParams): Promise<RetailProduct> {\n const { data } = await this.client.get(`/product/sku/${sku}`, { params });\n return data;\n }\n\n async getProductByPriceCode(priceCode: number, params?: GetRetailProductByPriceCodeParams): Promise<RetailProduct> {\n const { data } = await this.client.get(`/product/pricecode/${priceCode}`, { params });\n return data;\n }\n\n async getAllProducts(params?: GetAllRetailProductsParams): Promise<GetAllRetailProductsResponse> {\n const { data } = await this.client.get('/product', { params });\n return data;\n }\n\n // ============================================\n // Pricing Strategy Methods\n // ============================================\n\n async getPricingStrategyById(\n id: number,\n params?: GetRetailPricingStrategyByIdParams\n ): Promise<RetailPricingStrategy> {\n const { data } = await this.client.get(`/pricing/strategy/${id}`, { params });\n return data;\n }\n\n async getAllPricingStrategies(\n params?: GetAllRetailPricingStrategiesParams\n ): Promise<GetAllRetailPricingStrategiesResponse> {\n const { data } = await this.client.get('/pricing/strategy', { params });\n return data;\n }\n\n // ============================================\n // Pricing Rate Methods\n // ============================================\n\n async getPricingRateById(id: number, params?: GetRetailPricingRateByIdParams): Promise<RetailPricingRate> {\n const { data } = await this.client.get(`/pricing/rate/${id}`, { params });\n return data;\n }\n\n async getAllPricingRates(params?: GetAllRetailPricingRatesParams): Promise<GetAllRetailPricingRatesResponse> {\n const { data } = await this.client.get('/pricing/rate', { params });\n return data;\n }\n\n // ============================================\n // Pricing Cycle Methods\n // ============================================\n\n async getPricingCycle(\n priceCode: number,\n cycleIndex: number,\n startDate: string,\n params?: GetRetailPricingCycleParams\n ): Promise<RetailPricingCycle> {\n const { data } = await this.client.get(`/pricing/cycle/${priceCode}/${cycleIndex}/${startDate}`, {\n params,\n });\n return data;\n }\n\n // ============================================\n // Campaign Methods\n // ============================================\n\n async getCampaignById(id: number, params?: GetRetailCampaignByIdParams): Promise<RetailCampaign> {\n const { data } = await this.client.get(`/campaign/${id}`, { params });\n return data;\n }\n\n async getCampaignByName(campaignName: string, params?: GetRetailCampaignByNameParams): Promise<RetailCampaign> {\n const { data } = await this.client.get(`/campaign/${campaignName}/get`, { params });\n return data;\n }\n\n async getAllCampaigns(params?: GetAllRetailCampaignsParams): Promise<GetAllRetailCampaignsResponse> {\n const { data } = await this.client.get('/campaign', { params });\n return data;\n }\n\n // ============================================\n // Campaign Category Methods\n // ============================================\n\n async getCampaignCategoryById(\n id: number,\n params?: GetRetailCampaignCategoryByIdParams\n ): Promise<RetailCampaignCategory> {\n const { data } = await this.client.get(`/campaign/category/${id}`, { params });\n return data;\n }\n\n async getAllCampaignCategories(\n params?: GetAllRetailCampaignCategoriesParams\n ): Promise<GetAllRetailCampaignCategoriesResponse> {\n const { data } = await this.client.get('/campaign/category', { params });\n return data;\n }\n\n // ============================================\n // Offer Methods\n // ============================================\n\n async getOfferById(id: number, params?: GetRetailOfferByIdParams): Promise<RetailOffer> {\n const { data } = await this.client.get(`/offer/${id}`, { params });\n return data;\n }\n\n async getAllOffers(params?: GetAllRetailOffersParams): Promise<GetAllRetailOffersResponse> {\n const { data } = await this.client.get('/offer', { params });\n return data;\n }\n\n // ============================================\n // Offer Attribute Methods\n // ============================================\n\n async getOfferAttributeById(id: number, params?: GetRetailOfferAttributeByIdParams): Promise<RetailOfferAttribute> {\n const { data } = await this.client.get(`/offer/attribute/${id}`, { params });\n return data;\n }\n\n async getAllOfferAttributes(\n params?: GetAllRetailOfferAttributesParams\n ): Promise<GetAllRetailOfferAttributesResponse> {\n const { data } = await this.client.get('/offer/attribute', { params });\n return data;\n }\n\n // ============================================\n // Product Attribute Methods\n // ============================================\n\n async getProductAttributeById(\n id: number,\n params?: GetRetailProductAttributeByIdParams\n ): Promise<RetailProductAttribute> {\n const { data } = await this.client.get(`/product/attribute/${id}`, { params });\n return data;\n }\n\n async getAllProductAttributes(\n params?: GetAllRetailProductAttributesParams\n ): Promise<GetAllRetailProductAttributesResponse> {\n const { data } = await this.client.get('/product/attribute', { params });\n return data;\n }\n\n // ============================================\n // Condition Category Methods\n // ============================================\n\n async getAllConditionCategories(\n params?: GetAllRetailConditionCategoriesParams\n ): Promise<GetAllRetailConditionCategoriesResponse> {\n const { data } = await this.client.get('/condition/categories', { params });\n return data;\n }\n}\n","import FormData from 'form-data';\nimport { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type {\n CreateEnterpriseGroupPayload,\n CreateEnterpriseGroupResponse,\n MigrateBatchSubscriptionsParams,\n MigrateBatchSubscriptionsPayload,\n MigrateBatchSubscriptionsResponse,\n} from './types.js';\n\nexport class ArcSales extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'sales/api/v1' });\n }\n\n async migrate(params: MigrateBatchSubscriptionsParams, payload: MigrateBatchSubscriptionsPayload) {\n const form = new FormData();\n form.append('file', JSON.stringify(payload), { filename: 'subs.json', contentType: 'application/json' });\n\n const { data } = await this.client.post<MigrateBatchSubscriptionsResponse>('/migrate', form, {\n params,\n headers: {\n ...form.getHeaders(),\n },\n });\n\n return data;\n }\n}\n\nexport class ArcSalesV2 extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'sales/api/v2' });\n }\n\n async createEnterpriseGroup(payload: CreateEnterpriseGroupPayload): Promise<CreateEnterpriseGroupResponse> {\n const { data } = await this.client.post<CreateEnterpriseGroupResponse>('/subscriptions/enterprise', payload);\n return data;\n }\n}\n","import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type { SignResponse } from './types.js';\n\nexport class ArcSigningService extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'signing-service' });\n }\n async sign(service: string, serviceVersion: string, imageId: string): Promise<SignResponse> {\n const { data } = await this.client.get(`/v2/sign/${service}/${serviceVersion}?value=${encodeURI(imageId)}`);\n return data;\n }\n}\n","import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type {\n GetLinksParams,\n GetLinksResponse,\n GetSectionParams,\n GetSectionsResponse,\n Link,\n Section,\n SetSectionPayload,\n Website,\n} from './types.js';\n\nexport class ArcSite extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'site/v3' });\n }\n\n async getSections(params: GetSectionParams) {\n const { data } = await this.client.get<GetSectionsResponse>(`/website/${params.website}/section`, {\n params: { _website: params.website, ...params },\n });\n\n return data;\n }\n\n async getSection(id: string, website: string) {\n const { data } = await this.client.get<Section>(`/website/${website}/section?_id=${id}`);\n\n return data;\n }\n\n async deleteSection(id: string, website: string) {\n await this.client.delete(`/website/${website}/section?_id=${id}`);\n }\n\n async putSection(section: SetSectionPayload) {\n const { data } = await this.client.put(`/website/${section.website}/section?_id=${section._id}`, section);\n\n return data;\n }\n\n async getWebsites() {\n const { data } = await this.client.get<Website[]>('/website');\n\n return data;\n }\n\n async putLink(link: Link) {\n const { data } = await this.client.put<Link>(`/website/${link._website}/link/${link._id}`, link);\n\n return data;\n }\n\n async deleteLink(id: string, website: string) {\n const { data } = await this.client.delete(`/website/${website}/link/${id}`);\n\n return data;\n }\n\n async getLinks(params: GetLinksParams) {\n const { data } = await this.client.get<GetLinksResponse>(`/website/${params.website}/link`, { params });\n\n return data;\n }\n}\n","import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type {\n AddTagsPayload,\n AddTagsResponse,\n DeleteTagPayload,\n DeleteTagsResponse,\n GetAllTagsParams,\n GetTagsResponse,\n SearchTagsParams,\n SearchTagsV2Params,\n} from './types.js';\n\nexport class ArcTags extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'tags' });\n }\n\n async getAllTags(params: GetAllTagsParams) {\n const { data } = await this.client.get<GetTagsResponse>('/', { params });\n return data;\n }\n\n /*\n * @Deprecated\n * May return incorrect results\n * Use searchTagsV2 instead\n */\n async searchTags(params: SearchTagsParams) {\n const { data } = await this.client.get<GetTagsResponse>('/search', { params });\n return data;\n }\n\n async searchTagsV2(params: SearchTagsV2Params) {\n const { data } = await this.client.get<GetTagsResponse>('/v2/search', { params });\n return data;\n }\n\n async addTags(payload: AddTagsPayload) {\n const { data } = await this.client.post<AddTagsResponse>('/add', payload);\n return data;\n }\n\n async deleteTags(payload: DeleteTagPayload) {\n const { data } = await this.client.post<DeleteTagsResponse>('/delete', payload);\n return data;\n }\n}\n","import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type {\n CreateTaskPayload,\n CreateTaskResponse,\n GetEditionTimesResponse,\n GetPublicationsResponse,\n GetStatusesResponse,\n ReportStatusChangePayload,\n SectionEdition,\n WebskedPublication,\n} from './types.js';\n\nexport class ArcWebsked extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'websked' });\n }\n\n async reportStatusChange(payload: ReportStatusChangePayload): Promise<void> {\n const { data } = await this.client.post<void>('/tasks/workflowStatusChange', payload);\n return data;\n }\n\n async createTask(payload: CreateTaskPayload): Promise<CreateTaskResponse> {\n const { data } = await this.client.post('/tasks', payload);\n return data;\n }\n\n async getEditionTimes(\n publicationId: string,\n startDate: number,\n endDate: number,\n numEditions = 1\n ): Promise<GetEditionTimesResponse> {\n const { data } = await this.client.get(`/publications/${publicationId}/editionTimes`, {\n params: { startDate, endDate, numEditions },\n });\n return data;\n }\n\n async getSectionStories(\n publicationId: string,\n sectionId: string,\n timestamp: number,\n includeStories = true\n ): Promise<SectionEdition> {\n const { data } = await this.client.get(\n `/publications/${publicationId}/sections/${sectionId}/editions/${timestamp}`,\n { params: { includeStories } }\n );\n return data;\n }\n\n async getSectionEditions(\n publicationId: string,\n sectionId: string,\n startDate: number,\n numEditions = 100\n ): Promise<SectionEdition[]> {\n const { data } = await this.client.get(`/publications/${publicationId}/sections/${sectionId}/editions`, {\n params: { startDate, numEditions },\n });\n return data;\n }\n\n async getPublications(nameRegex: string): Promise<GetPublicationsResponse> {\n const { data } = await this.client.get('/publications', { params: { nameRegex } });\n return data;\n }\n\n async getPublicationById(publicationId: string): Promise<WebskedPublication> {\n const { data } = await this.client.get(`/publications/${publicationId}`);\n return data;\n }\n\n async getStatuses(): Promise<GetStatusesResponse> {\n const { data } = await this.client.get('/statuses');\n return data;\n }\n}\n","import type { ArcAPIOptions } from './abstract-api.js';\nimport { ArcAuthor } from './author/index.js';\nimport { ArcContentOps } from './content-ops/index.js';\nimport { ArcContent } from './content/index.js';\nimport { Custom } from './custom/index.js';\nimport { ArcDraft } from './draft/index.js';\nimport { GlobalSettings } from './global-settings/index.js';\nimport { ArcIdentity } from './identity/index.js';\nimport { ArcIFX } from './ifx/index.js';\nimport { ArcMigrationCenter } from './migration-center/index.js';\nimport { ArcProtoCenter } from './photo-center/index.js';\nimport { ArcRedirect } from './redirect/index.js';\nimport { ArcRetailEvents } from './retail-events/index.js';\nimport { ArcDeveloperRetail } from './developer-retail/index.js';\nimport { ArcSales, ArcSalesV2 } from './sales/index.js';\nimport { ArcSigningService } from './signing-service/index.js';\nimport { ArcSite } from './site/index.js';\nimport { ArcTags } from './tags/index.js';\nimport { ArcWebsked } from './websked/index.js';\n\nexport const ArcAPI = (options: ArcAPIOptions) => {\n const API = {\n Author: new ArcAuthor(options),\n Draft: new ArcDraft(options),\n Identity: new ArcIdentity(options),\n IFX: new ArcIFX(options),\n Redirect: new ArcRedirect(options),\n MigrationCenter: new ArcMigrationCenter(options),\n Sales: new ArcSales(options),\n SalesV2: new ArcSalesV2(options),\n Site: new ArcSite(options),\n Websked: new ArcWebsked(options),\n Content: new ArcContent(options),\n SigningService: new ArcSigningService(options),\n PhotoCenter: new ArcProtoCenter(options),\n GlobalSettings: new GlobalSettings(options),\n Tags: new ArcTags(options),\n ContentOps: new ArcContentOps(options),\n RetailEvents: new ArcRetailEvents(options),\n DeveloperRetail: new ArcDeveloperRetail(options),\n Custom: new Custom(options),\n };\n\n API.MigrationCenter.setMaxRPS(12);\n API.Draft.setMaxRPS(4);\n API.Content.setMaxRPS(3);\n\n return API;\n};\n\nexport type ArcAPIType = ReturnType<typeof ArcAPI>;\n","/* eslint-disable */\n/**\n * This file was automatically generated by json-schema-to-typescript.\n * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,\n * and run json-schema-to-typescript to regenerate this file.\n */\n\n/**\n * A globally unique identifier of the content in the ANS repository.\n */\nexport type GloballyUniqueIDTrait = string;\n/**\n * The version of ANS that this object was serialized as, in major.minor.patch format. For top-level content objects, this is a required trait.\n */\nexport type DescribesTheANSVersionOfThisObject = '0.10.12';\n/**\n * A user-defined categorization method to supplement type. In Arc, this field is reserved for organization-defined purposes, such as selecting the PageBuilder template that should be used to render a document.\n */\nexport type SubtypeOrTemplate = string;\n/**\n * An optional list of output types for which this element should be visible\n */\nexport type ChannelTrait = string[];\n/**\n * A property used to determine horizontal positioning of a content element relative to the elements that immediately follow it in the element sequence.\n */\nexport type Alignment = 'left' | 'right' | 'center';\n/**\n * The primary language of the content. The value should follow IETF BCP47. (e.g. 'en', 'es-419', etc.)\n */\nexport type Locale = string;\n/**\n * A copyright notice for the legal owner of this content. E.g., '© 1996-2018 The Washington Post.' Format may vary between organizations.\n */\nexport type CopyrightInformation = string;\n/**\n * The relative URL to this document on the website specified by the `canonical_website` field. In the Arc ecosystem, this will be populated by the content api from the arc-canonical-url service if present based on the canonical_website. In conjunction with canonical_website, it can be used to determine the SEO canonical url or open graph url. In a multi-site context, this field may be different from the website_url field.\n */\nexport type CanonicalURL = string;\n/**\n * The _id of the website from which this document was originally authored. In conjunction with canonical_url, it can be used to determine the SEO canonical url or open graph url. In a multi-site context, this field may be different from the website field.\n */\nexport type CanonicalWebsite = string;\n/**\n * The _id of the website on which this document exists. This field is only available in Content API. If different from canonical_website, then this document was originally sourced from the canonical_website. Generated at fetch time by Content API.\n */\nexport type Website = string;\n/**\n * The relative URL to this document on the website specified by the `website` field. In a multi-site context, this is the url that is typically queried on when fetching by URL. It may be different than canonical_url. Generated at fetch time by Content API.\n */\nexport type WebsiteURL = string;\n/**\n * A url-shortened version of the canonical url.\n */\nexport type Short_Url = string;\n/**\n * When the content was originally created (RFC3339-formatted). In the Arc ecosystem, this will be automatically generated for stories in the Story API.\n */\nexport type CreatedDate = string;\n/**\n * When the content was last updated (RFC3339-formatted).\n */\nexport type LastUpdatedDate = string;\n/**\n * When the story was published.\n */\nexport type Publish_Date = string;\n/**\n * When the story was first published.\n */\nexport type FirstPublishDate = string;\n/**\n * The RFC3339-formatted dated time of the most recent date the story was (re)displayed on a public site.\n */\nexport type Display_Date = string;\n/**\n * A description of the location, useful if a full address or lat/long specification is overkill.\n */\nexport type LocationRelatedTrait = string;\n/**\n * Additional information to be displayed near the content from the editor.\n */\nexport type Editor_Note = string;\n/**\n * Optional field to story story workflow related status (e.g. published/embargoed/etc)\n */\nexport type Status = string;\n/**\n * The full human name of contributor. See also byline, first_name, last_name, middle_name, suffix.\n */\nexport type Name = string;\n/**\n * The primary author(s) of this document. For a story, is is the writer or reporter. For an image, it is the photographer.\n */\nexport type By1 = (AnAuthorOfAPieceOfContent | RepresentationOfANormalizedElement)[];\n/**\n * The photographer(s) of supplementary images included in this document, if it is a story. Note that if this document is an image, the photographer(s) should appear in the 'by' slot.\n */\nexport type PhotosBy = (AnAuthorOfAPieceOfContent | RepresentationOfANormalizedElement)[];\n/**\n * A short reference name for internal editorial use\n */\nexport type Slug = string;\n/**\n * Foreign ID of embedded item.\n */\nexport type EmbedID = string;\n/**\n * Provider URL for this embed item. When concatenated with Embed ID, should produce a URL that returns json metadata about the embedded content.\n */\nexport type EmbedProviderURL = string;\n/**\n * This note is used for shared communication inside the newsroom.\n */\nexport type InternalNote = string;\n/**\n * Used for the newsroom to identify what the story is about, especially if a user is unfamiliar with the slug of a story and the headline or they do not yet exist. Newsroom use only.\n */\nexport type BudgetLine = string;\n/**\n * Information about a third party that provided this content from outside this document's hosted organization.\n */\nexport type Distributor =\n | {\n /**\n * The human-readable name of the distributor of this content. E.g., Reuters.\n */\n name?: string;\n /**\n * The machine-readable category of how this content was produced. Use 'staff' if this content was produced by an employee of the organization who owns this document repository. (Multisite note: content produced within a single *organization*, but shared across multiple *websites* should still be considered 'staff.') Use ‘wires’ if this content was produced for another organization and shared with the one who owns this document repository. Use 'freelance' if this content was produced by an individual on behalf of the organization who owns this document repository. Use 'stock' if this content is stock media distributed directly from a stock media provider. Use 'handout' if this is content provided from a source for an article (usually promotional media distributed directly from a company). Use 'other' for all other cases.\n */\n category?: 'staff' | 'wires' | 'freelance' | 'stock' | 'handout' | 'other';\n /**\n * The machine-readable subcategory of how this content was produced. E.g., 'freelance - signed'. May vary between organizations.\n */\n subcategory?: string;\n additional_properties?: HasAdditionalProperties;\n mode?: 'custom';\n }\n | {\n /**\n * The ARC UUID of the distributor of this content. E.g., ABCDEFGHIJKLMNOPQRSTUVWXYZ.\n */\n reference_id: string;\n mode: 'reference';\n };\n/**\n * An list of alternate names that this content can be fetched by instead of id.\n */\nexport type AliasesTrait = string[];\n/**\n * A more specific category for an image.\n */\nexport type ImageType = string;\n/**\n * The direct ANS equivalent of the HTML 'alt' attribute. A description of the contents of an image for improved accessibility.\n */\nexport type AltText = string;\n/**\n * Human-friendly filename used by PageBuilder & Resizer to improve image SEO scoring.\n */\nexport type SEOFilename = string;\n/**\n * Links to various social media\n */\nexport type SocialLinks = {\n site?: string;\n url?: string;\n [k: string]: unknown;\n}[];\n/**\n * The real first name of a human author.\n */\nexport type FirstName = string;\n/**\n * The real middle name of a human author.\n */\nexport type MiddleName = string;\n/**\n * The real last name of a human author.\n */\nexport type LastName = string;\n/**\n * The real suffix of a human author.\n */\nexport type Suffix = string;\n/**\n * The public-facing name, or nom-de-plume, name of the author.\n */\nexport type Byline = string;\n/**\n * The city or locality that the author resides in or is primarily associated with.\n */\nexport type Location = string;\n/**\n * The desk or group that this author normally reports to. E.g., 'Politics' or 'Sports.'\n */\nexport type Division = string;\n/**\n * The professional email address of this author.\n */\nexport type EMail = string;\n/**\n * The organizational role or title of this author.\n */\nexport type Role = string;\n/**\n * A comma-delimited list of subjects the author in which the author has expertise.\n */\nexport type Expertise = string;\n/**\n * The name of an organization the author is affiliated with. E.g., The Washington Post, or George Mason University.\n */\nexport type Affiliation = string;\n/**\n * A description of list of languages that the author is somewhat fluent in, excluding the native language of the parent publication, and identified in the language of the parent publication. E.g., Russian, Japanese, Greek.\n */\nexport type Languages = string;\n/**\n * A one or two sentence description of the author.\n */\nexport type ShortBiography = string;\n/**\n * The full biography of the author.\n */\nexport type LongBiography = string;\n/**\n * The book title.\n */\nexport type Title = string;\n/**\n * A link to a page to purchase or learn more about the book.\n */\nexport type URL = string;\n/**\n * A list of books written by the author.\n */\nexport type Books = Book[];\n/**\n * The name of the school.\n */\nexport type SchoolName = string;\n/**\n * A list of schools that this author has graduated from.\n */\nexport type Education = School[];\n/**\n * The name of the award.\n */\nexport type AwardName = string;\n/**\n * A list of awards the author has received.\n */\nexport type Awards = {\n award_name?: AwardName;\n}[];\n/**\n * If true, this author is an external contributor to the publication.\n */\nexport type Contributor = boolean;\n/**\n * Deprecated. In ANS 0.5.8 and prior versions, this field is populated with the 'location' field from Arc Author Service. New implementations should use the 'location' and 'affiliation' field. Content should be identical to 'location.'\n */\nexport type Org = string;\n/**\n * Links to various social media\n */\nexport type SocialLinks1 = {\n site?: string;\n url?: string;\n [k: string]: unknown;\n}[];\n/**\n * The primary author(s) of this document. For a story, is is the writer or reporter. For an image, it is the photographer.\n */\nexport type By = (AnAuthorOfAPieceOfContent | RepresentationOfANormalizedElement)[];\n/**\n * The photographer(s) of supplementary images included in this document, if it is a story. Note that if this document is an image, the photographer(s) should appear in the 'by' slot.\n */\nexport type PhotosBy1 = (AnAuthorOfAPieceOfContent | RepresentationOfANormalizedElement)[];\n/**\n * Holds attributes of an ANS collection - a common parent to story and gallery objects.\n */\nexport type ACollectionOfContent = AnElementThatCanBeListedAsPartOfContentElements[];\n/**\n * The absolute URL of the document on website which will override any relative URL specified by the `canonical_url` field.\n */\nexport type CanonicalExternalURL = string;\n/**\n * Trait that applies a list of corrections to a document.\n */\nexport type Corrections = Correction[];\n/**\n * True if and only if at least one published edition exists for this content item.\n */\nexport type HasPublishedEdition = boolean;\n/**\n * The machine-readable identifier of this edition. This should be the same as the key in 'editions' for the edition object.\n */\nexport type EditionName = string;\n/**\n * The machine-generated date that this edition was last updated (i.e., that the content item was published/unpublished to a particular destination.)\n */\nexport type EditionDate = string;\n/**\n * The machine-generated date that this edition was created for the first time (i.e., that the content item was first published.)\n */\nexport type FirstPublishedDateEdition = string;\n/**\n * The human-editable date that should be shown to readers as the 'date' for this content item. When viewing the story at this edition name directly, this will override whatever value is set for Display Date on the story directly. After an edition is created, subsequent updates to that edition will not change this date unless otherwise specified.\n */\nexport type DisplayDateEdition = string;\n/**\n * The machine-editable date that should be shown to readers as the 'publish date' for this content item. When viewing the story at this edition name directly, this will override whatever value is set for Publish Date on the story directly. Every time an edition is updated (i.e. a story is republished) this date will also be updated unless otherwise specified.\n */\nexport type PublishDateEdition = string;\n/**\n * If false, this edition has been deleted/unpublished.\n */\nexport type PublishStatus = boolean;\n/**\n * The id of the revision that this edition was created from. Omitted if unpublished.\n */\nexport type RevisionID = string;\n/**\n * The revision id to be published.\n */\nexport type RevisionIDOperation = string;\n/**\n * The name of the edition this operation will publish to.\n */\nexport type EditionNameOperation = string;\n/**\n * The date that this operation will be performed.\n */\nexport type OperationDate = string;\n/**\n * The name of the edition this operation will publish to.\n */\nexport type EditionNameOperation1 = string;\n/**\n * The date that this operation will be performed.\n */\nexport type OperationDate1 = string;\n/**\n * A globally unique identifier of the content in the ANS repository.\n */\nexport type GloballyUniqueIDTrait1 = string;\n/**\n * Any voice transcripts (e.g. text-to-speech or author-narrations) of the document requested by the user, along with configuration information and the resulting output.\n *\n * @minItems 1\n */\nexport type VoiceTranscriptSConfigurationAndOutput = [\n {\n _id?: GloballyUniqueIDTrait;\n type?: 'voice_transcript';\n subtype?: SubtypeOrTemplate;\n options: OptionsRequested;\n options_used?: OptionsUsed;\n output?: HttpsRawGithubusercontentComWashingtonpostAnsSchemaMasterSrcMainResourcesSchemaAns01012AudioJson;\n [k: string]: unknown;\n },\n ...{\n _id?: GloballyUniqueIDTrait;\n type?: 'voice_transcript';\n subtype?: SubtypeOrTemplate;\n options: OptionsRequested;\n options_used?: OptionsUsed;\n output?: HttpsRawGithubusercontentComWashingtonpostAnsSchemaMasterSrcMainResourcesSchemaAns01012AudioJson;\n [k: string]: unknown;\n }[],\n];\n/**\n * If true, then a transcript of the appropriate options was requested for this document.\n */\nexport type Enabled = boolean;\n/**\n * The id of the 'voice' used to read aloud an audio transcript.\n */\nexport type VoiceID = string;\n/**\n * If true, then a transcript of the appropriate options was generated for this document.\n */\nexport type Enabled1 = boolean;\n/**\n * The id of the 'voice' used to read aloud an audio transcript.\n */\nexport type VoiceID1 = string;\n/**\n * Audio Content\n */\nexport type HttpsRawGithubusercontentComWashingtonpostAnsSchemaMasterSrcMainResourcesSchemaAns01012AudioJson = {\n type: 'audio';\n _id?: GloballyUniqueIDTrait;\n version: DescribesTheANSVersionOfThisObject;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n language?: Locale;\n copyright?: CopyrightInformation;\n canonical_url?: CanonicalURL;\n short_url?: Short_Url;\n created_date?: CreatedDate;\n last_updated_date?: LastUpdatedDate;\n publish_date?: Publish_Date;\n first_publish_date?: FirstPublishDate;\n display_date?: Display_Date;\n location?: LocationRelatedTrait;\n geo?: Geo;\n address?: Address;\n editor_note?: Editor_Note;\n status?: Status;\n headlines?: Headlines;\n subheadlines?: SubHeadlines;\n description?: Description;\n credits?: CreditTrait;\n vanity_credits?: VanityCreditsTrait;\n taxonomy?: Taxonomy;\n promo_items?: PromoItems;\n related_content?: Related_Content;\n owner?: OwnerInformation;\n planning?: SchedulingInformation;\n workflow?: WorkflowInformation;\n pitches?: Pitches;\n revision?: Revision;\n syndication?: Syndication;\n source?: Source;\n distributor?: Distributor;\n tracking?: Tracking;\n comments?: Comments;\n label?: Label;\n slug?: Slug;\n content_restrictions?: ContentRestrictions;\n additional_properties?: HasAdditionalProperties;\n content_aliases?: AliasesTrait;\n /**\n * (Deprecated.) The audio source file. Use 'streams' instead.\n */\n source_url?: string;\n /**\n * (Deprecated.) Mime type of audio source file. Use 'streams' instead.\n */\n mimetype?: string;\n /**\n * Whether to autoplay is enabled.\n */\n autoplay?: boolean;\n /**\n * Whether controls are enabled.\n */\n controls?: boolean;\n /**\n * Whether looping is enabled.\n */\n loop?: boolean;\n /**\n * Whether preload is enabled.\n */\n preload?: boolean;\n /**\n * The different streams this audio can play in.\n *\n * @minItems 1\n */\n streams?: [AStreamOfAudio, ...AStreamOfAudio[]];\n} & (\n | {\n [k: string]: unknown;\n }\n | {\n [k: string]: unknown;\n }\n);\n/**\n * The size of the audio file in bytes.\n */\nexport type FileSize = number;\n/**\n * The codec used to encode the audio stream. (E.g. mpeg)\n */\nexport type AudioCodec = string;\n/**\n * The type of audio (e.g. mp3).\n */\nexport type AudioStreamType = string;\n/**\n * The file location of the stream.\n */\nexport type URL1 = string;\n/**\n * The bitrate of the audio in kilobytes per second.\n */\nexport type Bitrate = number;\n\nexport interface Root {\n gallery_root: AGallery;\n story_root: AStory;\n video_root: VideoContent;\n}\n/**\n * Holds attributes of an ANS gallery. In the Arc ecosystem, these are stored in Anglerfish.\n */\nexport interface AGallery {\n type: 'gallery';\n _id?: GloballyUniqueIDTrait;\n version: DescribesTheANSVersionOfThisObject;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n language?: Locale;\n copyright?: CopyrightInformation;\n canonical_url?: CanonicalURL;\n canonical_website?: CanonicalWebsite;\n website?: Website;\n website_url?: WebsiteURL;\n short_url?: Short_Url;\n created_date?: CreatedDate;\n last_updated_date?: LastUpdatedDate;\n publish_date?: Publish_Date;\n first_publish_date?: FirstPublishDate;\n display_date?: Display_Date;\n location?: LocationRelatedTrait;\n geo?: Geo;\n address?: Address;\n editor_note?: Editor_Note;\n status?: Status;\n headlines?: Headlines;\n subheadlines?: SubHeadlines;\n description?: Description;\n credits?: CreditTrait;\n vanity_credits?: VanityCreditsTrait;\n taxonomy?: Taxonomy;\n promo_items?: PromoItems;\n related_content?: Related_Content;\n owner?: OwnerInformation;\n planning?: SchedulingInformation;\n workflow?: WorkflowInformation;\n pitches?: Pitches;\n revision?: Revision;\n syndication?: Syndication;\n source?: Source;\n distributor?: Distributor;\n tracking?: Tracking;\n comments?: Comments;\n label?: Label;\n slug?: Slug;\n content_restrictions?: ContentRestrictions;\n additional_properties?: HasAdditionalProperties;\n content_aliases?: AliasesTrait;\n content_elements?: ACollectionOfContent;\n websites?: WebsitesInput;\n contributors?: Contributors;\n}\n/**\n * Latitidue and Longitude of the content\n */\nexport interface Geo {\n latitude?: number;\n longitude?: number;\n [k: string]: unknown;\n}\n/**\n * An Address following the convention of http://microformats.org/wiki/hcard\n */\nexport interface Address {\n post_office_box?: string;\n extended_address?: string;\n street_address?: string;\n locality?: string;\n region?: string;\n postal_code?: string;\n country_name?: string;\n additional_properties?: HasAdditionalProperties;\n}\n/**\n * A grab-bag object for non-validatable data.\n */\nexport interface HasAdditionalProperties {\n [k: string]: unknown;\n}\n/**\n * The headline(s) or title for this content. The 'basic' key is required.\n */\nexport interface Headlines {\n basic: string;\n /**\n * This interface was referenced by `Headlines`'s JSON-Schema definition\n * via the `patternProperty` \".*\".\n *\n * This interface was referenced by `SubHeadlines`'s JSON-Schema definition\n * via the `patternProperty` \".*\".\n *\n * This interface was referenced by `Description`'s JSON-Schema definition\n * via the `patternProperty` \".*\".\n */\n [k: string]: string;\n}\n/**\n * The sub-headline(s) for the content.\n */\nexport interface SubHeadlines {\n basic: string;\n /**\n * This interface was referenced by `Headlines`'s JSON-Schema definition\n * via the `patternProperty` \".*\".\n *\n * This interface was referenced by `SubHeadlines`'s JSON-Schema definition\n * via the `patternProperty` \".*\".\n *\n * This interface was referenced by `Description`'s JSON-Schema definition\n * via the `patternProperty` \".*\".\n */\n [k: string]: string;\n}\n/**\n * The descriptions, or blurbs, for the content.\n */\nexport interface Description {\n basic: string;\n /**\n * This interface was referenced by `Headlines`'s JSON-Schema definition\n * via the `patternProperty` \".*\".\n *\n * This interface was referenced by `SubHeadlines`'s JSON-Schema definition\n * via the `patternProperty` \".*\".\n *\n * This interface was referenced by `Description`'s JSON-Schema definition\n * via the `patternProperty` \".*\".\n */\n [k: string]: string;\n}\n/**\n * A list of people and groups attributed to this content, keyed by type of contribution. In the Arc ecosystem, references in this list will be denormalized into author objects from the arc-author-service.\n */\nexport interface CreditTrait {\n by?: By;\n photos_by?: PhotosBy1;\n /**\n * This interface was referenced by `CreditTrait`'s JSON-Schema definition\n * via the `patternProperty` \"^[a-zA-Z0-9_]*\".\n */\n [k: string]: (AnAuthorOfAPieceOfContent | RepresentationOfANormalizedElement)[] | undefined;\n}\n/**\n * Models attribution to an individual or group for contribution towards some content item. In the Arc ecosystem, these are stored in the arc-author-service.\n */\nexport interface AnAuthorOfAPieceOfContent {\n _id?: GloballyUniqueIDTrait;\n /**\n * Indicates that this is an author\n */\n type: 'author';\n version?: DescribesTheANSVersionOfThisObject;\n name: Name;\n image?: AnImage;\n /**\n * A link to an author's landing page on the website, or a personal website.\n */\n url?: string;\n social_links?: SocialLinks;\n slug?: Slug;\n first_name?: FirstName;\n middle_name?: MiddleName;\n last_name?: LastName;\n suffix?: Suffix;\n byline?: Byline;\n location?: Location;\n division?: Division;\n email?: EMail;\n role?: Role;\n expertise?: Expertise;\n affiliation?: Affiliation;\n languages?: Languages;\n bio?: ShortBiography;\n long_bio?: LongBiography;\n books?: Books;\n education?: Education;\n awards?: Awards;\n contributor?: Contributor;\n org?: Org;\n socialLinks?: SocialLinks1;\n additional_properties?: HasAdditionalProperties;\n}\n/**\n * Holds attributes of an ANS image component. In the Arc ecosystem, these are stored in Anglerfish.\n */\nexport interface AnImage {\n type: 'image';\n _id?: GloballyUniqueIDTrait;\n version: DescribesTheANSVersionOfThisObject;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n language?: Locale;\n copyright?: CopyrightInformation;\n canonical_url?: CanonicalURL;\n short_url?: Short_Url;\n created_date?: CreatedDate;\n last_updated_date?: LastUpdatedDate;\n publish_date?: Publish_Date;\n first_publish_date?: FirstPublishDate;\n display_date?: Display_Date;\n location?: LocationRelatedTrait;\n geo?: Geo;\n address?: Address;\n editor_note?: Editor_Note;\n status?: Status;\n headlines?: Headlines;\n subheadlines?: SubHeadlines;\n description?: Description;\n credits?: CreditTrait;\n vanity_credits?: VanityCreditsTrait;\n taxonomy?: Taxonomy;\n promo_items?: PromoItems;\n related_content?: Related_Content;\n owner?: OwnerInformation;\n planning?: SchedulingInformation;\n workflow?: WorkflowInformation;\n pitches?: Pitches;\n revision?: Revision;\n syndication?: Syndication;\n source?: Source;\n distributor?: Distributor;\n tracking?: Tracking;\n comments?: Comments;\n label?: Label;\n slug?: Slug;\n content_restrictions?: ContentRestrictions;\n image_type?: ImageType;\n alt_text?: AltText;\n focal_point?: FocalPoint;\n auth?: Auth;\n seo_filename?: SEOFilename;\n additional_properties?: HasAdditionalProperties;\n /**\n * Subtitle for the image.\n */\n subtitle?: string;\n /**\n * Caption for the image.\n */\n caption?: string;\n /**\n * URL for the image.\n */\n url?: string;\n /**\n * Width for the image.\n */\n width?: number;\n /**\n * Height for the image.\n */\n height?: number;\n /**\n * True if the image can legally be licensed to others.\n */\n licensable?: boolean;\n contributors?: Contributors;\n}\n/**\n * Similar to the credits trait, but to be used only when ANS is being directly rendered to readers natively. For legal and technical reasons, the `credits` trait is preferred when converting ANS into feeds or other distribution formats. However, when present, `vanity_credits` allows more sophisticated credits presentation to override the default without losing that original data.\n */\nexport interface VanityCreditsTrait {\n by?: By1;\n photos_by?: PhotosBy;\n /**\n * This interface was referenced by `VanityCreditsTrait`'s JSON-Schema definition\n * via the `patternProperty` \"^[a-zA-Z0-9_]*\".\n */\n [k: string]: (AnAuthorOfAPieceOfContent | RepresentationOfANormalizedElement)[] | undefined;\n}\n/**\n * This represents a reference to external content that should be denormalized\n */\nexport interface RepresentationOfANormalizedElement {\n type: 'reference';\n additional_properties?: HasAdditionalProperties;\n _id?: GloballyUniqueIDTrait;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n referent: {\n /**\n * The ANS type that the provider should return.\n */\n type?: string;\n /**\n * The type of interaction the provider expects. E.g., 'oembed'\n */\n service?: string;\n /**\n * The id passed to the provider to retrieve an ANS document\n */\n id: string;\n /**\n * A URL that can resolve the id into an ANS element\n */\n provider?: string;\n /**\n * The website which the referenced id belongs to. Currently supported only for sections.\n */\n website?: string;\n /**\n * An object for key-value pairs that should override the values of keys with the same name in the denormalized object\n */\n referent_properties?: {\n [k: string]: unknown;\n };\n };\n}\n/**\n * Holds the collection of tags, categories, keywords, etc that describe content.\n */\nexport interface Taxonomy {\n /**\n * A list of keywords. In the Arc ecosystem, this list is populated by Clavis.\n */\n keywords?: Keyword[];\n /**\n * A list of named entities. In the Arc ecosystem, this list is populated by Clavis.\n */\n named_entities?: NamedEntity[];\n /**\n * A list of topics. In the Arc ecosystem, this list is populated by Clavis.\n */\n topics?: Topic[];\n /**\n * A list of auxiliaries. In the Arc ecosystem, this list is populated by Clavis.\n */\n auxiliaries?: Auxiliary[];\n tags?: Tag[];\n /**\n * A list of categories. Categories are overall, high-level classification of what the content is about.\n */\n categories?: Category[];\n /**\n * A list of topics. Topics are the subjects that the content is about.\n */\n content_topics?: ContentTopic[];\n /**\n * A list of entities. Entities are proper nouns, like people, places, and organizations.\n */\n entities?: Entity[];\n /**\n * A list of custom categories. Categories are overall, high-level classification of what the content is about.\n */\n custom_categories?: CustomCategory[];\n /**\n * A list of custom entities. Entities are proper nouns, like people, places, and organizations.\n */\n custom_entities?: CustomEntity[];\n /**\n * Deprecated in 0.10.12. (See `primary_section` instead.) A primary site object or reference to one. In the Arc ecosystem, a reference here is denormalized into a site from the arc-site-service.\n */\n primary_site?:\n | Site\n | (RepresentationOfANormalizedElement & {\n referent?: {\n type?: 'site';\n [k: string]: unknown;\n };\n [k: string]: unknown;\n });\n /**\n * A primary section object or reference to one. In the Arc ecosystem, a reference here is denormalized into a site from the arc-site-service.\n */\n primary_section?:\n | Section\n | (RepresentationOfANormalizedElement & {\n referent?: {\n type?: 'section';\n [k: string]: unknown;\n };\n [k: string]: unknown;\n });\n /**\n * Deprecated in 0.10.12. (See `sections` instead.) A list of site objects or references to them. In the Arc ecosystem, references in this list are denormalized into sites from the arc-site-service. In a multi-site context, sites will be denormalized against an organization's default website only.\n */\n sites?: (\n | Site\n | (RepresentationOfANormalizedElement & {\n referent?: {\n type?: 'site';\n [k: string]: unknown;\n };\n [k: string]: unknown;\n })\n )[];\n /**\n * A list of site objects or references to them. In the Arc ecosystem, references in this list are denormalized into sites from the arc-site-service. In a multi-site context, sites will be denormalized against an organization's default website only.\n */\n sections?: (\n | Section\n | (RepresentationOfANormalizedElement & {\n referent?: {\n type?: 'section';\n [k: string]: unknown;\n };\n [k: string]: unknown;\n })\n )[];\n /**\n * A list of user-editable manually entered keywords for search purposes. In the Arc ecosystem, these can be generated and saved in source CMS systems, editors, etc.\n */\n seo_keywords?: string[];\n /**\n * A list of stock symbols of companies related to this content. In the Arc ecosystem, these can be generated and saved in source CMS systems, editors, etc.\n */\n stock_symbols?: string[];\n /**\n * A list of WebSked task IDs that this content was created or curated to satisfy.\n *\n * @maxItems 200\n */\n associated_tasks?: string[];\n additional_properties?: HasAdditionalProperties;\n}\n/**\n * Models a keyword used in describing a piece of content.\n */\nexport interface Keyword {\n /**\n * The keyword used to describe a piece of content\n */\n keyword: string;\n /**\n * An arbitrary weighting to give the keyword\n */\n score: number;\n /**\n * The Part of Speech tag for this keyword.\n */\n tag?: string;\n /**\n * An optional count of the frequency of the keyword as it appears in the content it describes\n */\n frequency?: number;\n}\n/**\n * Models a named entity (i.e. name of a person, place, or organization) used in a piece of content.\n */\nexport interface NamedEntity {\n /**\n * A unique identifier for the concept of the named entity.\n */\n _id: string;\n /**\n * The actual string of text that was identified as a named entity.\n */\n name: string;\n /**\n * A description of what the named entity is. E.g. 'organization', 'person', or 'location'.\n */\n type: string;\n score?: number;\n}\n/**\n * Models a topic used in describing a piece of content.\n */\nexport interface Topic {\n /**\n * The unique identifier for this topic.\n */\n _id: string;\n /**\n * The general name for this topic.\n */\n name?: string;\n /**\n * An arbitrary weighting to give the topic\n */\n score: number;\n /**\n * A short identifier for this topic. Usually used in cases where a long form id cannot work.\n */\n uid: string;\n}\n/**\n * Models a auxiliary used in targeting a piece of content.\n */\nexport interface Auxiliary {\n /**\n * The unique identifier for this auxiliary.\n */\n _id: string;\n /**\n * The general name for this auxiliary.\n */\n name?: string;\n /**\n * A short identifier for this auxiliary. Usually used in cases where a long form id cannot work.\n */\n uid: string;\n}\n/**\n * Models a keyword used in describing a piece of content.\n */\nexport interface Tag {\n _id?: GloballyUniqueIDTrait;\n type?: 'tag';\n subtype?: SubtypeOrTemplate;\n /**\n * The text of the tag as displayed to users.\n */\n text: string;\n /**\n * A more detailed description of the tag.\n */\n description?: string;\n additional_properties?: HasAdditionalProperties;\n slug?: Slug;\n}\n/**\n * Models a category used in classifying a piece of content.\n */\nexport interface Category {\n /**\n * The unique ID for this category within its classifier.\n */\n _id: string;\n /**\n * The unique identifier for the classifier that matched this category.\n */\n classifier: string;\n /**\n * The human readable label for this category.\n */\n name: string;\n /**\n * The score assigned to this category between 0 and 1, where 1 is an exact match.\n */\n score?: number;\n}\n/**\n * Models a keyword used in describing a piece of content.\n */\nexport interface ContentTopic {\n /**\n * The unique Wikidata ID for this topic.\n */\n _id: string;\n /**\n * A topic this piece of content is about.\n */\n label: string;\n /**\n * The score assigned to this topic between 0 and 1, where 1 is an exact match.\n */\n score: number;\n}\n/**\n * Models a named entity (i.e. name of a person, place, or organization) used in a piece of content.\n */\nexport interface Entity {\n /**\n * The unique Wikidata ID for this entity.\n */\n _id?: string;\n /**\n * A unique identifier for a custom-defined entity.\n */\n custom_id?: string;\n /**\n * The actual string of text that was identified as a named entity.\n */\n label: string;\n /**\n * A description of what the named entity is. E.g. 'organization', 'person', or 'location'.\n */\n type?: string;\n /**\n * The score assigned to this entity between 0 and 1, where 1 is an exact match.\n */\n score?: number;\n}\n/**\n * Models a category used in classifying a piece of content.\n */\nexport interface CustomCategory {\n /**\n * The unique ID for this category within its classifier.\n */\n _id: string;\n /**\n * The unique identifier for the classifier that matched this category.\n */\n classifier: string;\n /**\n * The human readable label for this category.\n */\n name: string;\n /**\n * The score assigned to this category between 0 and 1, where 1 is an exact match.\n */\n score?: number;\n}\n/**\n * Models a named custom entity (i.e. name of a person, place, or organization) used in a piece of content.\n */\nexport interface CustomEntity {\n /**\n * The unique ID for this entity.\n */\n _id?: string;\n /**\n * A unique identifier for a custom-defined entity.\n */\n custom_id?: string;\n /**\n * The actual string of text that was identified as a named entity.\n */\n label: string;\n /**\n * A description of what the named entity is. E.g. 'organization', 'person', or 'location'.\n */\n type?: string;\n /**\n * The score assigned to this entity between 0 and 1, where 1 is an exact match.\n */\n score?: number;\n}\n/**\n * A hierarchical section or 'site' in a taxonomy. In the Arc ecosystem, these are stored in the arc-site-service.\n */\nexport interface Site {\n type: 'site';\n _id?: GloballyUniqueIDTrait;\n version: DescribesTheANSVersionOfThisObject;\n additional_properties?: HasAdditionalProperties;\n /**\n * The name of this site\n */\n name: string;\n /**\n * A short description or tagline about this site\n */\n description?: string;\n /**\n * The url path to this site\n */\n path?: string;\n /**\n * The id of this section's parent site, if any\n */\n parent_id?: string;\n /**\n * Is this the primary site?\n */\n primary?: boolean;\n}\n/**\n * A hierarchical section in a taxonomy. In the Arc ecosystem, these are stored in the arc-site-service.\n */\nexport interface Section {\n type: 'section';\n _id?: GloballyUniqueIDTrait;\n _website?: Website;\n version: DescribesTheANSVersionOfThisObject;\n additional_properties?: HasAdditionalProperties;\n /**\n * The name of this site\n */\n name: string;\n /**\n * A short description or tagline about this site\n */\n description?: string;\n /**\n * The url path to this site\n */\n path?: string;\n /**\n * The id of this section's parent section in the default hierarchy, if any.\n */\n parent_id?: string;\n /**\n * The id of this section's parent section in various commonly-used hierarchies, where available.\n */\n parent?: {\n default?: string;\n [k: string]: unknown;\n };\n /**\n * Is this the primary site?\n */\n primary?: boolean;\n}\n/**\n * Lists of promotional content to use when highlighting the story. In the Arc ecosystem, references in these lists will be denormalized.\n */\nexport interface PromoItems {\n basic?:\n | AContentObject\n | RepresentationOfANormalizedElement\n | HttpsRawGithubusercontentComWashingtonpostAnsSchemaMasterSrcMainResourcesSchemaAns01012StoryElementsRawHtmlJson\n | CustomEmbed;\n /**\n * This interface was referenced by `PromoItems`'s JSON-Schema definition\n * via the `patternProperty` \".*\".\n */\n [k: string]:\n | AContentObject\n | RepresentationOfANormalizedElement\n | HttpsRawGithubusercontentComWashingtonpostAnsSchemaMasterSrcMainResourcesSchemaAns01012StoryElementsRawHtmlJson\n | CustomEmbed\n | undefined;\n}\n/**\n * Holds common attributes of ANS Content objects.\n */\nexport interface AContentObject {\n type: string;\n _id?: GloballyUniqueIDTrait;\n version: DescribesTheANSVersionOfThisObject;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n language?: Locale;\n copyright?: CopyrightInformation;\n canonical_url?: CanonicalURL;\n short_url?: Short_Url;\n created_date?: CreatedDate;\n last_updated_date?: LastUpdatedDate;\n publish_date?: Publish_Date;\n first_publish_date?: FirstPublishDate;\n display_date?: Display_Date;\n location?: LocationRelatedTrait;\n geo?: Geo;\n address?: Address;\n editor_note?: Editor_Note;\n status?: Status;\n headlines?: Headlines;\n subheadlines?: SubHeadlines;\n description?: Description;\n credits?: CreditTrait;\n vanity_credits?: VanityCreditsTrait;\n taxonomy?: Taxonomy;\n promo_items?: PromoItems;\n related_content?: Related_Content;\n owner?: OwnerInformation;\n planning?: SchedulingInformation;\n workflow?: WorkflowInformation;\n pitches?: Pitches;\n revision?: Revision;\n syndication?: Syndication;\n source?: Source;\n distributor?: Distributor;\n tracking?: Tracking;\n comments?: Comments;\n label?: Label;\n slug?: Slug;\n content_restrictions?: ContentRestrictions;\n additional_properties?: HasAdditionalProperties;\n content_aliases?: AliasesTrait;\n contributors?: Contributors;\n [k: string]: unknown;\n}\n/**\n * Lists of content items or references this story is related to, arbitrarily keyed. In the Arc ecosystem, references in this object will be denormalized into the fully-inflated content objects they represent.\n */\nexport interface Related_Content {\n /**\n * An attached redirect. In Arc, when this content item is fetched by url, content api will instead return this redirect object with appropriate headers. In all other cases, this content should be treated normally.\n *\n * @maxItems 1\n */\n redirect?: [] | [ARedirectObject];\n /**\n * This interface was referenced by `Related_Content`'s JSON-Schema definition\n * via the `patternProperty` \".*\".\n */\n [k: string]: [ARedirectObject] | (AContentObject | RepresentationOfANormalizedElement | CustomEmbed)[] | undefined;\n}\n/**\n * A redirect to another story.\n */\nexport interface ARedirectObject {\n type: 'redirect';\n _id?: GloballyUniqueIDTrait;\n version: DescribesTheANSVersionOfThisObject;\n owner?: OwnerInformation;\n revision?: Revision;\n canonical_url: CanonicalURL;\n redirect_url: CanonicalURL;\n}\n/**\n * Various unrelated fields that should be preserved for backwards-compatibility reasons. See also trait_source.\n */\nexport interface OwnerInformation {\n /**\n * The machine-readable unique identifier of the organization whose database this content is stored in. In Arc, this is equivalent to ARC_ORG_NAME.\n */\n id?: string;\n /**\n * Deprecated in 0.10.12. See `distributor.name`. (Formerly: The human-readable name of original producer of content. Distinguishes between Wires, Staff and other sources.)\n */\n name?: string;\n /**\n * True if this content is advertorial or native advertising.\n */\n sponsored?: boolean;\n [k: string]: unknown;\n}\n/**\n * Trait that applies revision information to a document. In the Arc ecosystem, many of these fields are populated in stories by the Story API.\n */\nexport interface Revision {\n /**\n * The unique id of this revision.\n */\n revision_id?: string;\n /**\n * The unique id of the revision that this revisions was branched from, or preceded it on the current branch.\n */\n parent_id?: string;\n /**\n * The name of the branch this revision was created on.\n */\n branch?: string;\n /**\n * A list of identifiers of editions that point to this revision.\n */\n editions?: string[];\n /**\n * The unique user id of the person who created this revision.\n */\n user_id?: string;\n /**\n * Whether or not this revision's parent story is published, in any form or place\n */\n published?: boolean;\n additional_properties?: HasAdditionalProperties;\n}\n/**\n * A custom embed element. Can be used to reference content from external providers about which little is known.\n */\nexport interface CustomEmbed {\n type: 'custom_embed';\n _id?: GloballyUniqueIDTrait;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n additional_properties?: HasAdditionalProperties;\n embed: Embed;\n}\n/**\n * The embed data.\n */\nexport interface Embed {\n id: EmbedID;\n url: EmbedProviderURL;\n config?: EmbedConfiguration;\n}\n/**\n * Arbitrary configuration data generated by a plugin. Users are responsible for maintaining schema.\n */\nexport interface EmbedConfiguration {\n referent?: {\n [k: string]: unknown;\n };\n type?: {\n [k: string]: unknown;\n };\n version?: {\n [k: string]: unknown;\n };\n /**\n * This interface was referenced by `EmbedConfiguration`'s JSON-Schema definition\n * via the `patternProperty` \"^([a-zA-Z0-9_])*$\".\n */\n [k: string]: unknown;\n}\n/**\n * Trait that applies planning information to a document or resource. In the Arc ecosystem, this data is generated by WebSked. Newsroom use only. All these fields should be available and editable in WebSked.\n */\nexport interface SchedulingInformation {\n additional_properties?: HasAdditionalProperties;\n /**\n * Date to be used for chronological sorting in WebSked.\n */\n websked_sort_date?: string;\n /**\n * The delta between the story's planned publish date and actual first publish time, in minutes.\n */\n deadline_miss?: number;\n internal_note?: InternalNote;\n budget_line?: BudgetLine;\n /**\n * Scheduling information.\n */\n scheduling?: {\n /**\n * When the content is planned to be published.\n */\n planned_publish_date?: string;\n /**\n * When the content was first published.\n */\n scheduled_publish_date?: string;\n /**\n * Will this content have galleries?\n */\n will_have_gallery?: boolean;\n /**\n * Will this content have graphics?\n */\n will_have_graphic?: boolean;\n /**\n * Will this content have images?\n */\n will_have_image?: boolean;\n /**\n * Will this content have videos?\n */\n will_have_video?: boolean;\n };\n /**\n * Story length information.\n */\n story_length?: {\n /**\n * The anticipated number of words in the story.\n */\n word_count_planned?: number;\n /**\n * Current number of words.\n */\n word_count_actual?: number;\n /**\n * The anticipated length of the story in inches.\n */\n inch_count_planned?: number;\n /**\n * The current length of the story in inches.\n */\n inch_count_actual?: number;\n /**\n * The anticipated length of the story in lines.\n */\n line_count_planned?: number;\n /**\n * The current length of the story in lines.\n */\n line_count_actual?: number;\n /**\n * The anticipated number of characters in the story.\n */\n character_count_planned?: number;\n /**\n * The current number of characters in the story.\n */\n character_count_actual?: number;\n /**\n * The encoding used for counting characters in the story.\n */\n character_encoding?: string;\n };\n}\n/**\n * Trait that applies workflow information to a document or resource. In the Arc ecosystem, this data is generated by WebSked.\n */\nexport interface WorkflowInformation {\n additional_properties?: HasAdditionalProperties;\n /**\n * Code indicating the story's current workflow status. This number should match the values configured in WebSked.\n */\n status_code?: number;\n /**\n * This note will be used for any task automatically generated via WebSked task triggers.\n */\n note?: string;\n}\n/**\n * Trait that represents a story's pitches. In the Arc ecosystem, this data is generated by WebSked.\n */\nexport interface Pitches {\n additional_properties?: HasAdditionalProperties;\n /**\n * A list of the story's pitches to a platform.\n */\n platform?: PlatformPitch[];\n /**\n * A list of the story's pitches to a publication.\n */\n publication?: PublicationPitch[];\n}\n/**\n * Trait that represents a pitch to a platform. In the Arc ecosystem, this data is generated by WebSked.\n */\nexport interface PlatformPitch {\n additional_properties?: HasAdditionalProperties;\n /**\n * The path of the platform that this pitch targets.\n */\n platform_path?: string;\n creation_event?: PlatformPitchEvent;\n latest_event?: PlatformPitchEvent;\n}\n/**\n * Trait that represents an update event for a pitch to a platform. In the Arc ecosystem, this data is generated by WebSked.\n */\nexport interface PlatformPitchEvent {\n additional_properties?: HasAdditionalProperties;\n /**\n * The current status of the pitch.\n */\n status?: string;\n /**\n * The time of this update.\n */\n time?: string;\n /**\n * The ID of the user who made this update.\n */\n user_id?: string;\n /**\n * Optional note associated with this update.\n */\n note?: string;\n}\n/**\n * Trait that represents a pitch to a publication. In the Arc ecosystem, this data is generated by WebSked.\n */\nexport interface PublicationPitch {\n additional_properties?: HasAdditionalProperties;\n /**\n * The ID of the publication that this pitch targets.\n */\n publication_id?: string;\n creation_event?: PublicationPitchEvent;\n latest_event?: PublicationPitchEvent;\n}\n/**\n * Trait that represents an update event for a pitch to a publication. In the Arc ecosystem, this data is generated by WebSked.\n */\nexport interface PublicationPitchEvent {\n additional_properties?: HasAdditionalProperties;\n /**\n * The current status of the pitch.\n */\n status?: string;\n /**\n * The time of this update.\n */\n time?: string;\n /**\n * The ID of the user who made this update.\n */\n user_id?: string;\n /**\n * Optional note associated with this update.\n */\n note?: string;\n /**\n * The ID of the publication edition that this pitch targets.\n */\n edition_id?: string;\n /**\n * The time of the publication edition that this pitch targets.\n */\n edition_time?: string;\n}\n/**\n * Key-boolean pair of syndication services where this article may go\n */\nexport interface Syndication {\n /**\n * Necessary for fulfilling contractual agreements with third party clients\n */\n external_distribution?: boolean;\n /**\n * Necessary so that we can filter out all articles that editorial has deemed should not be discoverable via search\n */\n search?: boolean;\n /**\n * This interface was referenced by `Syndication`'s JSON-Schema definition\n * via the `patternProperty` \".*\".\n */\n [k: string]: boolean | undefined;\n}\n/**\n * Information about the original source and/or owner of this content\n */\nexport interface Source {\n /**\n * The id of this content in a foreign CMS.\n */\n source_id?: string;\n /**\n * Deprecated in 0.10.12. See `distributor.category` and `distributor.subcategory`. (Formerly: The method used to enter this content. E.g. 'staff', 'wires'.)\n */\n source_type?: string;\n /**\n * Deprecated in 0.10.12. See `distributor.name`. (Formerly: The human-readable name of the organization who first produced this content. E.g., 'Reuters'.)\n */\n name?: string;\n /**\n * The software (CMS or editor) that was used to enter this content. E.g., 'wordpress', 'ellipsis'.\n */\n system?: string;\n /**\n * A link to edit this content in its source CMS.\n */\n edit_url?: string;\n additional_properties?: HasAdditionalProperties;\n}\n/**\n * Tracking information, probably implementation-dependent\n */\nexport interface Tracking {\n [k: string]: unknown;\n}\n/**\n * Comment configuration data\n */\nexport interface Comments {\n /**\n * How long (in days) after publish date until comments are closed.\n */\n comments_period?: number;\n /**\n * If false, commenting is disabled on this content.\n */\n allow_comments?: boolean;\n /**\n * If false, do not render comments on this content.\n */\n display_comments?: boolean;\n /**\n * If true, comments must be moderator-approved before being displayed.\n */\n moderation_required?: boolean;\n additional_properties?: HasAdditionalProperties;\n [k: string]: unknown;\n}\n/**\n * What the Washington Post calls a Kicker\n */\nexport interface Label {\n /**\n * The default label object for this piece of content.\n */\n basic?: {\n /**\n * The text of this label.\n */\n text: string;\n /**\n * An optional destination url of this label.\n */\n url?: string;\n /**\n * If false, this label should be hidden.\n */\n display?: boolean;\n additional_properties?: HasAdditionalProperties;\n };\n /**\n * Additional user-defined keyed label objects.\n *\n * This interface was referenced by `Label`'s JSON-Schema definition\n * via the `patternProperty` \"^[a-zA-Z0-9_]*$\".\n */\n [k: string]:\n | {\n /**\n * The text of this label.\n */\n text: string;\n /**\n * An optional destination url of this label.\n */\n url?: string;\n /**\n * If false, this label should be hidden.\n */\n display?: boolean;\n additional_properties?: HasAdditionalProperties;\n }\n | undefined;\n}\n/**\n * Trait that applies contains the content restrictions of an ANS object.\n */\nexport interface ContentRestrictions {\n /**\n * The content restriction code/level/flag associated with the ANS object\n */\n content_code?: string;\n /**\n * Embargo configuration to enforce publishing restrictions. Embargoed content must not go live.\n */\n embargo?: {\n /**\n * The boolean flag to indicate if the embargo is active or not. If this field is false, ignore the embargo.\n */\n active: boolean;\n /**\n * An optional end time for the embargo to indicate when it ends. When it's not defined, it means the embargo keeps applying. The end time should be ignored if active flag is false.\n */\n end_time?: string;\n /**\n * An optional description for the embargo.\n */\n description?: string;\n };\n /**\n * Geo-Restriction configuration that contains the restriction ids that this content should be associated with.\n */\n geo?: {\n /**\n * An array containing the geo-restriction objects. Limited to a size of 1 for now.\n *\n * @minItems 1\n * @maxItems 1\n */\n restrictions: [\n {\n /**\n * The _id of the restriction that is stored in Global Settings.\n */\n restriction_id: string;\n },\n ];\n };\n [k: string]: unknown;\n}\n/**\n * Trait that holds information on who created and contributed to a given document in Arc.\n */\nexport interface Contributors {\n /**\n * The Creator of the Document.\n */\n created_by?: {\n /**\n * The unique ID of the Arc user who created the Document\n */\n user_id?: string;\n /**\n * The display name of the Arc user who created the Document\n */\n display_name?: string;\n [k: string]: unknown;\n };\n}\n/**\n * An html content element\n */\nexport interface HttpsRawGithubusercontentComWashingtonpostAnsSchemaMasterSrcMainResourcesSchemaAns01012StoryElementsRawHtmlJson {\n type: 'raw_html';\n _id?: GloballyUniqueIDTrait;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n additional_properties?: HasAdditionalProperties;\n /**\n * Any arbitrary chunk of HTML.\n */\n content: string;\n}\n/**\n * Coordinates representing the 'visual center' of an image. The X axis is horizontal line and the Y axis the vertical line, with 0,0 being the LEFT, TOP of the image.\n */\nexport interface FocalPoint {\n /**\n * The coordinate point on the horizontal axis\n */\n x: number;\n /**\n * The coordinate point on the vertical axis\n */\n y: number;\n [k: string]: unknown;\n}\n/**\n * Mapping of integers to tokens, where the integer represents the Signing Service's secret version, and token represents an object's public key for usage on the frontend.\n */\nexport interface Auth {\n /**\n * This interface was referenced by `Auth`'s JSON-Schema definition\n * via the `patternProperty` \"^\\d+$\".\n */\n [k: string]: string;\n}\nexport interface Book {\n book_title?: Title;\n book_url?: URL;\n}\nexport interface School {\n school_name?: SchoolName;\n}\n/**\n * An item that conforms to this schema can be rendered in a sequence\n */\nexport interface AnElementThatCanBeListedAsPartOfContentElements {\n type: string;\n _id?: GloballyUniqueIDTrait;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n additional_properties?: HasAdditionalProperties;\n gallery_properties?: HasGalleryProperties;\n [k: string]: unknown;\n}\n/**\n * An object for overrides for images when images are used in a gallery. Example usage: Each image in a gallery may have the images own focal point overridden by the gallery.\n */\nexport interface HasGalleryProperties {\n [k: string]: unknown;\n}\n/**\n * Website-specific metadata for url generation for multi-site copies. These fields are not indexed in Content API.\n */\nexport interface WebsitesInput {\n /**\n * This interface was referenced by `WebsitesInput`'s JSON-Schema definition\n * via the `patternProperty` \"^[a-zA-Z0-9_]*\".\n */\n [k: string]: {\n website_section?: RepresentationOfANormalizedElement | Section;\n website_url?: WebsiteURL;\n };\n}\n/**\n * Holds attributes of an ANS story. In the Arc ecosystem, these are stored in the Story API.\n */\nexport interface AStory {\n type: 'story';\n _id?: GloballyUniqueIDTrait;\n version: DescribesTheANSVersionOfThisObject;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n language?: Locale;\n copyright?: CopyrightInformation;\n canonical_url?: CanonicalURL;\n canonical_url_external?: CanonicalExternalURL;\n canonical_website?: CanonicalWebsite;\n website?: Website;\n website_url?: WebsiteURL;\n short_url?: Short_Url;\n created_date?: CreatedDate;\n last_updated_date?: LastUpdatedDate;\n publish_date?: Publish_Date;\n first_publish_date?: FirstPublishDate;\n display_date?: Display_Date;\n location?: LocationRelatedTrait;\n geo?: Geo;\n address?: Address;\n editor_note?: Editor_Note;\n status?: Status;\n headlines?: Headlines;\n subheadlines?: SubHeadlines;\n description?: Description;\n credits?: CreditTrait;\n vanity_credits?: VanityCreditsTrait;\n taxonomy?: Taxonomy;\n promo_items?: PromoItems;\n related_content?: Related_Content;\n owner?: OwnerInformation;\n planning?: SchedulingInformation;\n workflow?: WorkflowInformation;\n pitches?: Pitches;\n revision?: Revision;\n syndication?: Syndication;\n source?: Source;\n distributor?: Distributor;\n tracking?: Tracking;\n comments?: Comments;\n label?: Label;\n slug?: Slug;\n content_restrictions?: ContentRestrictions;\n rendering_guides?: RenderingGuides;\n additional_properties?: HasAdditionalProperties;\n content_aliases?: AliasesTrait;\n corrections?: Corrections;\n content_elements?: ACollectionOfContent;\n publishing?: PublishingInformation;\n variations?: VariantContentMetadata;\n voice_transcripts?: VoiceTranscriptSConfigurationAndOutput;\n websites?: WebsitesInput;\n contributors?: Contributors;\n}\n/**\n * Trait that provides suggestions for the rendering system.\n */\nexport interface RenderingGuides {\n /**\n * The preferred rendering method of the story. Blank means there is no preference. If the rendering application is aware of these other options, it can decide to either use one of them, render messaging to the viewer, or render the story as normal\n */\n preferred_method?: (('website' | 'native') | string)[];\n [k: string]: unknown;\n}\n/**\n * Describes a change that has been made to the document for transparency, or describes inaccuracies or falsehoods that remain in the document.\n */\nexport interface Correction {\n type: 'correction';\n _id?: GloballyUniqueIDTrait;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n additional_properties?: HasAdditionalProperties;\n /**\n * Type of correction. E.g., clarification, retraction.\n */\n correction_type?: string;\n /**\n * The text of the correction.\n */\n text: string;\n}\n/**\n * The current published state of all editions of a content item as well as any scheduled publishing information. Machine-generated.\n */\nexport interface PublishingInformation {\n has_published_edition: HasPublishedEdition;\n /**\n * A map of edition names to the current publish state for that edition\n */\n editions?: {\n default: Edition;\n [k: string]: Edition;\n };\n scheduled_operations?: ScheduledOperations;\n additional_properties?: HasAdditionalProperties;\n}\n/**\n * This interface was referenced by `undefined`'s JSON-Schema definition\n * via the `patternProperty` \"^[a-zA-Z0-9_]*$\".\n */\nexport interface Edition {\n edition_name: EditionName;\n edition_date: EditionDate;\n edition_first_publish_date?: FirstPublishedDateEdition;\n edition_display_date?: DisplayDateEdition;\n edition_publish_date?: PublishDateEdition;\n edition_published: PublishStatus;\n edition_revision_id?: RevisionID;\n additional_properties?: HasAdditionalProperties;\n}\n/**\n * A map of lists of operations scheduled to be performed on this content item, sorted by operation type.\n */\nexport interface ScheduledOperations {\n publish_edition?: {\n operation?: 'publish_edition';\n operation_revision_id?: RevisionIDOperation;\n operation_edition?: EditionNameOperation;\n operation_date?: OperationDate;\n additional_properties?: HasAdditionalProperties;\n }[];\n unpublish_edition?: {\n operation?: 'unpublish_edition';\n operation_edition?: EditionNameOperation1;\n operation_date?: OperationDate1;\n additional_properties?: HasAdditionalProperties;\n }[];\n}\n/**\n * Holds variant content metadata, including content zone IDs for use within 'content_elements' and mapping from website IDs to variant IDs\n */\nexport interface VariantContentMetadata {\n additional_properties?: HasAdditionalProperties;\n /**\n * A list of content zone IDs for use within the 'content_elements' array of the hub story\n *\n * @maxItems 10\n */\n content_zone_ids?:\n | []\n | [string]\n | [string, string]\n | [string, string, string]\n | [string, string, string, string]\n | [string, string, string, string, string]\n | [string, string, string, string, string, string]\n | [string, string, string, string, string, string, string]\n | [string, string, string, string, string, string, string, string]\n | [string, string, string, string, string, string, string, string, string]\n | [string, string, string, string, string, string, string, string, string, string];\n variants?: VariantMetadata[];\n}\n/**\n * Variant metadata describing its ID as well as the websites to which it is assigned\n */\nexport interface VariantMetadata {\n _id?: GloballyUniqueIDTrait1;\n additional_properties?: HasAdditionalProperties;\n content?: AStory1;\n created_date?: CreatedDate;\n last_updated_date?: LastUpdatedDate;\n /**\n * User-facing name for the variant\n */\n name?: string;\n publish_date?: Publish_Date;\n /**\n * Published status for the variant\n */\n published?: boolean;\n type: 'variant';\n /**\n * websites assigned to this variant; individual values must be mutually exclusive with other variants\n *\n * @maxItems 50\n */\n websites?: string[];\n}\n/**\n * Variant content. Only 'story' data is supported, but this may expand in the future.\n */\nexport interface AStory1 {\n type: 'story';\n _id?: GloballyUniqueIDTrait;\n version: DescribesTheANSVersionOfThisObject;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n language?: Locale;\n copyright?: CopyrightInformation;\n canonical_url?: CanonicalURL;\n canonical_url_external?: CanonicalExternalURL;\n canonical_website?: CanonicalWebsite;\n website?: Website;\n website_url?: WebsiteURL;\n short_url?: Short_Url;\n created_date?: CreatedDate;\n last_updated_date?: LastUpdatedDate;\n publish_date?: Publish_Date;\n first_publish_date?: FirstPublishDate;\n display_date?: Display_Date;\n location?: LocationRelatedTrait;\n geo?: Geo;\n address?: Address;\n editor_note?: Editor_Note;\n status?: Status;\n headlines?: Headlines;\n subheadlines?: SubHeadlines;\n description?: Description;\n credits?: CreditTrait;\n vanity_credits?: VanityCreditsTrait;\n taxonomy?: Taxonomy;\n promo_items?: PromoItems;\n related_content?: Related_Content;\n owner?: OwnerInformation;\n planning?: SchedulingInformation;\n workflow?: WorkflowInformation;\n pitches?: Pitches;\n revision?: Revision;\n syndication?: Syndication;\n source?: Source;\n distributor?: Distributor;\n tracking?: Tracking;\n comments?: Comments;\n label?: Label;\n slug?: Slug;\n content_restrictions?: ContentRestrictions;\n rendering_guides?: RenderingGuides;\n additional_properties?: HasAdditionalProperties;\n content_aliases?: AliasesTrait;\n corrections?: Corrections;\n content_elements?: ACollectionOfContent;\n publishing?: PublishingInformation;\n variations?: VariantContentMetadata;\n voice_transcripts?: VoiceTranscriptSConfigurationAndOutput;\n websites?: WebsitesInput;\n contributors?: Contributors;\n}\n/**\n * The transcription settings as requested by an end-user or API caller. These values should be displayed to editorial users in Arc apps.\n */\nexport interface OptionsRequested {\n enabled: Enabled;\n voice?: VoiceID;\n [k: string]: unknown;\n}\n/**\n * The transcription settings that were used by the renderer to generate the final output. (If these differ from 'options' it may indicate an inability to render exactly as specified.) These values can be used when rendering to readers or external users.\n */\nexport interface OptionsUsed {\n enabled: Enabled1;\n voice?: VoiceID1;\n [k: string]: unknown;\n}\n/**\n * Configuration for a piece of audio content, over a stream.\n */\nexport interface AStreamOfAudio {\n filesize?: FileSize;\n audio_codec?: AudioCodec;\n stream_type?: AudioStreamType;\n url: URL1;\n bitrate?: Bitrate;\n [k: string]: unknown;\n}\n/**\n * Holds attributes of an ANS video component. In the Arc ecosystem, these are stored in Goldfish.\n */\nexport interface VideoContent {\n type: 'video';\n _id?: GloballyUniqueIDTrait;\n version: DescribesTheANSVersionOfThisObject;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n language?: Locale;\n copyright?: CopyrightInformation;\n canonical_url?: CanonicalURL;\n canonical_website?: CanonicalWebsite;\n website?: Website;\n website_url?: WebsiteURL;\n short_url?: Short_Url;\n created_date?: CreatedDate;\n last_updated_date?: LastUpdatedDate;\n publish_date?: Publish_Date;\n first_publish_date?: FirstPublishDate;\n display_date?: Display_Date;\n location?: LocationRelatedTrait;\n geo?: Geo;\n address?: Address;\n editor_note?: Editor_Note;\n status?: Status;\n headlines?: Headlines;\n subheadlines?: SubHeadlines;\n description?: Description;\n credits?: CreditTrait;\n vanity_credits?: VanityCreditsTrait;\n taxonomy?: Taxonomy;\n promo_items?: PromoItems;\n related_content?: Related_Content;\n owner?: OwnerInformation;\n planning?: SchedulingInformation;\n workflow?: WorkflowInformation;\n pitches?: Pitches;\n revision?: Revision;\n syndication?: Syndication;\n source?: Source;\n distributor?: Distributor;\n tracking?: Tracking;\n comments?: Comments;\n label?: Label;\n slug?: Slug;\n content_restrictions?: ContentRestrictions;\n additional_properties?: HasAdditionalProperties;\n content_aliases?: AliasesTrait;\n /**\n * Runtime of the video in milliseconds.\n */\n duration?: number;\n /**\n * A transcript of the contents of the video.\n */\n transcript?: string;\n /**\n * A rating of the video, to be used for appropriate age/content warnings.\n */\n rating?: string;\n /**\n * The type of video (e.g. clip, livestream, etc)\n */\n video_type?: string;\n /**\n * The YouTube ID of the content, if (re)hosted on youtube.com\n */\n youtube_content_id?: string;\n /**\n * The different streams this video can play in.\n */\n streams?: AStreamOfVideo[];\n subtitles?: VideoSubtitleConfigurationSchema;\n promo_image?: AnImage1;\n /**\n * An HTML snippet used to embed this video in another document. Used for oembed responses.\n */\n embed_html?: string;\n corrections?: Corrections;\n websites?: WebsitesInput;\n contributors?: Contributors;\n}\n/**\n * Configuration for a piece of video content, over a stream.\n */\nexport interface AStreamOfVideo {\n /**\n * The height of the video.\n */\n height?: number;\n /**\n * The width of the video.\n */\n width?: number;\n /**\n * The size of the video, in bytes.\n */\n filesize?: number;\n /**\n * The audio codec.\n */\n audio_codec?: string;\n /**\n * The video codec.\n */\n video_codec?: string;\n /**\n * The type of video (e.g. mp4).\n */\n stream_type?: string;\n /**\n * Where to get the stream from.\n */\n url?: string;\n /**\n * The bitrate of the video\n */\n bitrate?: number;\n /**\n * The provider of the video.\n */\n provider?: string;\n [k: string]: unknown;\n}\n/**\n * Data about different subtitle encodings and confidences of auto-transcribed content.\n */\nexport interface VideoSubtitleConfigurationSchema {\n /**\n * How confident the transcriber (human or automated) is of the accuracy of the subtitles.\n */\n confidence?: number;\n /**\n * The locations of any subtitle transcriptions of the video.\n */\n urls?: SubtitleUrl[];\n [k: string]: unknown;\n}\nexport interface SubtitleUrl {\n /**\n * The format of the subtitles (e.g. SRT, DFXP, WEB_VTT, etc)\n */\n format?: string;\n /**\n * The url of the subtitle stream.\n */\n url?: string;\n [k: string]: unknown;\n}\n/**\n * Holds attributes of an ANS image component. In the Arc ecosystem, these are stored in Anglerfish.\n */\nexport interface AnImage1 {\n type: 'image';\n _id?: GloballyUniqueIDTrait;\n version: DescribesTheANSVersionOfThisObject;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n language?: Locale;\n copyright?: CopyrightInformation;\n canonical_url?: CanonicalURL;\n short_url?: Short_Url;\n created_date?: CreatedDate;\n last_updated_date?: LastUpdatedDate;\n publish_date?: Publish_Date;\n first_publish_date?: FirstPublishDate;\n display_date?: Display_Date;\n location?: LocationRelatedTrait;\n geo?: Geo;\n address?: Address;\n editor_note?: Editor_Note;\n status?: Status;\n headlines?: Headlines;\n subheadlines?: SubHeadlines;\n description?: Description;\n credits?: CreditTrait;\n vanity_credits?: VanityCreditsTrait;\n taxonomy?: Taxonomy;\n promo_items?: PromoItems;\n related_content?: Related_Content;\n owner?: OwnerInformation;\n planning?: SchedulingInformation;\n workflow?: WorkflowInformation;\n pitches?: Pitches;\n revision?: Revision;\n syndication?: Syndication;\n source?: Source;\n distributor?: Distributor;\n tracking?: Tracking;\n comments?: Comments;\n label?: Label;\n slug?: Slug;\n content_restrictions?: ContentRestrictions;\n image_type?: ImageType;\n alt_text?: AltText;\n focal_point?: FocalPoint;\n auth?: Auth;\n seo_filename?: SEOFilename;\n additional_properties?: HasAdditionalProperties;\n /**\n * Subtitle for the image.\n */\n subtitle?: string;\n /**\n * Caption for the image.\n */\n caption?: string;\n /**\n * URL for the image.\n */\n url?: string;\n /**\n * Width for the image.\n */\n width?: number;\n /**\n * Height for the image.\n */\n height?: number;\n /**\n * True if the image can legally be licensed to others.\n */\n licensable?: boolean;\n contributors?: Contributors;\n}\n","import type { ANS, SectionReference } from '../../types/index.js';\nimport type { AuthorANS } from '../author/types.js';\n\ntype TagANS = ANS.Tag & { name: string };\n\nexport type CirculationReference = {\n document_id: string;\n website_id: string;\n website_url?: string;\n primary_section?: SectionReference;\n website_primary_section?: SectionReference;\n website_sections: SectionReference[];\n};\n\nexport type Operation = {\n type: string;\n story_id: string;\n operation: string;\n date: string;\n organization_id: string;\n endpoint: string;\n};\n\nexport type ANSContent = ANS.AStory | ANS.AGallery | ANS.AnImage | AuthorANS | TagANS | ANS.VideoContent;\n\nexport type PostANSPayload<ANS extends ANSContent = ANSContent> = {\n sourceId: string;\n sourceType: string;\n ANS: ANS;\n references?: unknown[];\n circulations?: CirculationReference[];\n operations?: Operation[];\n arcAdditionalProperties?: {\n importPriority?: string;\n story?: {\n publish: boolean;\n };\n video?: {\n transcoding: true;\n useLastUpdated: true;\n importPriority: string;\n thumbnailTimeInSeconds: 0;\n };\n };\n};\n\nexport type PostANSParams = {\n website: string;\n groupId: string;\n priority: 'historical' | 'live';\n};\n\nexport type GetANSParams = {\n ansId: string;\n ansType: ANSType;\n};\n\nexport enum ANSType {\n Story = 'story',\n Video = 'video',\n Tag = 'tag',\n Author = 'author',\n Gallery = 'gallery',\n Image = 'image',\n Redirect = 'redirect',\n}\n\nexport enum MigrationStatus {\n Success = 'Success',\n Queued = 'Queued',\n Circulated = 'Circulated',\n Published = 'Published',\n Scheduled = 'Scheduled',\n FailVideo = 'FailVideo',\n FailImage = 'FailImage',\n FailPhoto = 'FailPhoto',\n FailStory = 'FailStory',\n FailGallery = 'FailGallery',\n FailAuthor = 'FailAuthor',\n FailTag = 'FailTag',\n ValidationFailed = 'ValidationFailed',\n}\n\nexport type Summary = SummaryRecord[];\n\nexport type SummaryRecord = {\n id: number;\n sourceId: string;\n sourceType: string;\n sourceLocation: string;\n sourceAdditionalProperties: string;\n ansId: string;\n ansType: ANSType;\n ansLocation: string;\n status: MigrationStatus;\n website: string;\n operations: string;\n circulationLocation: string;\n createDate: string;\n updateDate: string;\n errorMessage?: string;\n priority: string;\n arcAdditionalProperties: string;\n groupId: string;\n tags?: null;\n};\n\nexport type DetailReport = SummaryRecord & { ansContent: ANSContent };\n\nexport type Count = {\n historical: {\n total: number;\n ansTypes: Partial<Record<ANSType, ANSTypeCount>>;\n };\n};\n\ntype ANSTypeCount = Partial<Record<MigrationStatus, number>>;\n\nexport type DetailReportParams = {\n sourceId?: string;\n sourceType?: string;\n ansId?: string;\n ansType?: ANSType;\n version?: string;\n documentType?: string;\n};\n\nexport type CountParams = {\n startDate?: Date;\n endDate?: Date;\n};\n\nexport type SummaryReportParams = {\n status?: MigrationStatus;\n website: string;\n groupId?: string;\n fetchFromId?: string;\n sort?: SummarySortBy;\n sortOrder?: SummarySortOrder;\n};\n\nexport enum SummarySortBy {\n CreateDate = 'createDate',\n UpdateDate = 'updateDate',\n Id = 'id',\n}\n\nexport enum SummarySortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\nexport type GetRemainingTimeParams = {\n priority: 'historical' | 'live';\n ansType: ANSType;\n timeUnit: 'hour' | 'day' | 'minute';\n};\n\nexport type GetRemainingTimeResponse = {\n estTimeRemaining: {\n value: number;\n unit: string;\n };\n estCompletionDate: string;\n estCount: number;\n reportDate: string;\n};\n\nexport type GetRecentGroupIdsResponse = {\n groupIds: string[];\n};\n","import type { ANS } from '../../types';\n\nexport const reference = (\n ref: ANS.RepresentationOfANormalizedElement['referent']\n): ANS.RepresentationOfANormalizedElement => {\n return {\n _id: ref.id,\n type: 'reference' as const,\n referent: {\n ...ref,\n },\n };\n};\n","import type { ANS } from '../types/index.js';\nimport type { CElement } from './types.js';\n\nexport const ContentElement = {\n divider: () => {\n return {\n type: 'divider' as const,\n };\n },\n text: (content: string, alignment: ANS.Alignment | null = 'left') => {\n return {\n type: 'text' as const,\n content,\n alignment: alignment || undefined,\n };\n },\n quote: (items: CElement[], citation = '', subtype: 'blockquote' | 'pullquote' = 'pullquote') => {\n return {\n type: 'quote' as const,\n subtype,\n citation: {\n type: 'text' as const,\n content: citation,\n },\n content_elements: items,\n };\n },\n interstitial_link: (url: string, content: string) => {\n return {\n type: 'interstitial_link' as const,\n url,\n content,\n };\n },\n header: (content: string, level: number) => {\n return {\n type: 'header' as const,\n content,\n level,\n };\n },\n raw_html: (content: string) => {\n return {\n type: 'raw_html' as const,\n content,\n };\n },\n gallery: (id: string) => {\n return {\n type: 'reference' as const,\n referent: {\n type: 'gallery' as const,\n id,\n },\n };\n },\n list: (type: 'ordered' | 'unordered', items: CElement[]) => {\n return {\n type: 'list' as const,\n list_type: type,\n items,\n };\n },\n link_list: (title: string, links: { content: string; url: string }[]) => {\n return {\n type: 'link_list' as const,\n title,\n items: links.map(({ content, url }) => {\n return {\n type: 'interstitial_link' as const,\n content,\n url,\n };\n }),\n };\n },\n image: (id: string, properties?: ANS.AnImage) => {\n return {\n referent: {\n id,\n type: 'image' as const,\n referent_properties: {\n _id: id,\n type: 'image' as const,\n ...properties,\n },\n },\n type: 'reference' as const,\n };\n },\n jwPlayer: (id: string) => {\n return {\n embed: {\n config: {},\n id,\n url: 'https://cdn.jwplayer.com/players',\n },\n subtype: 'jw_player' as const,\n type: 'custom_embed' as const,\n };\n },\n twitter: (id: string, provider = 'https://publish.twitter.com/oembed?url=') => {\n return {\n referent: {\n id,\n provider,\n service: 'oembed' as const,\n type: 'twitter' as const,\n },\n type: 'reference' as const,\n };\n },\n youtube: (id: string, provider = 'https://www.youtube.com/oembed?url=') => {\n return {\n referent: {\n id,\n provider,\n service: 'oembed',\n type: 'youtube',\n },\n type: 'reference' as const,\n };\n },\n facebook_video: (id: string, provider = 'https://www.facebook.com/plugins/post/oembed.json/?url=') => {\n return {\n referent: {\n id,\n provider,\n service: 'oembed',\n type: 'facebook-video',\n },\n type: 'reference' as const,\n };\n },\n facebook_post: (id: string, provider = 'https://www.facebook.com/plugins/post/oembed.json/?url=') => {\n return {\n referent: {\n id,\n provider,\n service: 'oembed',\n type: 'facebook-post',\n },\n type: 'reference' as const,\n };\n },\n soundcloud: (id: string, provider = 'https://soundcloud.com/oembed.json/?url=') => {\n return {\n referent: {\n id,\n provider,\n service: 'oembed',\n type: 'soundcloud',\n },\n type: 'reference' as const,\n };\n },\n vimeo: (id: string, provider = 'https://vimeo.com/api/oembed.json?url=') => {\n return {\n referent: {\n id,\n provider,\n service: 'oembed',\n type: 'vimeo',\n },\n type: 'reference' as const,\n };\n },\n instagram: (id: string, provider = 'https://api.instagram.com/oembed?url=') => {\n return {\n referent: {\n id,\n provider,\n service: 'oembed',\n type: 'instagram',\n },\n type: 'reference' as const,\n };\n },\n dailymotion: (id: string, provider = 'https://www.dailymotion.com/services/oembed?url=') => {\n return {\n referent: {\n id,\n provider,\n service: 'oembed',\n type: 'dailymotion',\n },\n type: 'reference' as const,\n };\n },\n tiktok: (id: string, provider = 'https://www.tiktok.com/oembed?url=') => {\n return {\n referent: {\n id,\n provider,\n service: 'oembed',\n type: 'tiktok',\n },\n type: 'reference' as const,\n };\n },\n issuu: (id: string, provider = 'https://issuu.com/oembed_wp?url=') => {\n return {\n referent: {\n id,\n provider,\n service: 'oembed',\n type: 'issuu',\n },\n type: 'reference' as const,\n };\n },\n kickstarter: (id: string, provider = 'https://www.kickstarter.com/services/oembed?url=') => {\n return {\n referent: {\n id,\n provider,\n service: 'oembed',\n type: 'kickstarter',\n },\n type: 'reference' as const,\n };\n },\n polldaddy: (id: string, provider = 'https://polldaddy.com/oembed/?url=') => {\n return {\n referent: {\n id,\n provider,\n service: 'oembed',\n type: 'polldaddy',\n },\n type: 'reference' as const,\n };\n },\n};\n","import { ContentElement } from '../../content-elements/content-elements.js';\nimport type { ContentElementType } from '../../content-elements/types.js';\n\nconst socialRegExps = {\n instagram:\n /(?:https?:\\/\\/)?(?:www.)?instagram.com\\/?([a-zA-Z0-9\\.\\_\\-]+)?\\/([p]+)?([reel]+)?([tv]+)?([stories]+)?\\/([a-zA-Z0-9\\-\\_\\.]+)\\/?([0-9]+)?/,\n twitter: /https:\\/\\/(?:www\\.)?twitter\\.com\\/[^\\/]+\\/status(?:es)?\\/(\\d+)/,\n tiktok:\n /https:\\/\\/(?:m|www|vm)?\\.?tiktok\\.com\\/((?:.*\\b(?:(?:usr|v|embed|user|video)\\/|\\?shareId=|\\&item_id=)(\\d+))|\\w+)/,\n facebookPost:\n /https:\\/\\/www\\.facebook\\.com\\/(photo(\\.php|s)|permalink\\.php|media|questions|notes|[^\\/]+\\/(activity|posts))[\\/?].*$/,\n facebookVideo: /https:\\/\\/www\\.facebook\\.com\\/([^\\/?].+\\/)?video(s|\\.php)[\\/?].*/,\n};\n\nfunction match(url: string, regex: RegExp): string | undefined {\n return url.match(regex)?.[0];\n}\n\nexport function youtubeURLParser(url: string | null = '') {\n const regExp =\n /(?:youtube(?:-nocookie)?\\.com\\/(?:[^\\/\\n\\s]+\\/\\S+\\/|(?:v|e(?:mbed)?)\\/|\\S*?[?&]vi?=)|youtu\\.be\\/)([a-zA-Z0-9_-]{11})/;\n const id = url?.match(regExp)?.[1];\n if (id) {\n return `https://youtu.be/${id}`;\n }\n\n const paylistMatch = url?.match(/[?&]list=([^#&?]+)/);\n if (paylistMatch?.[1]) {\n return `https://www.youtube.com/embed/videoseries?list=${paylistMatch?.[1]}`;\n }\n\n return undefined;\n}\n\nexport function twitterURLParser(url: string) {\n return match(url, socialRegExps.twitter);\n}\n\nexport function instagramURLParser(url: string) {\n return match(url, socialRegExps.instagram);\n}\n\nexport function tiktokURLParser(url: string) {\n return match(url, socialRegExps.tiktok);\n}\n\nexport function facebookVideoURLParser(url: string) {\n return match(url, socialRegExps.facebookVideo);\n}\n\nexport function facebookPostURLParser(url: string) {\n return match(url, socialRegExps.facebookPost);\n}\n\nexport function createSocial(url = ''): ContentElementType<'instagram' | 'tiktok' | 'youtube' | 'twitter'>[] {\n const embeds: ContentElementType<'instagram' | 'tiktok' | 'youtube' | 'twitter'>[] = [];\n\n const instagram = instagramURLParser(url);\n if (instagram) {\n embeds.push(ContentElement.instagram(instagram));\n }\n\n const twitter = twitterURLParser(url);\n if (twitter) {\n embeds.push(ContentElement.twitter(twitter));\n }\n\n const tiktok = tiktokURLParser(url);\n if (tiktok) {\n embeds.push(ContentElement.tiktok(tiktok));\n }\n\n const youtube = youtubeURLParser(url);\n if (youtube) {\n embeds.push(ContentElement.youtube(youtube));\n }\n\n const facebookPost = facebookPostURLParser(url);\n if (facebookPost) {\n embeds.push(ContentElement.facebook_post(facebookPost));\n }\n\n const facebookVideo = facebookVideoURLParser(url);\n if (facebookVideo) {\n embeds.push(ContentElement.facebook_video(facebookVideo));\n }\n\n return embeds;\n}\n\nexport const randomId = () => `${new Date().toISOString()}-${Math.random()}`;\n","import encode from 'base32-encode';\nimport { v5 as uuidv5 } from 'uuid';\n\nexport const generateArcId = (identifier: string, orgHostname: string) => {\n const namespace = uuidv5(orgHostname, uuidv5.DNS);\n const buffer = uuidv5(identifier, namespace, Buffer.alloc(16));\n return encode(buffer, 'RFC4648', { padding: false });\n};\n\n/**\n * Utility class for generating Arc IDs and source IDs\n *\n * @example\n * ```ts\n * const generator = new IdGenerator(['my-org']);\n * const arcId = generator.getArcId('123'); // Generates a unique for 'my-org' Arc ID\n * const sourceId = generator.getSourceId('123', ['my-site']); // Generates 'my-site-123'\n * ```\n */\nexport class IdGenerator {\n private namespace: string;\n\n constructor(namespaces: string[]) {\n if (!namespaces.length) {\n throw new Error('At least 1 namespace is required');\n }\n\n this.namespace = namespaces.join('-');\n }\n\n getArcId(id: number | string) {\n return generateArcId(id.toString(), this.namespace);\n }\n\n getSourceId(id: number | string, prefixes: string[] = []) {\n return [...prefixes, id].join('-');\n }\n}\n","import assert from 'node:assert';\nimport type { ArcAPIType } from '../../api';\nimport type { Section, SectionReference, SetSectionPayload } from '../../types';\nimport { reference } from './ans';\n\nexport type NavigationTreeNode<T = unknown> = {\n id: string;\n children: NavigationTreeNode<T>[];\n parent: NavigationTreeNode<T> | null;\n meta: T;\n};\n\nexport type NavigationItem = {\n id: string;\n [key: `N${number}`]: string;\n};\n\nexport const buildTree = <T = any>(items: NavigationItem[]) => {\n const tree: NavigationTreeNode<T>[] = [\n {\n id: '/',\n children: [],\n meta: new Proxy(\n {},\n {\n get: () => {\n throw new Error('Root node meta is not accessible');\n },\n }\n ),\n parent: null,\n } as any,\n ];\n\n // Track nodes at each level to maintain parent-child relationships\n // stores last node at each level\n const currLevelNodes: Record<number, NavigationTreeNode<T>> = {\n 0: tree[0],\n };\n\n for (const item of items) {\n const node: NavigationTreeNode<T> = {\n id: item.id,\n parent: null,\n children: [],\n meta: item as any,\n };\n\n // Determine the level of this node\n const levelKey = Object.keys(item).find((key) => key.startsWith('N') && item[key as keyof NavigationItem]);\n const level = Number(levelKey?.replace('N', '')) || 0;\n if (!level) {\n throw new Error(`Invalid level for section ${item.id}`);\n }\n\n // This is a child node - attach to its parent\n const parentLevel = level - 1;\n const parentNode = currLevelNodes[parentLevel];\n\n if (parentNode) {\n node.parent = parentNode;\n parentNode.children.push(node);\n } else {\n throw new Error(`Parent node not found for section ${item.id}`);\n }\n\n // Set this as the current node for its level\n currLevelNodes[level] = node;\n }\n\n // return root nodes children\n return tree[0].children;\n};\n\nexport const flattenTree = <T = any>(tree: NavigationTreeNode<T>[]): NavigationTreeNode<T>[] => {\n const flatten: NavigationTreeNode<T>[] = [];\n\n const traverse = (node: NavigationTreeNode<T>) => {\n flatten.push(node);\n for (const child of node.children) {\n traverse(child);\n }\n };\n\n // traverse all root nodes and their children\n for (const node of tree) {\n traverse(node);\n }\n\n return flatten;\n};\n\nexport const buildAndFlattenTree = <T>(items: NavigationItem[]) => flattenTree<T>(buildTree(items));\n\nexport const groupByWebsites = (sections: Section[]) => {\n return sections.reduce(\n (acc, section) => {\n const website = section._website!;\n if (!acc[website]) acc[website] = [];\n acc[website].push(section);\n return acc;\n },\n {} as Record<string, Section[]>\n );\n};\n\nexport const references = (sections: Section[]) => {\n return sections.map(\n (s) =>\n reference({\n id: s._id,\n website: s._website,\n type: 'section',\n }) as SectionReference\n );\n};\n\nexport const isReference = (section: any): section is SectionReference => {\n return section?.type === 'reference' && section?.referent?.type === 'section';\n};\n\nexport const removeDuplicates = <T extends Section | SectionReference>(sections: T[]): T[] => {\n const map = new Map();\n\n sections.forEach((s) => {\n if (isReference(s)) {\n map.set(`${s.referent.id}${s.referent.website}`, s);\n } else {\n map.set(`${s._id}${s._website}`, s);\n }\n });\n\n return [...map.values()];\n};\n\nexport class SectionsRepository {\n public sectionsByWebsite: Record<string, Section[]> = {};\n public websitesAreLoaded = false;\n\n constructor(protected arc: ArcAPIType) {}\n\n async put(ans: SetSectionPayload) {\n await this.arc.Site.putSection(ans);\n const created = await this.arc.Site.getSection(ans._id, ans.website);\n this.save(created);\n }\n\n async loadWebsite(website: string) {\n const sections: Section[] = [];\n let next = true;\n let offset = 0;\n\n while (next) {\n const migrated = await this.arc.Site.getSections({ website, offset }).catch((_) => {\n return { q_results: [] };\n });\n if (migrated.q_results.length) {\n sections.push(...migrated.q_results);\n offset += migrated.q_results.length;\n } else {\n next = false;\n }\n }\n\n return sections;\n }\n\n async loadWebsites(websites: string[]) {\n for (const website of websites) {\n this.sectionsByWebsite[website] = await this.loadWebsite(website);\n }\n\n this.websitesAreLoaded = true;\n }\n\n save(section: Section) {\n const website = section._website;\n\n assert.ok(website, 'Section must have a website');\n\n this.sectionsByWebsite[website] = this.sectionsByWebsite[website] || [];\n\n if (!this.sectionsByWebsite[website].find((s) => s._id === section._id)) {\n this.sectionsByWebsite[website].push(section);\n }\n }\n\n getById(id: string, website: string) {\n this.ensureWebsitesLoaded();\n\n const section = this.sectionsByWebsite[website]?.find((s) => s._id === id);\n return section;\n }\n\n getByWebsite(website: string) {\n this.ensureWebsitesLoaded();\n\n return this.sectionsByWebsite[website];\n }\n\n getParentSections(section: Section) {\n this.ensureWebsitesLoaded();\n\n const parents: Section[] = [];\n let current = section;\n\n while (current.parent?.default && current.parent.default !== '/') {\n const parent = this.getById(current.parent.default, section._website!);\n if (!parent) break;\n\n parents.push(parent);\n current = parent;\n }\n\n return parents;\n }\n\n protected ensureWebsitesLoaded() {\n assert.ok(this.websitesAreLoaded, 'call .loadWebsites() first');\n }\n}\n","import * as ANS from './ans.js';\nimport * as ContentElements from './content.js';\nimport * as Id from './id.js';\nimport * as Section from './section.js';\n\nexport const ArcUtils = {\n Id,\n ANS,\n ContentElements,\n Section,\n};\n","import type { ANSContent, CirculationReference, PostANSParams, PostANSPayload } from '../api/migration-center/types.js';\nimport type { ContentElementType } from '../content-elements/types.js';\nimport type { ANS } from '../types/index.js';\nimport type { MaybePromise, Optional } from '../types/utils.js';\n\n/**\n * Base class for all arc entities, it provides common methods and properties\n * If you want to create a new entity subtype you should extend this class\n *\n * Use case: You want to migrate stories from BBC\n * You define `class BBCStory extends ArcDocument<ANS.AStory>` and implement all abstract methods\n * Then you can override the specific methods to enrich the story with the data from BBC\n *\n * To migrate it call .migrate() method\n */\nexport abstract class Document<ANS extends ANSContent> {\n public ans: ANS | null = null;\n public circulations: CirculationReference[] = [];\n\n async init(): Promise<void> {\n // fetch necessary data and validate it here\n }\n\n abstract sourceId(): MaybePromise<string>;\n abstract sourceType(): MaybePromise<string>;\n abstract websiteId(): MaybePromise<string>;\n abstract legacyUrl(): MaybePromise<string>;\n abstract arcId(): MaybePromise<string>;\n abstract type(): MaybePromise<string>;\n abstract groupId(): MaybePromise<string>;\n abstract version(): ANS.DescribesTheANSVersionOfThisObject;\n\n abstract getAns(): MaybePromise<ANS>;\n\n async prepare(): Promise<{\n params: PostANSParams;\n payload: PostANSPayload<ANS>;\n }> {\n await this.init();\n\n const payload = await this.payload();\n const params = await this.params();\n\n return { payload, params };\n }\n\n private async payload(): Promise<PostANSPayload<ANS>> {\n this.ans = await this.getAns();\n this.circulations = await this.getCirculations();\n\n return {\n sourceId: await this.sourceId(),\n sourceType: await this.sourceType(),\n ANS: this.ans,\n circulations: this.circulations,\n arcAdditionalProperties: this.additionalProperties(),\n };\n }\n\n private async params(): Promise<PostANSParams> {\n if (!this.websiteId()) {\n throw new Error('Website is not initialized! get params() should be called after payload()!');\n }\n\n return {\n website: await this.websiteId(),\n groupId: await this.groupId(),\n priority: this.priority(),\n };\n }\n\n protected additionalProperties(): PostANSPayload['arcAdditionalProperties'] {\n return {\n story: {\n publish: false,\n },\n };\n }\n\n protected priority(): 'historical' | 'live' {\n return 'historical';\n }\n\n protected getDistributor(): MaybePromise<Optional<ANS.Distributor>> {\n return;\n }\n\n protected getLanguage() {\n return 'en-GB';\n }\n\n protected getComments(): Optional<ANS.Comments> {\n return;\n }\n\n protected async getSource(): Promise<Optional<ANS.Source>> {\n return {\n name: 'code-store',\n system: 'code-store',\n source_id: await this.sourceId(),\n };\n }\n\n protected getSubheadlines(): Optional<ANS.SubHeadlines> {\n return {\n basic: '',\n };\n }\n\n protected getDescription(): Optional<ANS.Description> {\n return this.getSubheadlines();\n }\n\n protected formatDate(date?: Date) {\n if (!date) return;\n return date.toISOString();\n }\n\n protected getDisplayDate(): MaybePromise<Optional<Date>> {\n return new Date();\n }\n\n protected async getContentElements(): Promise<ContentElementType<any>[]> {\n return [];\n }\n\n protected getPublicationDate(): MaybePromise<Optional<Date>> {\n return new Date();\n }\n\n protected getHeadlines(): Optional<ANS.Headlines> {\n return {\n basic: '',\n };\n }\n\n protected getTags(): MaybePromise<Optional<ANS.Tag[]>> {\n return;\n }\n\n protected getSubtype(): MaybePromise<Optional<ANS.SubtypeOrTemplate>> {\n return;\n }\n\n protected getLabel(): MaybePromise<Optional<ANS.Label>> {\n return;\n }\n\n protected getRelatedContent(): MaybePromise<Optional<ANS.Related_Content>> {\n return;\n }\n\n protected async getPromoItems(): Promise<Optional<ANS.PromoItems>> {\n return;\n }\n\n protected getWebskedStatusCode(): MaybePromise<ANS.WorkflowInformation['status_code']> {\n return;\n }\n\n protected getCreditsBy(): MaybePromise<ANS.By> {\n return [];\n }\n\n protected getCirculations(): MaybePromise<CirculationReference[]> {\n return [];\n }\n\n protected getEditorNote(): MaybePromise<Optional<ANS.Editor_Note>> {\n return;\n }\n\n protected getContentRestrictions(): MaybePromise<Optional<ANS.ContentRestrictions>> {\n return;\n }\n\n protected getOwnerInformation(): MaybePromise<Optional<ANS.OwnerInformation>> {\n return;\n }\n\n protected getSyndication(): MaybePromise<Optional<ANS.Syndication>> {\n return;\n }\n\n protected getSchedulingInformation(): MaybePromise<Optional<ANS.SchedulingInformation>> {\n return;\n }\n\n protected getTaxonomy(): MaybePromise<Optional<ANS.Taxonomy>> {\n return;\n }\n}\n","import type { ANSContent } from '../api/migration-center/types.js';\nimport type { ANS } from '../types/index.js';\nimport { Document } from './doc.js';\n\n/**\n * Base class for all arc stories, it provides common methods and properties\n * If you want to create a new story subtype you should extend this class\n *\n * Use case: You want to migrate stories from BBC\n * You define `class BBCStory extends ArcStory` and implement all abstract methods\n * Then you need to override the specific methods to enrich the story with the data from BBC\n *\n * For example:\n * To add tag to BBC stories you need to override\n * protected getTags(): MaybePromise<ArcTypes.Story.Tag[]> {\n * return [{\n * slug: 'bbc',\n * text: 'bbc',\n * }];\n * }\n */\nexport abstract class Story<ANS extends ANSContent = ANS.AStory> extends Document<ANS> {\n type() {\n return 'story' as const;\n }\n\n async getAns() {\n const id = await this.arcId();\n const version = this.version();\n const type = this.type();\n const publicationDate = await this.getPublicationDate();\n const displayDate = await this.getDisplayDate();\n const headlines = this.getHeadlines();\n const subheadlines = this.getSubheadlines();\n const description = this.getDescription();\n const language = this.getLanguage();\n const tags = await this.getTags();\n const subtype = await this.getSubtype();\n const label = await this.getLabel();\n const by = await this.getCreditsBy();\n const relatedContent = await this.getRelatedContent();\n const editorNote = await this.getEditorNote();\n const distributor = await this.getDistributor();\n const promoItems = await this.getPromoItems();\n const contentElements = await this.getContentElements();\n const webskedStatusCode = await this.getWebskedStatusCode();\n const websiteId = await this.websiteId();\n const source = await this.getSource();\n const comments = await this.getComments();\n const legacyUrl = await this.legacyUrl();\n const owner = await this.getOwnerInformation();\n const syndication = await this.getSyndication();\n const contentRestrictions = await this.getContentRestrictions();\n const planning = await this.getSchedulingInformation();\n const taxonomy = await this.getTaxonomy();\n const additionalMetaProperties = await this.getMigrationMetaProperties();\n\n return {\n type,\n _id: id,\n version,\n website: websiteId,\n canonical_website: websiteId,\n language,\n subtype,\n label,\n editor_note: editorNote,\n credits: {\n by,\n },\n headlines,\n subheadlines,\n description,\n distributor,\n planning,\n promo_items: promoItems,\n related_content: relatedContent,\n content_restrictions: contentRestrictions,\n created_date: this.formatDate(new Date()),\n first_publish_date: this.formatDate(publicationDate),\n publish_date: this.formatDate(publicationDate),\n display_date: this.formatDate(displayDate),\n source,\n comments,\n owner,\n syndication,\n taxonomy: {\n ...taxonomy,\n tags,\n },\n workflow: {\n status_code: webskedStatusCode,\n },\n content_elements: contentElements,\n additional_properties: {\n url: legacyUrl,\n ...additionalMetaProperties,\n },\n } as unknown as ANS;\n }\n\n protected async getMigrationMetaProperties(): Promise<Record<string, any>> {\n return {\n // used in dashboard for migration\n migration_source_id: await this.sourceId(),\n migration_source_type: await this.sourceType(),\n // used in dashboard to show the original url\n migration_url: await this.legacyUrl(),\n migration_group_id: await this.groupId(),\n };\n }\n}\n","export const BLOCK_ELEMENT_TAGS = [\n 'ADDRESS',\n 'ARTICLE',\n 'ASIDE',\n 'BLOCKQUOTE',\n 'DETAILS',\n 'DIV',\n 'DL',\n 'FIELDSET',\n 'FIGCAPTION',\n 'FIGURE',\n 'FOOTER',\n 'FORM',\n 'H1',\n 'H2',\n 'H3',\n 'H4',\n 'H5',\n 'H6',\n 'HEADER',\n 'HR',\n 'LINE',\n 'MAIN',\n 'MENU',\n 'NAV',\n 'OL',\n 'P',\n 'PARAGRAPH',\n 'PRE',\n 'SECTION',\n 'TABLE',\n 'UL',\n 'LI',\n 'BODY',\n 'HTML',\n];\n","import { decode } from 'html-entities';\nimport { CommentNode, HTMLElement, type Node, type Options, TextNode, parse } from 'node-html-parser';\nimport type { CElement, ContentElementType } from '../types.js';\n\nexport const isTextNode = (node?: Node): node is TextNode => {\n return node instanceof TextNode;\n};\n\nexport const isHTMLElement = (node?: Node): node is HTMLElement => {\n return node instanceof HTMLElement;\n};\n\nexport const isCommentNode = (node?: Node): node is CommentNode => {\n return node instanceof CommentNode;\n};\n\nexport const nodeTagIs = (node: Node, name: string): node is HTMLElement => {\n return isHTMLElement(node) && node.tagName?.toLowerCase() === name.toLowerCase();\n};\n\nexport const nodeTagIn = (node: Node, names: string[]): node is HTMLElement => {\n return isHTMLElement(node) && names.includes(node.tagName?.toLowerCase());\n};\n\nexport const isTextCE = (ce?: CElement): ce is ContentElementType<'text'> => {\n return ce?.type === 'text';\n};\n\nexport const decodeHTMLEntities = (str: string) => decode(str);\n\nexport const htmlToText = (html?: string | null, parseOptions?: Partial<Options>) => {\n if (!html) return '';\n const doc = parse(html, parseOptions);\n return decodeHTMLEntities(doc.innerText);\n};\n\nexport const getHTMLElementAttribute = (e: HTMLElement, key: string) => {\n const value = e.getAttribute(key);\n if (value) return value;\n\n return new URLSearchParams(e.rawAttrs.replaceAll(' ', '&')).get(key);\n};\n","import { type CommentNode, type HTMLElement, type Node, parse } from 'node-html-parser';\nimport type { MaybePromise } from '../../types/utils.js';\nimport { ContentElement } from '../content-elements.js';\nimport type { CElement, ContentElementType } from '../types.js';\nimport { BLOCK_ELEMENT_TAGS } from './html.constants.js';\nimport {\n getHTMLElementAttribute,\n isCommentNode,\n isHTMLElement,\n isTextCE,\n isTextNode,\n nodeTagIn,\n nodeTagIs,\n} from './html.utils.js';\n\nexport type NodeHandler = (node: Node) => MaybePromise<CElement[] | undefined>;\nexport type WrapHandler = (node: Node, content: ContentElementType<'text'>) => ContentElementType<'text'> | undefined;\n\n/**\n * HTMLProcessor is responsible for parsing HTML content into structured content elements.\n * It provides a flexible way to handle different HTML nodes and wrap text content.\n *\n * The processor can be extended with custom handlers for specific node types and\n * wrappers for text content.\n *\n * @example\n * ```ts\n * // Create and initialize processor\n * const processor = new HTMLProcessor();\n * processor.init();\n *\n * // Parse HTML content\n * const html = '<div><p>Some text</p><img src=\"image.jpg\"></div>';\n * const elements = await processor.parse(html);\n * ```\n *\n * The processor comes with built-in handlers for common HTML elements like links,\n * text formatting (i, u, strong), and block elements. Custom handlers can be added\n * using the `handle()` and `wrap()` methods.\n */\nexport class HTMLProcessor {\n protected parallelProcessing = true;\n\n protected handlers = {\n node: new Map<string, NodeHandler>(),\n wrap: new Map<string, WrapHandler>(),\n };\n\n init() {\n // wrappers are used to wrap the content of nested text nodes\n // in a specific way\n this.wrap('link', (node, text) => {\n if (nodeTagIn(node, ['a'])) {\n const attributes = ['href', 'target', 'rel']\n .map((attr) => [attr, getHTMLElementAttribute(node, attr)])\n .filter(([_, value]) => value)\n .map(([key, value]) => `${key}=\"${value}\"`)\n .join(' ');\n\n return {\n ...text,\n content: `<a ${attributes}>${text.content}</a>`,\n };\n }\n });\n\n this.wrap('i', (node, text) => {\n if (nodeTagIn(node, ['i'])) {\n return {\n ...text,\n content: `<i>${text.content}</i>`,\n };\n }\n });\n\n this.wrap('u', (node, text) => {\n if (nodeTagIn(node, ['u'])) {\n return {\n ...text,\n content: `<u>${text.content}</u>`,\n };\n }\n });\n\n this.wrap('sup/sub', (node, text) => {\n if (nodeTagIn(node, ['sup', 'sub'])) {\n return {\n ...text,\n content: `<mark class=\"${node.tagName.toLowerCase()}\">${text.content}</mark>`,\n };\n }\n });\n\n this.wrap('strong', (node, text) => {\n if (nodeTagIn(node, ['strong', 'b'])) {\n return {\n ...text,\n content: `<b>${text.content}</b>`,\n };\n }\n });\n\n this.wrap('center', (node, text) => {\n if (nodeTagIn(node, ['center'])) {\n return {\n ...text,\n alignment: 'center',\n };\n }\n });\n\n this.wrap('aligned-paragraph', (node, text) => {\n if (nodeTagIn(node, ['p'])) {\n const styleAttribute = getHTMLElementAttribute(node, 'style') || '';\n if (!styleAttribute) return text;\n\n if (styleAttribute.includes('text-align: right;')) {\n return {\n ...text,\n alignment: 'right',\n };\n }\n if (styleAttribute.includes('text-align: left;')) {\n return {\n ...text,\n alignment: 'left',\n };\n }\n if (styleAttribute.includes('text-align: center;')) {\n return {\n ...text,\n alignment: 'center',\n };\n }\n\n return text;\n }\n });\n\n // handlers are used to handle specific nodes\n // and return a list of content elements\n this.handle('default', (node) => {\n const noTag = isHTMLElement(node) && !node.tagName;\n if (\n noTag ||\n nodeTagIn(node, [\n 'p',\n 'a',\n 'b',\n 'sup',\n 'sub',\n 'span',\n 'strong',\n 'em',\n 'i',\n 'u',\n 'section',\n 'main',\n 'div',\n 'li',\n 'center',\n ])\n ) {\n return this.handleNested(node);\n }\n });\n\n this.handle('headers', (node) => {\n if (nodeTagIn(node, ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'])) {\n return this.createHeader(node);\n }\n });\n\n this.handle('text', (node) => {\n if (isTextNode(node)) {\n return this.createText(node);\n }\n });\n\n this.handle('comment', (node) => {\n if (isCommentNode(node)) {\n return this.handleComment(node);\n }\n });\n\n this.handle('list', async (node) => {\n if (nodeTagIn(node, ['ul', 'ol'])) {\n const listType = node.tagName === 'UL' ? 'unordered' : 'ordered';\n return this.createList(node, listType);\n }\n });\n\n this.handle('table', (node) => {\n if (nodeTagIs(node, 'table')) {\n return this.handleTable(node);\n }\n });\n\n this.handle('iframe', (node) => {\n if (nodeTagIs(node, 'iframe')) {\n return this.handleIframe(node);\n }\n });\n\n this.handle('img', (node) => {\n if (nodeTagIs(node, 'img')) {\n return this.handleImage(node);\n }\n });\n\n this.handle('br', (node) => {\n if (nodeTagIs(node, 'br')) {\n return this.handleBreak(node);\n }\n });\n }\n\n protected handle(name: string, handler: NodeHandler) {\n if (this.handlers.node.has(name)) {\n this.warn({ name }, `${name} node handler already set`);\n }\n\n this.handlers.node.set(name, handler);\n }\n\n protected wrap(name: string, handler: WrapHandler) {\n if (this.handlers.wrap.has(name)) {\n this.warn({ name }, `${name} wrap handler already set`);\n }\n\n this.handlers.wrap.set(name, handler);\n }\n\n public async parse(html: string) {\n const doc = parse(html, { comment: true });\n doc.removeWhitespace();\n const elements = await this.process(doc);\n const filtered = elements?.filter((e) => e.type !== 'divider');\n\n return filtered || [];\n }\n\n protected addTextAdditionalProperties(c: ContentElementType<any>, parent: Node) {\n const additionalProperties = c.additional_properties || {};\n const parentNodeIsBlockElement = this.isBlockElement(parent);\n c.additional_properties = {\n ...c.additional_properties,\n isBlockElement: additionalProperties.isBlockElement || parentNodeIsBlockElement,\n };\n return c;\n }\n\n /**\n * Wraps text content elements with additional properties and handlers.\n * This method iterates through an array of content elements and applies\n * wrappers to text elements.\n *\n * @param node - The HTML node containing the text elements\n **/\n protected wrapChildrenTextNodes(node: Node, elements: CElement[]) {\n const wrapped: CElement[] = [];\n const wrappers = [...this.handlers.wrap.values()];\n\n for (const c of elements) {\n if (!isTextCE(c)) {\n wrapped.push(c);\n continue;\n }\n this.addTextAdditionalProperties(c, node);\n\n const handled = wrappers.map((wrapper) => wrapper(node, c)).find(Boolean);\n wrapped.push(handled || c);\n }\n\n return wrapped;\n }\n\n /**\n * Handles nested nodes by processing their children and merging text elements.\n * This method recursively processes the children of a given HTML node and\n * returns a list of content elements.\n *\n * @param node - The HTML node to process\n **/\n protected async handleNested(node: Node) {\n const children = await this.processChildNodes(node);\n const filtered = children.filter(Boolean).flat() as CElement[];\n const merged = this.mergeParagraphs(filtered);\n const wrapped = this.wrapChildrenTextNodes(node, merged);\n\n return wrapped;\n }\n\n protected async processChildNodes(node: Node): Promise<(CElement[] | undefined)[]> {\n if (this.parallelProcessing) {\n return await Promise.all(node.childNodes.map((child) => this.process(child)));\n }\n\n const children: (CElement[] | undefined)[] = [];\n for (const child of node.childNodes) {\n children.push(await this.process(child));\n }\n return children;\n }\n\n /**\n * Processes a single HTML node and converts it into content elements.\n * This method iterates through registered node handlers and attempts to process the node.\n * If a handler successfully processes the node, it returns an array of content elements.\n *\n * @param node - The HTML node to process\n * @returns Promise resolving to an array of content elements, or undefined if node cannot be processed\n */\n protected async process(node: Node) {\n let isKnownNode = false;\n const elements: CElement[] = [];\n\n for (const [name, handler] of this.handlers.node.entries()) {\n try {\n const result = await handler(node);\n\n if (result) {\n // if handler returns an array of elements, it means that the node was handled properly, even if there is no elements inside\n isKnownNode = true;\n elements.push(...result);\n break;\n }\n } catch (error: any) {\n this.warn({ node: node.toString(), error: error.toString(), name }, 'HandlerError');\n }\n }\n if (isKnownNode) return elements;\n this.warn({ node: node.toString() }, 'UnknownNodeError');\n }\n\n /**\n * Merges adjacent text content elements into a single paragraph.\n * This method iterates through an array of content elements and combines\n * adjacent text elements into a single paragraph.\n *\n * @param items - The array of content elements to merge\n **/\n protected mergeParagraphs(items: CElement[]): CElement[] {\n const merged: CElement[] = [];\n let toMerge: ContentElementType<'text'>[] = [];\n\n const merge = (): void => {\n if (!toMerge.length) return;\n\n const paragraph = toMerge.reduce(\n (acc, p) => {\n return {\n ...p,\n content: acc.content + p.content,\n };\n },\n { type: 'text', content: '' }\n );\n\n merged.push(paragraph);\n toMerge = [];\n };\n\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n const isBlockElement = item.additional_properties?.isBlockElement;\n if (isTextCE(item) && !isBlockElement) {\n toMerge.push(item);\n } else {\n merge();\n merged.push(item);\n }\n }\n\n merge();\n\n return merged;\n }\n\n protected handleComment(_: CommentNode): MaybePromise<CElement[]> {\n return [];\n }\n\n protected async handleTable(node: Node) {\n return [ContentElement.raw_html(node.toString())];\n }\n\n protected async handleIframe(node: Node) {\n return [ContentElement.raw_html(node.toString())];\n }\n\n protected async handleImage(node: Node) {\n return [ContentElement.raw_html(node.toString())];\n }\n\n protected async handleBreak(_: Node) {\n return [ContentElement.divider()];\n }\n\n protected async createQuote(node: Node) {\n const items = await this.handleNested(node);\n\n return [ContentElement.quote(items)];\n }\n\n protected async createText(node: Node): Promise<CElement[]> {\n const text = ContentElement.text(node.text);\n return [text];\n }\n\n protected filterListItems(items: ContentElementType<any>[]) {\n return items.filter((i) => ['text', 'list'].includes(i.type));\n }\n\n protected async createList(node: Node, type: 'ordered' | 'unordered'): Promise<ContentElementType<any>[]> {\n const items = await this.handleNested(node);\n return [ContentElement.list(type, this.filterListItems(items))];\n }\n\n protected async createHeader(node: HTMLElement) {\n const level = +node.tagName.split('H')[1] || 3;\n\n return [ContentElement.header(node.innerText, level)];\n }\n\n protected isBlockElement(node: Node) {\n if (!isHTMLElement(node)) return false;\n\n const defaultBlockElements = new Set(BLOCK_ELEMENT_TAGS);\n return defaultBlockElements.has(node.tagName);\n }\n\n protected warn(metadata: Record<string, any>, message: string) {\n console.warn(metadata, message);\n }\n}\n"],"names":["node","uuidv5"],"mappings":";;;;;;;;;;;AAQO,MAAM,iBAAiB,GAAG,CAAC,IAAS,KAAY;AACrD,IAAA,IAAI;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE;IACnC;AAAE,IAAA,MAAM;AACN,QAAA,OAAO,EAAE;IACX;AACF,CAAC;AAqBM,MAAM,6BAA6B,GAAG,CAC3C,gBAA+B,KACmD;IAClF,OAAO;AACL,QAAA,CAAC,QAAQ,KAAK,QAAQ;QACtB,CAAC,KAAK,KAAI;AACR,YAAA,MAAM,gBAAgB,CAAC,KAAK,CAAC;QAC/B,CAAC;KACF;AACH,CAAC;;ACzCK,MAAO,QAAS,SAAQ,KAAK,CAAA;IAQjC,WAAA,CAAY,OAAe,EAAE,CAAa,EAAA;QACxC,MAAM,kBAAkB,GAAG,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,4BAA4B,CAAC;QAC5E,MAAM,cAAc,GAAG,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,wBAAwB,CAAC;AACpE,QAAA,MAAM,IAAI,GAAG;YACX,IAAI,EAAE,CAAA,EAAG,OAAO,CAAA,KAAA,CAAO;YACvB,OAAO,EAA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GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;AAC3C,QAAA,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;IACjE;IAEU,MAAM,YAAY,CAAC,IAAiB,EAAA;AAC5C,QAAA,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAE9C,QAAA,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IACvD;AAEU,IAAA,cAAc,CAAC,IAAU,EAAA;AACjC,QAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;AAAE,YAAA,OAAO,KAAK;AAEtC,QAAA,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,kBAAkB,CAAC;QACxD,OAAO,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;IAC/C;IAEU,IAAI,CAAC,QAA6B,EAAE,OAAe,EAAA;AAC3D,QAAA,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC;IACjC;AACD;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/utils/index.ts","../src/api/error.ts","../src/api/abstract-api.ts","../src/api/author/index.ts","../src/api/content-ops/index.ts","../src/api/content/index.ts","../src/api/custom/index.ts","../src/api/draft/index.ts","../src/api/global-settings/index.ts","../src/api/identity/index.ts","../src/lib/platform/node.ts","../src/lib/platform/index.ts","../src/api/ifx/index.ts","../src/api/migration-center/index.ts","../src/api/photo-center/index.ts","../src/api/redirect/index.ts","../src/api/ws.client.ts","../src/api/retail-events/index.ts","../src/api/developer-retail/index.ts","../src/api/sales/index.ts","../src/api/signing-service/index.ts","../src/api/site/index.ts","../src/api/tags/index.ts","../src/api/websked/index.ts","../src/api/index.ts","../src/types/ans-types.ts","../src/api/migration-center/types.ts","../src/utils/arc/ans.ts","../src/content-elements/content-elements.ts","../src/utils/arc/content.ts","../src/utils/arc/id.ts","../src/utils/arc/section.ts","../src/utils/arc/index.ts","../src/mapper/doc.ts","../src/mapper/story.ts","../src/content-elements/html/html.constants.ts","../src/content-elements/html/html.utils.ts","../src/content-elements/html/html.processor.ts"],"sourcesContent":["export const safeJSONParse = (data: string): any => {\n try {\n return JSON.parse(data);\n } catch {\n return {};\n }\n};\n\nexport const safeJSONStringify = (data: any): string => {\n try {\n return JSON.stringify(data) || '';\n } catch {\n return '';\n }\n};\n\nexport const withTimeout = <T>(fn: Promise<T>, timeout: number): Promise<T> => {\n return new Promise((resolve, reject) => {\n const nodeTimeout = setTimeout(() => {\n reject(`Timeout ${timeout} exceed`);\n }, timeout);\n\n fn.then(\n (data) => {\n clearTimeout(nodeTimeout);\n resolve(data);\n },\n (error) => {\n clearTimeout(nodeTimeout);\n reject(error);\n }\n );\n });\n};\n\nexport const AxiosResponseErrorInterceptor = <T = any, E extends Error = any>(\n errorConstructor: (e: any) => E\n): [onFulfilled?: (value: T) => T | Promise<T>, onRejected?: (error: any) => any] => {\n return [\n (response) => response,\n (error) => {\n throw errorConstructor(error);\n },\n ];\n};\n\nexport const sleep = (ms = 1000) => new Promise((resolve) => setTimeout(resolve, ms));\n\nexport const timestampFromNow = (ms = 0) => {\n return Date.now() + ms;\n};\n","import type { AxiosError, InternalAxiosRequestConfig } from 'axios';\nimport { safeJSONStringify } from '../utils/index.js';\n\nexport class ArcError extends Error {\n public responseData: unknown;\n public responseStatus?: number;\n public responseConfig?: InternalAxiosRequestConfig<any>;\n public ratelimitRemaining?: string;\n public ratelimitReset?: string;\n public service?: string;\n\n constructor(service: string, e: AxiosError) {\n const ratelimitRemaining = e.response?.headers['arcpub-ratelimit-remaining'];\n const ratelimitReset = e.response?.headers['arcpub-ratelimit-reset'];\n const data = {\n name: `${service}Error`,\n message: e.message,\n responseData: e.response?.data,\n responseStatus: e.response?.status,\n responseConfig: e.response?.config,\n ratelimitRemaining,\n ratelimitReset,\n service,\n };\n const message = safeJSONStringify(data);\n\n super(message);\n\n Object.assign(this, data);\n this.stack = e.stack;\n }\n}\n","import axios, { type AxiosError } from 'axios';\nimport * as rateLimit from 'axios-rate-limit';\nimport axiosRetry from 'axios-retry';\nimport { AxiosResponseErrorInterceptor } from '../utils/index.js';\nimport { ArcError } from './error.js';\n\nexport type ArcAbstractAPIOptions = {\n credentials: { organizationName: string; accessToken: string };\n apiPath: string;\n maxRPS?: number;\n maxRetries?: number;\n};\n\nexport type ArcAPIOptions = Omit<ArcAbstractAPIOptions, 'apiPath'>;\n\nexport abstract class ArcAbstractAPI {\n protected name = this.constructor.name;\n protected client: rateLimit.RateLimitedAxiosInstance;\n\n private token = '';\n private host = '';\n private headers = {\n Authorization: '',\n };\n\n constructor(options: ArcAbstractAPIOptions) {\n this.host = `api.${options.credentials.organizationName}.arcpublishing.com`;\n this.token = `Bearer ${options.credentials.accessToken}`;\n this.headers.Authorization = this.token;\n\n const instance = axios.create({\n baseURL: `https://${this.host}/${options.apiPath}`,\n headers: this.headers,\n });\n\n // apply rate limiting\n this.client = (rateLimit as any).default(instance, { maxRPS: options.maxRPS || 10 });\n\n // apply retry\n const retry = typeof axiosRetry === 'function' ? axiosRetry : (axiosRetry as any).default;\n retry(this.client, {\n retries: options.maxRetries || 10,\n retryDelay: axiosRetry.exponentialDelay,\n retryCondition: (err: AxiosError) => this.retryCondition(err),\n });\n\n // wrap response errors\n this.client.interceptors.response.use(\n ...AxiosResponseErrorInterceptor((e) => {\n if (e instanceof ArcError) return e;\n return new ArcError(this.name, e);\n })\n );\n }\n\n setMaxRPS(rps: number) {\n this.client.setMaxRPS(rps);\n }\n\n retryCondition(error: AxiosError) {\n const status = error.response?.status;\n\n switch (status) {\n case axios.HttpStatusCode.RequestTimeout:\n case axios.HttpStatusCode.TooManyRequests:\n case axios.HttpStatusCode.InternalServerError:\n case axios.HttpStatusCode.BadGateway:\n case axios.HttpStatusCode.ServiceUnavailable:\n case axios.HttpStatusCode.GatewayTimeout:\n return true;\n default:\n return false;\n }\n }\n}\n","import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type { ListAuthorsParams, ListAuthorsResponse } from './types.js';\n\nexport class ArcAuthor extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'author' });\n }\n\n async listAuthors(params?: ListAuthorsParams): Promise<ListAuthorsResponse> {\n const { data } = await this.client.get('/v2/author-service', { params });\n\n return data;\n }\n\n async delete(userId: string): Promise<void> {\n const { data } = await this.client.delete(`/v2/author-service/${userId}`);\n\n return data;\n }\n}\n","import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type { ScheduleOperationPayload, UnscheduleOperationPayload } from './types.js';\n\nexport class ArcContentOps extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'contentops/v1' });\n }\n\n async schedulePublish(payload: ScheduleOperationPayload) {\n const { data } = await this.client.put<void>('/publish', payload);\n\n return data;\n }\n\n async scheduleUnpublish(payload: ScheduleOperationPayload) {\n const { data } = await this.client.put<void>('/unpublish', payload);\n\n return data;\n }\n\n async unscheduleUnpublish(payload: UnscheduleOperationPayload) {\n const { data } = await this.client.put<void>('/unschedule_unpublish', payload);\n\n return data;\n }\n\n async unschedulePublish(payload: UnscheduleOperationPayload) {\n const { data } = await this.client.put<void>('/unschedule_publish', payload);\n\n return data;\n }\n}\n","import type { ANS } from '../../types/index.js';\nimport { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type {\n GetStoriesByIdsParams,\n GetStoryParams,\n ScanParams,\n ScanResponse,\n SearchParams,\n SearchResponse,\n} from './types.js';\n\nexport class ArcContent extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'content/v4' });\n }\n\n async getStory(params: GetStoryParams): Promise<ANS.AStory> {\n const { data } = await this.client.get('/stories', { params });\n return data;\n }\n\n async search(params: SearchParams): Promise<SearchResponse> {\n const { data } = await this.client.get('/search', { params });\n return data;\n }\n\n async scan(params: ScanParams): Promise<ScanResponse> {\n const { data } = await this.client.get('/scan', { params });\n return data;\n }\n\n async getStoriesByIds(params: GetStoriesByIdsParams): Promise<SearchResponse> {\n const { data } = await this.client.get('/ids', {\n params: { ...params, ids: params.ids.join(',') },\n });\n return data;\n }\n}\n","import type { AxiosRequestConfig, AxiosResponse } from 'axios';\nimport { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\n\nexport interface RequestConfig extends AxiosRequestConfig {}\n\nexport class Custom extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: '' });\n }\n\n public async request<T = unknown>(\n endpoint: `/${string}`,\n config: AxiosRequestConfig = {}\n ): Promise<AxiosResponse<T>> {\n const response: AxiosResponse<T> = await this.client.request<T>({\n url: endpoint,\n ...config,\n });\n\n return response;\n }\n}\n","import type { ANS } from '../../types/index.js';\nimport { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type {\n Circulations,\n CreateDocumentRedirectPayload,\n CreateExternalRedirectPayload,\n CreateRedirectPayload,\n Document,\n DocumentRedirect,\n ExternalRedirect,\n Revision,\n Revisions,\n UpdateDraftRevisionPayload,\n} from './types.js';\n\nexport class ArcDraft extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'draft/v1' });\n }\n\n async generateId(id: string) {\n const { data } = await this.client.get<{ id: string }>('/arcuuid', { params: { id } });\n return data.id;\n }\n\n async createDocument(ans: ANS.AStory, type = 'story') {\n const { data } = await this.client.post<Document>(`/${type}`, ans);\n return data;\n }\n\n async publishDocument(id: string, type = 'story') {\n const { data } = await this.client.post<Revision>(`/${type}/${id}/revision/published`);\n return data;\n }\n\n async unpublishDocument(id: string, type = 'story') {\n const { data } = await this.client.delete<Revision>(`/${type}/${id}/revision/published`);\n return data;\n }\n\n async deleteDocument(id: string, type = 'story') {\n const { data } = await this.client.delete<Document>(`/${type}/${id}`);\n return data;\n }\n\n async getPublishedRevision(id: string, type = 'story') {\n const { data } = await this.client.get<Revision>(`/${type}/${id}/revision/published`);\n return data;\n }\n\n async getDraftRevision(id: string, type = 'story') {\n const { data } = await this.client.get<Revision>(`/${type}/${id}/revision/draft`);\n return data;\n }\n\n async getCirculations(id: string, type = 'story', after?: string) {\n const { data } = await this.client.get<Circulations>(`/${type}/${id}/circulation`, { params: { after } });\n return data;\n }\n\n async getRevisions(id: string, type = 'story', after?: string) {\n const { data } = await this.client.get<Revisions>(`/${type}/${id}/revision`, { params: { after } });\n return data;\n }\n\n async getRevision(id: string, revisionId: string, type = 'story') {\n const { data } = await this.client.get<Revision>(`/${type}/${id}/revision/${revisionId}`);\n return data;\n }\n\n async createRedirect<\n P extends CreateRedirectPayload,\n R = P extends CreateExternalRedirectPayload\n ? ExternalRedirect\n : P extends CreateDocumentRedirectPayload\n ? DocumentRedirect\n : never,\n >(website: string, websiteUrl: string, payload: P) {\n const { data } = await this.client.post<R>(`/redirect/${website}/${websiteUrl}`, payload);\n return data;\n }\n\n async getRedirect(website: string, websiteUrl: string) {\n const { data } = await this.client.get<ExternalRedirect | DocumentRedirect>(`/redirect/${website}/${websiteUrl}`);\n return data;\n }\n\n async updateDraftRevision(id: string, payload: UpdateDraftRevisionPayload, type = 'story') {\n const { data } = await this.client.put<Revision>(`/${type}/${id}/revision/draft`, payload);\n return data;\n }\n}\n","import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type { CreateDistributorPayload, Distributor, GetDistributorsParams, GetDistributorsResponse } from './types.js';\n\nexport class GlobalSettings extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'settings/v1' });\n }\n\n async getDistributors(params?: GetDistributorsParams) {\n const { data } = await this.client.get<GetDistributorsResponse>('/distributor', { params });\n\n return data;\n }\n\n async createDistributors(payload: CreateDistributorPayload): Promise<Distributor> {\n const { data } = await this.client.post('/distributor', payload);\n\n return data;\n }\n}\n","import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type { GetUserResponse, MigrateBatchUsersPayload, MigrateBatchUsersResponse, UserProfile } from './types.js';\n\nexport class ArcIdentity extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'identity/api/v1' });\n }\n\n async migrateBatch(payload: MigrateBatchUsersPayload) {\n const { data } = await this.client.post<MigrateBatchUsersResponse>('/migrate', payload);\n\n return data;\n }\n\n async *migrateBatchGenerator(\n payload: MigrateBatchUsersPayload,\n batchSize = 100\n ): AsyncGenerator<MigrateBatchUsersResponse> {\n const copy = [...payload.records];\n\n while (copy.length) {\n const records = copy.splice(0, batchSize);\n const response = await this.migrateBatch({ records });\n\n yield response;\n }\n }\n\n async getUser(id: string): Promise<GetUserResponse> {\n const { data } = await this.client.get(`/user?search=uuid=${id}`);\n\n return data;\n }\n\n async getUserByEmail(email: string): Promise<GetUserResponse> {\n const { data } = await this.client.get(`/user?search=email=${email}`);\n\n return data;\n }\n\n async updateUserProfile(id: string, payload: Partial<UserProfile>): Promise<UserProfile> {\n const { data } = await this.client.patch(`/profile/${id}`, payload);\n\n return data;\n }\n}\n","const importNodeModule = async (moduleId: string) => await import(moduleId);\n\nconst modules = {\n // make it like that so static analyzer of webpack won't bundle it\n fs: () => importNodeModule('node:fs') as Promise<typeof import('node:fs')>,\n path: () => importNodeModule('node:path') as Promise<typeof import('node:path')>,\n form_data: () => importNodeModule('form-data') as Promise<typeof import('form-data')>,\n};\n\nexport default modules;\n","import node from './node';\n\nexport default {\n ...node,\n};\n","import platform from '../../lib/platform/index.js';\nimport { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type {\n AddSecretPayload,\n Bundle,\n CreateIntegrationPayload,\n GenereteDeleteTokenResponse,\n GetBundlesResponse,\n GetSubscriptionsResponse,\n Integration,\n SubscribePayload,\n UpdateIntegrationPayload,\n} from './types.js';\n\nexport class ArcIFX extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'ifx/api/v1' });\n }\n\n async createIntegration(payload: CreateIntegrationPayload) {\n await this.client.post('/admin/integration', payload);\n }\n\n async updateIntegration(integrationName: string, payload: UpdateIntegrationPayload) {\n await this.client.put(`/admin/integration/${integrationName}`, payload);\n }\n\n async deleteIntegration(integrationName: string, token: string) {\n await this.client.delete(`/admin/integration/${integrationName}`, { params: { token } });\n }\n\n async generateDeleteIntegrationToken(integrationName: string) {\n const response = await this.client.get<GenereteDeleteTokenResponse>(`/admin/integration/${integrationName}/token`);\n\n return response.data;\n }\n\n async getIntegrations() {\n const { data } = await this.client.get<Integration[]>('/admin/integrations');\n return data;\n }\n\n async getJobs(integrationName: string) {\n const { data } = await this.client.get(`/admin/jobs/status/${integrationName}`);\n return data;\n }\n\n async getStatus(integrationName: string) {\n const { data } = await this.client.get(`/admin/integration/${integrationName}/provisionStatus`);\n return data;\n }\n\n async initializeQuery(integrationName: string, query?: string) {\n const { data } = await this.client.get<{ queryId: string }>(`/admin/logs/integration/${integrationName}?${query}`);\n return data;\n }\n\n async getLogs(queryId: string, raw = true) {\n const { data } = await this.client.get('/admin/logs/results', { params: { queryId, raw } });\n return data;\n }\n\n async subscribe(payload: SubscribePayload) {\n const { data } = await this.client.post('/admin/events/subscriptions', payload);\n return data;\n }\n\n async updateSubscription(payload: SubscribePayload) {\n const { data } = await this.client.put('/admin/events/subscriptions', payload);\n return data;\n }\n\n async getSubscriptions() {\n const { data } = await this.client.get<GetSubscriptionsResponse>('/admin/events/subscriptions');\n return data;\n }\n\n async addSecret(payload: AddSecretPayload) {\n const { data } = await this.client.post(`/admin/secret?integrationName=${payload.integrationName}`, {\n secretName: payload.secretName,\n secretValue: payload.secretValue,\n });\n return data;\n }\n\n async getSecrets(integrationName: string) {\n const { data } = await this.client.get(`/admin/secret?integrationName=${integrationName}`);\n return data;\n }\n\n async getBundles(integrationName: string) {\n const { data } = await this.client.get<GetBundlesResponse>(`/admin/bundles/${integrationName}`);\n return data;\n }\n\n async uploadBundle(integrationName: string, name: string, bundlePath: string) {\n const fs = await platform.fs();\n const FormData = await platform.form_data();\n\n const form = new FormData();\n\n console.log('platform', platform);\n console.log(form);\n const bundle = fs.createReadStream(bundlePath);\n\n form.append('bundle', bundle);\n form.append('name', name);\n\n const { data } = await this.client.post<Bundle>(`/admin/bundles/${integrationName}`, form, {\n headers: form.getHeaders(),\n });\n return data;\n }\n\n async deployBundle(integrationName: string, name: string) {\n const { data } = await this.client.post<Bundle>(`/admin/bundles/${integrationName}/deploy/${name}`);\n return data;\n }\n\n async promoteBundle(integrationName: string, version: number) {\n const { data } = await this.client.post<Bundle>(`/admin/bundles/${integrationName}/promote/${version}`);\n return data;\n }\n}\n","import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type {\n Count,\n CountParams,\n DetailReport,\n DetailReportParams,\n GetANSParams,\n GetRecentGroupIdsResponse,\n GetRemainingTimeParams,\n GetRemainingTimeResponse,\n PostANSParams,\n PostANSPayload,\n Summary,\n SummaryReportParams,\n} from './types.js';\n\nexport class ArcMigrationCenter extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'migrations/v3' });\n }\n\n async summary(params?: SummaryReportParams) {\n const { data, headers } = await this.client.get<Summary>('/report/summary', { params });\n const nextFromId: string | undefined = headers['amc-record-id'];\n\n return { records: data, nextFromId };\n }\n\n async detailed(params?: DetailReportParams) {\n const { data } = await this.client.get<DetailReport>('/report/detail', { params });\n return data;\n }\n\n async count(params?: CountParams) {\n const { data } = await this.client.get<Count>('/report/status/count', {\n params: {\n startDate: params?.startDate?.toISOString(),\n endDate: params?.endDate?.toISOString(),\n },\n });\n return data;\n }\n\n async postAns(params: PostANSParams, payload: PostANSPayload) {\n const { data } = await this.client.post('/content/ans', payload, { params });\n return data;\n }\n\n async getAns(params: GetANSParams) {\n const { data } = await this.client.get('/content/ans', { params });\n return data;\n }\n\n async getRemainingTime(params: GetRemainingTimeParams) {\n const { data } = await this.client.get<GetRemainingTimeResponse>('/report/remaining-time', { params });\n return data;\n }\n\n async getRecentGroupIds() {\n const { data } = await this.client.get<GetRecentGroupIdsResponse>('/report/group-ids');\n return data;\n }\n}\n","import type { ReadStream } from 'node:fs';\nimport platform from '../../lib/platform/index.js';\nimport type { ANS } from '../../types/index.js';\nimport { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type { GetGalleriesParams, GetGalleriesResponse, GetImagesParams, GetImagesResponse } from './types.js';\n\nexport class ArcProtoCenter extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'photo/api' });\n }\n async getImageDataById(imageId: string): Promise<ANS.AnImage> {\n const { data } = await this.client.get(`/v2/photos/${imageId}`);\n return data;\n }\n\n async uploadImageANS(image: ANS.AnImage) {\n const FormData = await platform.form_data();\n const form = new FormData();\n\n form.append('ans', JSON.stringify(image), {\n filename: 'ans.json',\n contentType: 'application/json',\n });\n const { data } = await this.client.post<ANS.AnImage>('/v2/photos', form, { headers: form.getHeaders() });\n return data;\n }\n\n async uploadImageStream(\n readableStream: ReadStream,\n options?: { contentType?: string; filename?: string }\n ): Promise<ANS.AnImage> {\n const path = await platform.path();\n const FormData = await platform.form_data();\n const form = new FormData();\n const contentType = options?.contentType ?? 'application/octet-stream';\n const filename = path.basename(String(options?.filename || readableStream.path || 'file.jpg'));\n\n form.append('file', readableStream, {\n filename: filename,\n contentType,\n });\n\n const { data } = await this.client.post('/v2/photos', form, { headers: form.getHeaders() });\n\n return data;\n }\n\n async deleteImage(imageId: string) {\n const { data } = await this.client.delete(`/v2/photos/${imageId}`);\n return data;\n }\n\n async deleteGallery(galleryId: string) {\n const { data } = await this.client.delete(`/v2/galleries/${galleryId}`);\n return data;\n }\n\n async getImages(params: GetImagesParams) {\n const { data } = await this.client.get<GetImagesResponse>('/v2/photos', { params });\n return data;\n }\n\n async getGalleries(params: GetGalleriesParams) {\n const { data } = await this.client.get<GetGalleriesResponse>('/v2/galleries', { params });\n return data;\n }\n\n async getGallery(galleryId: string) {\n const { data } = await this.client.get<ANS.AGallery>(`/v2/galleries/${galleryId}`);\n return data;\n }\n\n async updateImage(imageId: string, photoDto: ANS.AnImage) {\n const { data } = await this.client.put<ANS.AnImage>(`/v2/photos/${imageId}`, photoDto);\n return data;\n }\n}\n","import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type { ArcRedirectRuleContentType, ArcRedirectRuleType, ArcRedirectRulesResponse } from './types.js';\n\nexport class ArcRedirect extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'delivery-api/v1/cloudlet/redirector/site' });\n }\n\n async getRedirects(orgSiteEnv: string): Promise<ArcRedirectRulesResponse> {\n const { data } = await this.client.get(`/${orgSiteEnv}/rule?limit=1000`);\n return data;\n }\n\n async updateArcRedirectRule(\n orgSiteEnv: string,\n redirectID: string,\n redirectRuleContent: ArcRedirectRuleContentType\n ): Promise<ArcRedirectRuleType> {\n const { data } = await this.client.put(`/${orgSiteEnv}/rule/${redirectID}`, redirectRuleContent);\n return data;\n }\n\n async activateRedirectsVersion(orgSiteEnv: string): Promise<{ task_id: string }> {\n const { data } = await this.client.post(`/${orgSiteEnv}/version`);\n return data;\n }\n}\n","import * as ws from 'ws';\n\nexport type PromiseOr<T> = Promise<T> | T;\nexport type Callback<Args extends any[] = any[]> = (...args: Args) => PromiseOr<void>;\n\nexport class WsClient {\n private socket?: ws.WebSocket;\n\n constructor(\n private address: string,\n private readonly options: ws.ClientOptions\n ) {}\n\n onOpen?: Callback<[]>;\n onMessage?: Callback<[any]>;\n onClose?: Callback<[ws.CloseEvent | undefined]>;\n\n async connect() {\n if (this.socket && this.socket.readyState === this.socket.OPEN) return;\n\n const socket = new ws.WebSocket(this.address, this.options);\n this._closing = false;\n socket.onclose = (event) => this.close(event);\n\n await new Promise((resolve, reject) => {\n socket.onerror = (error) => reject(error);\n socket.onopen = () => resolve(true);\n });\n socket.onmessage = ({ data }) => {\n let message: Record<string, any>;\n try {\n message = JSON.parse(data.toString());\n } catch {\n throw new Error('failed to parse message');\n }\n\n this.onMessage?.(message);\n };\n\n this.socket = socket;\n this.onOpen?.();\n }\n\n private _closing = false;\n close(event?: ws.CloseEvent) {\n if (this._closing) return;\n this._closing = true;\n this.socket?.close();\n this.onClose?.(event);\n }\n\n async send(data: string) {\n this.throwIfNotOpen();\n\n await new Promise((resolve, reject) => {\n this.socket!.send(data, (error) => {\n error ? reject(error) : resolve(undefined);\n });\n });\n }\n\n private throwIfNotOpen() {\n if (!this.socket) {\n throw new Error('Client is not connected');\n }\n\n const { readyState, OPEN } = this.socket;\n if (readyState === OPEN) return;\n if (readyState < OPEN) {\n throw new Error('socket is still connecting');\n }\n if (readyState > OPEN) {\n throw new Error('socket was closed');\n }\n }\n}\n","import type { ArcAPIOptions } from '../abstract-api.js';\nimport { WsClient } from '../ws.client.js';\n\nexport class ArcRetailEvents {\n constructor(private readonly options: Pick<ArcAPIOptions, 'credentials'>) {}\n\n createWsClient(index: '0' | '1' | string = '0') {\n const address = `wss://api.${this.options.credentials.organizationName}.arcpublishing.com/retail/api/v1/event/stream/${index}`;\n const headers = {\n Authorization: `Bearer ${this.options.credentials.accessToken}`,\n };\n\n return new WsClient(address, { headers });\n }\n}\n","import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type {\n GetAllRetailCampaignCategoriesParams,\n GetAllRetailCampaignCategoriesResponse,\n GetAllRetailCampaignsParams,\n GetAllRetailCampaignsResponse,\n GetAllRetailConditionCategoriesParams,\n GetAllRetailConditionCategoriesResponse,\n GetAllRetailOfferAttributesParams,\n GetAllRetailOfferAttributesResponse,\n GetAllRetailOffersParams,\n GetAllRetailOffersResponse,\n GetAllRetailPricingRatesParams,\n GetAllRetailPricingRatesResponse,\n GetAllRetailPricingStrategiesParams,\n GetAllRetailPricingStrategiesResponse,\n GetAllRetailProductAttributesParams,\n GetAllRetailProductAttributesResponse,\n GetAllRetailProductsParams,\n GetAllRetailProductsResponse,\n GetRetailCampaignByIdParams,\n GetRetailCampaignByNameParams,\n GetRetailCampaignCategoryByIdParams,\n GetRetailOfferAttributeByIdParams,\n GetRetailOfferByIdParams,\n GetRetailPricingCycleParams,\n GetRetailPricingRateByIdParams,\n GetRetailPricingStrategyByIdParams,\n GetRetailProductAttributeByIdParams,\n GetRetailProductByIdParams,\n GetRetailProductByPriceCodeParams,\n GetRetailProductBySkuParams,\n RetailCampaign,\n RetailCampaignCategory,\n RetailOffer,\n RetailOfferAttribute,\n RetailPricingCycle,\n RetailPricingRate,\n RetailPricingStrategy,\n RetailProduct,\n RetailProductAttribute,\n} from './types.js';\n\nexport class ArcDeveloperRetail extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'retail/api/v1' });\n }\n\n // ============================================\n // Product Methods\n // ============================================\n\n async getProductById(id: number, params?: GetRetailProductByIdParams): Promise<RetailProduct> {\n const { data } = await this.client.get(`/product/${id}`, { params });\n return data;\n }\n\n async getProductBySku(sku: string, params?: GetRetailProductBySkuParams): Promise<RetailProduct> {\n const { data } = await this.client.get(`/product/sku/${sku}`, { params });\n return data;\n }\n\n async getProductByPriceCode(priceCode: number, params?: GetRetailProductByPriceCodeParams): Promise<RetailProduct> {\n const { data } = await this.client.get(`/product/pricecode/${priceCode}`, { params });\n return data;\n }\n\n async getAllProducts(params?: GetAllRetailProductsParams): Promise<GetAllRetailProductsResponse> {\n const { data } = await this.client.get('/product', { params });\n return data;\n }\n\n // ============================================\n // Pricing Strategy Methods\n // ============================================\n\n async getPricingStrategyById(\n id: number,\n params?: GetRetailPricingStrategyByIdParams\n ): Promise<RetailPricingStrategy> {\n const { data } = await this.client.get(`/pricing/strategy/${id}`, { params });\n return data;\n }\n\n async getAllPricingStrategies(\n params?: GetAllRetailPricingStrategiesParams\n ): Promise<GetAllRetailPricingStrategiesResponse> {\n const { data } = await this.client.get('/pricing/strategy', { params });\n return data;\n }\n\n // ============================================\n // Pricing Rate Methods\n // ============================================\n\n async getPricingRateById(id: number, params?: GetRetailPricingRateByIdParams): Promise<RetailPricingRate> {\n const { data } = await this.client.get(`/pricing/rate/${id}`, { params });\n return data;\n }\n\n async getAllPricingRates(params?: GetAllRetailPricingRatesParams): Promise<GetAllRetailPricingRatesResponse> {\n const { data } = await this.client.get('/pricing/rate', { params });\n return data;\n }\n\n // ============================================\n // Pricing Cycle Methods\n // ============================================\n\n async getPricingCycle(\n priceCode: number,\n cycleIndex: number,\n startDate: string,\n params?: GetRetailPricingCycleParams\n ): Promise<RetailPricingCycle> {\n const { data } = await this.client.get(`/pricing/cycle/${priceCode}/${cycleIndex}/${startDate}`, {\n params,\n });\n return data;\n }\n\n // ============================================\n // Campaign Methods\n // ============================================\n\n async getCampaignById(id: number, params?: GetRetailCampaignByIdParams): Promise<RetailCampaign> {\n const { data } = await this.client.get(`/campaign/${id}`, { params });\n return data;\n }\n\n async getCampaignByName(campaignName: string, params?: GetRetailCampaignByNameParams): Promise<RetailCampaign> {\n const { data } = await this.client.get(`/campaign/${campaignName}/get`, { params });\n return data;\n }\n\n async getAllCampaigns(params?: GetAllRetailCampaignsParams): Promise<GetAllRetailCampaignsResponse> {\n const { data } = await this.client.get('/campaign', { params });\n return data;\n }\n\n // ============================================\n // Campaign Category Methods\n // ============================================\n\n async getCampaignCategoryById(\n id: number,\n params?: GetRetailCampaignCategoryByIdParams\n ): Promise<RetailCampaignCategory> {\n const { data } = await this.client.get(`/campaign/category/${id}`, { params });\n return data;\n }\n\n async getAllCampaignCategories(\n params?: GetAllRetailCampaignCategoriesParams\n ): Promise<GetAllRetailCampaignCategoriesResponse> {\n const { data } = await this.client.get('/campaign/category', { params });\n return data;\n }\n\n // ============================================\n // Offer Methods\n // ============================================\n\n async getOfferById(id: number, params?: GetRetailOfferByIdParams): Promise<RetailOffer> {\n const { data } = await this.client.get(`/offer/${id}`, { params });\n return data;\n }\n\n async getAllOffers(params?: GetAllRetailOffersParams): Promise<GetAllRetailOffersResponse> {\n const { data } = await this.client.get('/offer', { params });\n return data;\n }\n\n // ============================================\n // Offer Attribute Methods\n // ============================================\n\n async getOfferAttributeById(id: number, params?: GetRetailOfferAttributeByIdParams): Promise<RetailOfferAttribute> {\n const { data } = await this.client.get(`/offer/attribute/${id}`, { params });\n return data;\n }\n\n async getAllOfferAttributes(\n params?: GetAllRetailOfferAttributesParams\n ): Promise<GetAllRetailOfferAttributesResponse> {\n const { data } = await this.client.get('/offer/attribute', { params });\n return data;\n }\n\n // ============================================\n // Product Attribute Methods\n // ============================================\n\n async getProductAttributeById(\n id: number,\n params?: GetRetailProductAttributeByIdParams\n ): Promise<RetailProductAttribute> {\n const { data } = await this.client.get(`/product/attribute/${id}`, { params });\n return data;\n }\n\n async getAllProductAttributes(\n params?: GetAllRetailProductAttributesParams\n ): Promise<GetAllRetailProductAttributesResponse> {\n const { data } = await this.client.get('/product/attribute', { params });\n return data;\n }\n\n // ============================================\n // Condition Category Methods\n // ============================================\n\n async getAllConditionCategories(\n params?: GetAllRetailConditionCategoriesParams\n ): Promise<GetAllRetailConditionCategoriesResponse> {\n const { data } = await this.client.get('/condition/categories', { params });\n return data;\n }\n}\n","import platform from '../../lib/platform/index.js';\nimport { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type {\n CreateEnterpriseGroupParams,\n CreateEnterpriseGroupPayload,\n CreateEnterpriseGroupResponse,\n CreateNonceResponse,\n MigrateBatchSubscriptionsParams,\n MigrateBatchSubscriptionsPayload,\n MigrateBatchSubscriptionsResponse,\n} from './types.js';\n\nexport class ArcSales extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'sales/api/v1' });\n }\n\n async migrate(params: MigrateBatchSubscriptionsParams, payload: MigrateBatchSubscriptionsPayload) {\n const FormData = await platform.form_data();\n const form = new FormData();\n\n form.append('file', JSON.stringify(payload), { filename: 'subs.json', contentType: 'application/json' });\n\n const { data } = await this.client.post<MigrateBatchSubscriptionsResponse>('/migrate', form, {\n params,\n headers: {\n ...form.getHeaders(),\n },\n });\n\n return data;\n }\n}\n\nexport class ArcSalesV2 extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'sales/api/v2' });\n }\n\n async getEnterpriseGroups(params: CreateEnterpriseGroupParams): Promise<CreateEnterpriseGroupResponse> {\n const { data } = await this.client.get<any>('/subscriptions/enterprise', {\n params: {\n 'arc-site': params.site,\n },\n });\n return data;\n }\n\n async createEnterpriseGroup(\n params: CreateEnterpriseGroupParams,\n payload: CreateEnterpriseGroupPayload\n ): Promise<CreateEnterpriseGroupResponse> {\n const { data } = await this.client.post<CreateEnterpriseGroupResponse>('/subscriptions/enterprise', payload, {\n params: {\n 'arc-site': params.site,\n },\n });\n return data;\n }\n\n async createNonce(website: string, enterpriseGroupId: number) {\n const { data } = await this.client.get<CreateNonceResponse>(`/subscriptions/enterprise/${enterpriseGroupId}`, {\n params: { 'arc-site': website },\n });\n return data;\n }\n}\n","import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type { SignResponse } from './types.js';\n\nexport class ArcSigningService extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'signing-service' });\n }\n async sign(service: string, serviceVersion: string, imageId: string): Promise<SignResponse> {\n const { data } = await this.client.get(`/v2/sign/${service}/${serviceVersion}?value=${encodeURI(imageId)}`);\n return data;\n }\n}\n","import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type {\n GetLinksParams,\n GetLinksResponse,\n GetSectionParams,\n GetSectionsResponse,\n Link,\n Section,\n SetSectionPayload,\n Website,\n} from './types.js';\n\nexport class ArcSite extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'site/v3' });\n }\n\n async getSections(params: GetSectionParams) {\n const { data } = await this.client.get<GetSectionsResponse>(`/website/${params.website}/section`, {\n params: { _website: params.website, ...params },\n });\n\n return data;\n }\n\n async getSection(id: string, website: string) {\n const { data } = await this.client.get<Section>(`/website/${website}/section?_id=${id}`);\n\n return data;\n }\n\n async deleteSection(id: string, website: string) {\n await this.client.delete(`/website/${website}/section?_id=${id}`);\n }\n\n async putSection(section: SetSectionPayload) {\n const { data } = await this.client.put(`/website/${section.website}/section?_id=${section._id}`, section);\n\n return data;\n }\n\n async getWebsites() {\n const { data } = await this.client.get<Website[]>('/website');\n\n return data;\n }\n\n async putLink(link: Link) {\n const { data } = await this.client.put<Link>(`/website/${link._website}/link/${link._id}`, link);\n\n return data;\n }\n\n async deleteLink(id: string, website: string) {\n const { data } = await this.client.delete(`/website/${website}/link/${id}`);\n\n return data;\n }\n\n async getLinks(params: GetLinksParams) {\n const { data } = await this.client.get<GetLinksResponse>(`/website/${params.website}/link`, { params });\n\n return data;\n }\n}\n","import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type {\n AddTagsPayload,\n AddTagsResponse,\n DeleteTagPayload,\n DeleteTagsResponse,\n GetAllTagsParams,\n GetTagsResponse,\n SearchTagsParams,\n SearchTagsV2Params,\n} from './types.js';\n\nexport class ArcTags extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'tags' });\n }\n\n async getAllTags(params: GetAllTagsParams) {\n const { data } = await this.client.get<GetTagsResponse>('/', { params });\n return data;\n }\n\n /*\n * @Deprecated\n * May return incorrect results\n * Use searchTagsV2 instead\n */\n async searchTags(params: SearchTagsParams) {\n const { data } = await this.client.get<GetTagsResponse>('/search', { params });\n return data;\n }\n\n async searchTagsV2(params: SearchTagsV2Params) {\n const { data } = await this.client.get<GetTagsResponse>('/v2/search', { params });\n return data;\n }\n\n async addTags(payload: AddTagsPayload) {\n const { data } = await this.client.post<AddTagsResponse>('/add', payload);\n return data;\n }\n\n async deleteTags(payload: DeleteTagPayload) {\n const { data } = await this.client.post<DeleteTagsResponse>('/delete', payload);\n return data;\n }\n}\n","import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';\nimport type {\n CreateTaskPayload,\n CreateTaskResponse,\n GetEditionTimesResponse,\n GetPublicationsResponse,\n GetStatusesResponse,\n ReportStatusChangePayload,\n SectionEdition,\n WebskedPublication,\n} from './types.js';\n\nexport class ArcWebsked extends ArcAbstractAPI {\n constructor(options: ArcAPIOptions) {\n super({ ...options, apiPath: 'websked' });\n }\n\n async reportStatusChange(payload: ReportStatusChangePayload): Promise<void> {\n const { data } = await this.client.post<void>('/tasks/workflowStatusChange', payload);\n return data;\n }\n\n async createTask(payload: CreateTaskPayload): Promise<CreateTaskResponse> {\n const { data } = await this.client.post('/tasks', payload);\n return data;\n }\n\n async getEditionTimes(\n publicationId: string,\n startDate: number,\n endDate: number,\n numEditions = 1\n ): Promise<GetEditionTimesResponse> {\n const { data } = await this.client.get(`/publications/${publicationId}/editionTimes`, {\n params: { startDate, endDate, numEditions },\n });\n return data;\n }\n\n async getSectionStories(\n publicationId: string,\n sectionId: string,\n timestamp: number,\n includeStories = true\n ): Promise<SectionEdition> {\n const { data } = await this.client.get(\n `/publications/${publicationId}/sections/${sectionId}/editions/${timestamp}`,\n { params: { includeStories } }\n );\n return data;\n }\n\n async getSectionEditions(\n publicationId: string,\n sectionId: string,\n startDate: number,\n numEditions = 100\n ): Promise<SectionEdition[]> {\n const { data } = await this.client.get(`/publications/${publicationId}/sections/${sectionId}/editions`, {\n params: { startDate, numEditions },\n });\n return data;\n }\n\n async getPublications(nameRegex: string): Promise<GetPublicationsResponse> {\n const { data } = await this.client.get('/publications', { params: { nameRegex } });\n return data;\n }\n\n async getPublicationById(publicationId: string): Promise<WebskedPublication> {\n const { data } = await this.client.get(`/publications/${publicationId}`);\n return data;\n }\n\n async getStatuses(): Promise<GetStatusesResponse> {\n const { data } = await this.client.get('/statuses');\n return data;\n }\n}\n","import type { ArcAPIOptions } from './abstract-api.js';\nimport { ArcAuthor } from './author/index.js';\nimport { ArcContentOps } from './content-ops/index.js';\nimport { ArcContent } from './content/index.js';\nimport { Custom } from './custom/index.js';\nimport { ArcDraft } from './draft/index.js';\nimport { GlobalSettings } from './global-settings/index.js';\nimport { ArcIdentity } from './identity/index.js';\nimport { ArcIFX } from './ifx/index.js';\nimport { ArcMigrationCenter } from './migration-center/index.js';\nimport { ArcProtoCenter } from './photo-center/index.js';\nimport { ArcRedirect } from './redirect/index.js';\nimport { ArcRetailEvents } from './retail-events/index.js';\nimport { ArcDeveloperRetail } from './developer-retail/index.js';\nimport { ArcSales, ArcSalesV2 } from './sales/index.js';\nimport { ArcSigningService } from './signing-service/index.js';\nimport { ArcSite } from './site/index.js';\nimport { ArcTags } from './tags/index.js';\nimport { ArcWebsked } from './websked/index.js';\n\nexport const ArcAPI = (options: ArcAPIOptions) => {\n const API = {\n Author: new ArcAuthor(options),\n Draft: new ArcDraft(options),\n Identity: new ArcIdentity(options),\n IFX: new ArcIFX(options),\n Redirect: new ArcRedirect(options),\n MigrationCenter: new ArcMigrationCenter(options),\n Sales: new ArcSales(options),\n SalesV2: new ArcSalesV2(options),\n Site: new ArcSite(options),\n Websked: new ArcWebsked(options),\n Content: new ArcContent(options),\n SigningService: new ArcSigningService(options),\n PhotoCenter: new ArcProtoCenter(options),\n GlobalSettings: new GlobalSettings(options),\n Tags: new ArcTags(options),\n ContentOps: new ArcContentOps(options),\n RetailEvents: new ArcRetailEvents(options),\n DeveloperRetail: new ArcDeveloperRetail(options),\n Custom: new Custom(options),\n };\n\n API.MigrationCenter.setMaxRPS(12);\n API.Draft.setMaxRPS(4);\n API.Content.setMaxRPS(3);\n\n return API;\n};\n\nexport type ArcAPIType = ReturnType<typeof ArcAPI>;\n","/* eslint-disable */\n/**\n * This file was automatically generated by json-schema-to-typescript.\n * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,\n * and run json-schema-to-typescript to regenerate this file.\n */\n\n/**\n * A globally unique identifier of the content in the ANS repository.\n */\nexport type GloballyUniqueIDTrait = string;\n/**\n * The version of ANS that this object was serialized as, in major.minor.patch format. For top-level content objects, this is a required trait.\n */\nexport type DescribesTheANSVersionOfThisObject = '0.10.12';\n/**\n * A user-defined categorization method to supplement type. In Arc, this field is reserved for organization-defined purposes, such as selecting the PageBuilder template that should be used to render a document.\n */\nexport type SubtypeOrTemplate = string;\n/**\n * An optional list of output types for which this element should be visible\n */\nexport type ChannelTrait = string[];\n/**\n * A property used to determine horizontal positioning of a content element relative to the elements that immediately follow it in the element sequence.\n */\nexport type Alignment = 'left' | 'right' | 'center';\n/**\n * The primary language of the content. The value should follow IETF BCP47. (e.g. 'en', 'es-419', etc.)\n */\nexport type Locale = string;\n/**\n * A copyright notice for the legal owner of this content. E.g., '© 1996-2018 The Washington Post.' Format may vary between organizations.\n */\nexport type CopyrightInformation = string;\n/**\n * The relative URL to this document on the website specified by the `canonical_website` field. In the Arc ecosystem, this will be populated by the content api from the arc-canonical-url service if present based on the canonical_website. In conjunction with canonical_website, it can be used to determine the SEO canonical url or open graph url. In a multi-site context, this field may be different from the website_url field.\n */\nexport type CanonicalURL = string;\n/**\n * The _id of the website from which this document was originally authored. In conjunction with canonical_url, it can be used to determine the SEO canonical url or open graph url. In a multi-site context, this field may be different from the website field.\n */\nexport type CanonicalWebsite = string;\n/**\n * The _id of the website on which this document exists. This field is only available in Content API. If different from canonical_website, then this document was originally sourced from the canonical_website. Generated at fetch time by Content API.\n */\nexport type Website = string;\n/**\n * The relative URL to this document on the website specified by the `website` field. In a multi-site context, this is the url that is typically queried on when fetching by URL. It may be different than canonical_url. Generated at fetch time by Content API.\n */\nexport type WebsiteURL = string;\n/**\n * A url-shortened version of the canonical url.\n */\nexport type Short_Url = string;\n/**\n * When the content was originally created (RFC3339-formatted). In the Arc ecosystem, this will be automatically generated for stories in the Story API.\n */\nexport type CreatedDate = string;\n/**\n * When the content was last updated (RFC3339-formatted).\n */\nexport type LastUpdatedDate = string;\n/**\n * When the story was published.\n */\nexport type Publish_Date = string;\n/**\n * When the story was first published.\n */\nexport type FirstPublishDate = string;\n/**\n * The RFC3339-formatted dated time of the most recent date the story was (re)displayed on a public site.\n */\nexport type Display_Date = string;\n/**\n * A description of the location, useful if a full address or lat/long specification is overkill.\n */\nexport type LocationRelatedTrait = string;\n/**\n * Additional information to be displayed near the content from the editor.\n */\nexport type Editor_Note = string;\n/**\n * Optional field to story story workflow related status (e.g. published/embargoed/etc)\n */\nexport type Status = string;\n/**\n * The full human name of contributor. See also byline, first_name, last_name, middle_name, suffix.\n */\nexport type Name = string;\n/**\n * The primary author(s) of this document. For a story, is is the writer or reporter. For an image, it is the photographer.\n */\nexport type By1 = (AnAuthorOfAPieceOfContent | RepresentationOfANormalizedElement)[];\n/**\n * The photographer(s) of supplementary images included in this document, if it is a story. Note that if this document is an image, the photographer(s) should appear in the 'by' slot.\n */\nexport type PhotosBy = (AnAuthorOfAPieceOfContent | RepresentationOfANormalizedElement)[];\n/**\n * A short reference name for internal editorial use\n */\nexport type Slug = string;\n/**\n * Foreign ID of embedded item.\n */\nexport type EmbedID = string;\n/**\n * Provider URL for this embed item. When concatenated with Embed ID, should produce a URL that returns json metadata about the embedded content.\n */\nexport type EmbedProviderURL = string;\n/**\n * This note is used for shared communication inside the newsroom.\n */\nexport type InternalNote = string;\n/**\n * Used for the newsroom to identify what the story is about, especially if a user is unfamiliar with the slug of a story and the headline or they do not yet exist. Newsroom use only.\n */\nexport type BudgetLine = string;\n/**\n * Information about a third party that provided this content from outside this document's hosted organization.\n */\nexport type Distributor =\n | {\n /**\n * The human-readable name of the distributor of this content. E.g., Reuters.\n */\n name?: string;\n /**\n * The machine-readable category of how this content was produced. Use 'staff' if this content was produced by an employee of the organization who owns this document repository. (Multisite note: content produced within a single *organization*, but shared across multiple *websites* should still be considered 'staff.') Use ‘wires’ if this content was produced for another organization and shared with the one who owns this document repository. Use 'freelance' if this content was produced by an individual on behalf of the organization who owns this document repository. Use 'stock' if this content is stock media distributed directly from a stock media provider. Use 'handout' if this is content provided from a source for an article (usually promotional media distributed directly from a company). Use 'other' for all other cases.\n */\n category?: 'staff' | 'wires' | 'freelance' | 'stock' | 'handout' | 'other';\n /**\n * The machine-readable subcategory of how this content was produced. E.g., 'freelance - signed'. May vary between organizations.\n */\n subcategory?: string;\n additional_properties?: HasAdditionalProperties;\n mode?: 'custom';\n }\n | {\n /**\n * The ARC UUID of the distributor of this content. E.g., ABCDEFGHIJKLMNOPQRSTUVWXYZ.\n */\n reference_id: string;\n mode: 'reference';\n };\n/**\n * An list of alternate names that this content can be fetched by instead of id.\n */\nexport type AliasesTrait = string[];\n/**\n * A more specific category for an image.\n */\nexport type ImageType = string;\n/**\n * The direct ANS equivalent of the HTML 'alt' attribute. A description of the contents of an image for improved accessibility.\n */\nexport type AltText = string;\n/**\n * Human-friendly filename used by PageBuilder & Resizer to improve image SEO scoring.\n */\nexport type SEOFilename = string;\n/**\n * Links to various social media\n */\nexport type SocialLinks = {\n site?: string;\n url?: string;\n [k: string]: unknown;\n}[];\n/**\n * The real first name of a human author.\n */\nexport type FirstName = string;\n/**\n * The real middle name of a human author.\n */\nexport type MiddleName = string;\n/**\n * The real last name of a human author.\n */\nexport type LastName = string;\n/**\n * The real suffix of a human author.\n */\nexport type Suffix = string;\n/**\n * The public-facing name, or nom-de-plume, name of the author.\n */\nexport type Byline = string;\n/**\n * The city or locality that the author resides in or is primarily associated with.\n */\nexport type Location = string;\n/**\n * The desk or group that this author normally reports to. E.g., 'Politics' or 'Sports.'\n */\nexport type Division = string;\n/**\n * The professional email address of this author.\n */\nexport type EMail = string;\n/**\n * The organizational role or title of this author.\n */\nexport type Role = string;\n/**\n * A comma-delimited list of subjects the author in which the author has expertise.\n */\nexport type Expertise = string;\n/**\n * The name of an organization the author is affiliated with. E.g., The Washington Post, or George Mason University.\n */\nexport type Affiliation = string;\n/**\n * A description of list of languages that the author is somewhat fluent in, excluding the native language of the parent publication, and identified in the language of the parent publication. E.g., Russian, Japanese, Greek.\n */\nexport type Languages = string;\n/**\n * A one or two sentence description of the author.\n */\nexport type ShortBiography = string;\n/**\n * The full biography of the author.\n */\nexport type LongBiography = string;\n/**\n * The book title.\n */\nexport type Title = string;\n/**\n * A link to a page to purchase or learn more about the book.\n */\nexport type URL = string;\n/**\n * A list of books written by the author.\n */\nexport type Books = Book[];\n/**\n * The name of the school.\n */\nexport type SchoolName = string;\n/**\n * A list of schools that this author has graduated from.\n */\nexport type Education = School[];\n/**\n * The name of the award.\n */\nexport type AwardName = string;\n/**\n * A list of awards the author has received.\n */\nexport type Awards = {\n award_name?: AwardName;\n}[];\n/**\n * If true, this author is an external contributor to the publication.\n */\nexport type Contributor = boolean;\n/**\n * Deprecated. In ANS 0.5.8 and prior versions, this field is populated with the 'location' field from Arc Author Service. New implementations should use the 'location' and 'affiliation' field. Content should be identical to 'location.'\n */\nexport type Org = string;\n/**\n * Links to various social media\n */\nexport type SocialLinks1 = {\n site?: string;\n url?: string;\n [k: string]: unknown;\n}[];\n/**\n * The primary author(s) of this document. For a story, is is the writer or reporter. For an image, it is the photographer.\n */\nexport type By = (AnAuthorOfAPieceOfContent | RepresentationOfANormalizedElement)[];\n/**\n * The photographer(s) of supplementary images included in this document, if it is a story. Note that if this document is an image, the photographer(s) should appear in the 'by' slot.\n */\nexport type PhotosBy1 = (AnAuthorOfAPieceOfContent | RepresentationOfANormalizedElement)[];\n/**\n * Holds attributes of an ANS collection - a common parent to story and gallery objects.\n */\nexport type ACollectionOfContent = AnElementThatCanBeListedAsPartOfContentElements[];\n/**\n * The absolute URL of the document on website which will override any relative URL specified by the `canonical_url` field.\n */\nexport type CanonicalExternalURL = string;\n/**\n * Trait that applies a list of corrections to a document.\n */\nexport type Corrections = Correction[];\n/**\n * True if and only if at least one published edition exists for this content item.\n */\nexport type HasPublishedEdition = boolean;\n/**\n * The machine-readable identifier of this edition. This should be the same as the key in 'editions' for the edition object.\n */\nexport type EditionName = string;\n/**\n * The machine-generated date that this edition was last updated (i.e., that the content item was published/unpublished to a particular destination.)\n */\nexport type EditionDate = string;\n/**\n * The machine-generated date that this edition was created for the first time (i.e., that the content item was first published.)\n */\nexport type FirstPublishedDateEdition = string;\n/**\n * The human-editable date that should be shown to readers as the 'date' for this content item. When viewing the story at this edition name directly, this will override whatever value is set for Display Date on the story directly. After an edition is created, subsequent updates to that edition will not change this date unless otherwise specified.\n */\nexport type DisplayDateEdition = string;\n/**\n * The machine-editable date that should be shown to readers as the 'publish date' for this content item. When viewing the story at this edition name directly, this will override whatever value is set for Publish Date on the story directly. Every time an edition is updated (i.e. a story is republished) this date will also be updated unless otherwise specified.\n */\nexport type PublishDateEdition = string;\n/**\n * If false, this edition has been deleted/unpublished.\n */\nexport type PublishStatus = boolean;\n/**\n * The id of the revision that this edition was created from. Omitted if unpublished.\n */\nexport type RevisionID = string;\n/**\n * The revision id to be published.\n */\nexport type RevisionIDOperation = string;\n/**\n * The name of the edition this operation will publish to.\n */\nexport type EditionNameOperation = string;\n/**\n * The date that this operation will be performed.\n */\nexport type OperationDate = string;\n/**\n * The name of the edition this operation will publish to.\n */\nexport type EditionNameOperation1 = string;\n/**\n * The date that this operation will be performed.\n */\nexport type OperationDate1 = string;\n/**\n * A globally unique identifier of the content in the ANS repository.\n */\nexport type GloballyUniqueIDTrait1 = string;\n/**\n * Any voice transcripts (e.g. text-to-speech or author-narrations) of the document requested by the user, along with configuration information and the resulting output.\n *\n * @minItems 1\n */\nexport type VoiceTranscriptSConfigurationAndOutput = [\n {\n _id?: GloballyUniqueIDTrait;\n type?: 'voice_transcript';\n subtype?: SubtypeOrTemplate;\n options: OptionsRequested;\n options_used?: OptionsUsed;\n output?: HttpsRawGithubusercontentComWashingtonpostAnsSchemaMasterSrcMainResourcesSchemaAns01012AudioJson;\n [k: string]: unknown;\n },\n ...{\n _id?: GloballyUniqueIDTrait;\n type?: 'voice_transcript';\n subtype?: SubtypeOrTemplate;\n options: OptionsRequested;\n options_used?: OptionsUsed;\n output?: HttpsRawGithubusercontentComWashingtonpostAnsSchemaMasterSrcMainResourcesSchemaAns01012AudioJson;\n [k: string]: unknown;\n }[],\n];\n/**\n * If true, then a transcript of the appropriate options was requested for this document.\n */\nexport type Enabled = boolean;\n/**\n * The id of the 'voice' used to read aloud an audio transcript.\n */\nexport type VoiceID = string;\n/**\n * If true, then a transcript of the appropriate options was generated for this document.\n */\nexport type Enabled1 = boolean;\n/**\n * The id of the 'voice' used to read aloud an audio transcript.\n */\nexport type VoiceID1 = string;\n/**\n * Audio Content\n */\nexport type HttpsRawGithubusercontentComWashingtonpostAnsSchemaMasterSrcMainResourcesSchemaAns01012AudioJson = {\n type: 'audio';\n _id?: GloballyUniqueIDTrait;\n version: DescribesTheANSVersionOfThisObject;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n language?: Locale;\n copyright?: CopyrightInformation;\n canonical_url?: CanonicalURL;\n short_url?: Short_Url;\n created_date?: CreatedDate;\n last_updated_date?: LastUpdatedDate;\n publish_date?: Publish_Date;\n first_publish_date?: FirstPublishDate;\n display_date?: Display_Date;\n location?: LocationRelatedTrait;\n geo?: Geo;\n address?: Address;\n editor_note?: Editor_Note;\n status?: Status;\n headlines?: Headlines;\n subheadlines?: SubHeadlines;\n description?: Description;\n credits?: CreditTrait;\n vanity_credits?: VanityCreditsTrait;\n taxonomy?: Taxonomy;\n promo_items?: PromoItems;\n related_content?: Related_Content;\n owner?: OwnerInformation;\n planning?: SchedulingInformation;\n workflow?: WorkflowInformation;\n pitches?: Pitches;\n revision?: Revision;\n syndication?: Syndication;\n source?: Source;\n distributor?: Distributor;\n tracking?: Tracking;\n comments?: Comments;\n label?: Label;\n slug?: Slug;\n content_restrictions?: ContentRestrictions;\n additional_properties?: HasAdditionalProperties;\n content_aliases?: AliasesTrait;\n /**\n * (Deprecated.) The audio source file. Use 'streams' instead.\n */\n source_url?: string;\n /**\n * (Deprecated.) Mime type of audio source file. Use 'streams' instead.\n */\n mimetype?: string;\n /**\n * Whether to autoplay is enabled.\n */\n autoplay?: boolean;\n /**\n * Whether controls are enabled.\n */\n controls?: boolean;\n /**\n * Whether looping is enabled.\n */\n loop?: boolean;\n /**\n * Whether preload is enabled.\n */\n preload?: boolean;\n /**\n * The different streams this audio can play in.\n *\n * @minItems 1\n */\n streams?: [AStreamOfAudio, ...AStreamOfAudio[]];\n} & (\n | {\n [k: string]: unknown;\n }\n | {\n [k: string]: unknown;\n }\n);\n/**\n * The size of the audio file in bytes.\n */\nexport type FileSize = number;\n/**\n * The codec used to encode the audio stream. (E.g. mpeg)\n */\nexport type AudioCodec = string;\n/**\n * The type of audio (e.g. mp3).\n */\nexport type AudioStreamType = string;\n/**\n * The file location of the stream.\n */\nexport type URL1 = string;\n/**\n * The bitrate of the audio in kilobytes per second.\n */\nexport type Bitrate = number;\n\nexport interface Root {\n gallery_root: AGallery;\n story_root: AStory;\n video_root: VideoContent;\n}\n/**\n * Holds attributes of an ANS gallery. In the Arc ecosystem, these are stored in Anglerfish.\n */\nexport interface AGallery {\n type: 'gallery';\n _id?: GloballyUniqueIDTrait;\n version: DescribesTheANSVersionOfThisObject;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n language?: Locale;\n copyright?: CopyrightInformation;\n canonical_url?: CanonicalURL;\n canonical_website?: CanonicalWebsite;\n website?: Website;\n website_url?: WebsiteURL;\n short_url?: Short_Url;\n created_date?: CreatedDate;\n last_updated_date?: LastUpdatedDate;\n publish_date?: Publish_Date;\n first_publish_date?: FirstPublishDate;\n display_date?: Display_Date;\n location?: LocationRelatedTrait;\n geo?: Geo;\n address?: Address;\n editor_note?: Editor_Note;\n status?: Status;\n headlines?: Headlines;\n subheadlines?: SubHeadlines;\n description?: Description;\n credits?: CreditTrait;\n vanity_credits?: VanityCreditsTrait;\n taxonomy?: Taxonomy;\n promo_items?: PromoItems;\n related_content?: Related_Content;\n owner?: OwnerInformation;\n planning?: SchedulingInformation;\n workflow?: WorkflowInformation;\n pitches?: Pitches;\n revision?: Revision;\n syndication?: Syndication;\n source?: Source;\n distributor?: Distributor;\n tracking?: Tracking;\n comments?: Comments;\n label?: Label;\n slug?: Slug;\n content_restrictions?: ContentRestrictions;\n additional_properties?: HasAdditionalProperties;\n content_aliases?: AliasesTrait;\n content_elements?: ACollectionOfContent;\n websites?: WebsitesInput;\n contributors?: Contributors;\n}\n/**\n * Latitidue and Longitude of the content\n */\nexport interface Geo {\n latitude?: number;\n longitude?: number;\n [k: string]: unknown;\n}\n/**\n * An Address following the convention of http://microformats.org/wiki/hcard\n */\nexport interface Address {\n post_office_box?: string;\n extended_address?: string;\n street_address?: string;\n locality?: string;\n region?: string;\n postal_code?: string;\n country_name?: string;\n additional_properties?: HasAdditionalProperties;\n}\n/**\n * A grab-bag object for non-validatable data.\n */\nexport interface HasAdditionalProperties {\n [k: string]: unknown;\n}\n/**\n * The headline(s) or title for this content. The 'basic' key is required.\n */\nexport interface Headlines {\n basic: string;\n /**\n * This interface was referenced by `Headlines`'s JSON-Schema definition\n * via the `patternProperty` \".*\".\n *\n * This interface was referenced by `SubHeadlines`'s JSON-Schema definition\n * via the `patternProperty` \".*\".\n *\n * This interface was referenced by `Description`'s JSON-Schema definition\n * via the `patternProperty` \".*\".\n */\n [k: string]: string;\n}\n/**\n * The sub-headline(s) for the content.\n */\nexport interface SubHeadlines {\n basic: string;\n /**\n * This interface was referenced by `Headlines`'s JSON-Schema definition\n * via the `patternProperty` \".*\".\n *\n * This interface was referenced by `SubHeadlines`'s JSON-Schema definition\n * via the `patternProperty` \".*\".\n *\n * This interface was referenced by `Description`'s JSON-Schema definition\n * via the `patternProperty` \".*\".\n */\n [k: string]: string;\n}\n/**\n * The descriptions, or blurbs, for the content.\n */\nexport interface Description {\n basic: string;\n /**\n * This interface was referenced by `Headlines`'s JSON-Schema definition\n * via the `patternProperty` \".*\".\n *\n * This interface was referenced by `SubHeadlines`'s JSON-Schema definition\n * via the `patternProperty` \".*\".\n *\n * This interface was referenced by `Description`'s JSON-Schema definition\n * via the `patternProperty` \".*\".\n */\n [k: string]: string;\n}\n/**\n * A list of people and groups attributed to this content, keyed by type of contribution. In the Arc ecosystem, references in this list will be denormalized into author objects from the arc-author-service.\n */\nexport interface CreditTrait {\n by?: By;\n photos_by?: PhotosBy1;\n /**\n * This interface was referenced by `CreditTrait`'s JSON-Schema definition\n * via the `patternProperty` \"^[a-zA-Z0-9_]*\".\n */\n [k: string]: (AnAuthorOfAPieceOfContent | RepresentationOfANormalizedElement)[] | undefined;\n}\n/**\n * Models attribution to an individual or group for contribution towards some content item. In the Arc ecosystem, these are stored in the arc-author-service.\n */\nexport interface AnAuthorOfAPieceOfContent {\n _id?: GloballyUniqueIDTrait;\n /**\n * Indicates that this is an author\n */\n type: 'author';\n version?: DescribesTheANSVersionOfThisObject;\n name: Name;\n image?: AnImage;\n /**\n * A link to an author's landing page on the website, or a personal website.\n */\n url?: string;\n social_links?: SocialLinks;\n slug?: Slug;\n first_name?: FirstName;\n middle_name?: MiddleName;\n last_name?: LastName;\n suffix?: Suffix;\n byline?: Byline;\n location?: Location;\n division?: Division;\n email?: EMail;\n role?: Role;\n expertise?: Expertise;\n affiliation?: Affiliation;\n languages?: Languages;\n bio?: ShortBiography;\n long_bio?: LongBiography;\n books?: Books;\n education?: Education;\n awards?: Awards;\n contributor?: Contributor;\n org?: Org;\n socialLinks?: SocialLinks1;\n additional_properties?: HasAdditionalProperties;\n}\n/**\n * Holds attributes of an ANS image component. In the Arc ecosystem, these are stored in Anglerfish.\n */\nexport interface AnImage {\n type: 'image';\n _id?: GloballyUniqueIDTrait;\n version: DescribesTheANSVersionOfThisObject;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n language?: Locale;\n copyright?: CopyrightInformation;\n canonical_url?: CanonicalURL;\n short_url?: Short_Url;\n created_date?: CreatedDate;\n last_updated_date?: LastUpdatedDate;\n publish_date?: Publish_Date;\n first_publish_date?: FirstPublishDate;\n display_date?: Display_Date;\n location?: LocationRelatedTrait;\n geo?: Geo;\n address?: Address;\n editor_note?: Editor_Note;\n status?: Status;\n headlines?: Headlines;\n subheadlines?: SubHeadlines;\n description?: Description;\n credits?: CreditTrait;\n vanity_credits?: VanityCreditsTrait;\n taxonomy?: Taxonomy;\n promo_items?: PromoItems;\n related_content?: Related_Content;\n owner?: OwnerInformation;\n planning?: SchedulingInformation;\n workflow?: WorkflowInformation;\n pitches?: Pitches;\n revision?: Revision;\n syndication?: Syndication;\n source?: Source;\n distributor?: Distributor;\n tracking?: Tracking;\n comments?: Comments;\n label?: Label;\n slug?: Slug;\n content_restrictions?: ContentRestrictions;\n image_type?: ImageType;\n alt_text?: AltText;\n focal_point?: FocalPoint;\n auth?: Auth;\n seo_filename?: SEOFilename;\n additional_properties?: HasAdditionalProperties;\n /**\n * Subtitle for the image.\n */\n subtitle?: string;\n /**\n * Caption for the image.\n */\n caption?: string;\n /**\n * URL for the image.\n */\n url?: string;\n /**\n * Width for the image.\n */\n width?: number;\n /**\n * Height for the image.\n */\n height?: number;\n /**\n * True if the image can legally be licensed to others.\n */\n licensable?: boolean;\n contributors?: Contributors;\n}\n/**\n * Similar to the credits trait, but to be used only when ANS is being directly rendered to readers natively. For legal and technical reasons, the `credits` trait is preferred when converting ANS into feeds or other distribution formats. However, when present, `vanity_credits` allows more sophisticated credits presentation to override the default without losing that original data.\n */\nexport interface VanityCreditsTrait {\n by?: By1;\n photos_by?: PhotosBy;\n /**\n * This interface was referenced by `VanityCreditsTrait`'s JSON-Schema definition\n * via the `patternProperty` \"^[a-zA-Z0-9_]*\".\n */\n [k: string]: (AnAuthorOfAPieceOfContent | RepresentationOfANormalizedElement)[] | undefined;\n}\n/**\n * This represents a reference to external content that should be denormalized\n */\nexport interface RepresentationOfANormalizedElement {\n type: 'reference';\n additional_properties?: HasAdditionalProperties;\n _id?: GloballyUniqueIDTrait;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n referent: {\n /**\n * The ANS type that the provider should return.\n */\n type?: string;\n /**\n * The type of interaction the provider expects. E.g., 'oembed'\n */\n service?: string;\n /**\n * The id passed to the provider to retrieve an ANS document\n */\n id: string;\n /**\n * A URL that can resolve the id into an ANS element\n */\n provider?: string;\n /**\n * The website which the referenced id belongs to. Currently supported only for sections.\n */\n website?: string;\n /**\n * An object for key-value pairs that should override the values of keys with the same name in the denormalized object\n */\n referent_properties?: {\n [k: string]: unknown;\n };\n };\n}\n/**\n * Holds the collection of tags, categories, keywords, etc that describe content.\n */\nexport interface Taxonomy {\n /**\n * A list of keywords. In the Arc ecosystem, this list is populated by Clavis.\n */\n keywords?: Keyword[];\n /**\n * A list of named entities. In the Arc ecosystem, this list is populated by Clavis.\n */\n named_entities?: NamedEntity[];\n /**\n * A list of topics. In the Arc ecosystem, this list is populated by Clavis.\n */\n topics?: Topic[];\n /**\n * A list of auxiliaries. In the Arc ecosystem, this list is populated by Clavis.\n */\n auxiliaries?: Auxiliary[];\n tags?: Tag[];\n /**\n * A list of categories. Categories are overall, high-level classification of what the content is about.\n */\n categories?: Category[];\n /**\n * A list of topics. Topics are the subjects that the content is about.\n */\n content_topics?: ContentTopic[];\n /**\n * A list of entities. Entities are proper nouns, like people, places, and organizations.\n */\n entities?: Entity[];\n /**\n * A list of custom categories. Categories are overall, high-level classification of what the content is about.\n */\n custom_categories?: CustomCategory[];\n /**\n * A list of custom entities. Entities are proper nouns, like people, places, and organizations.\n */\n custom_entities?: CustomEntity[];\n /**\n * Deprecated in 0.10.12. (See `primary_section` instead.) A primary site object or reference to one. In the Arc ecosystem, a reference here is denormalized into a site from the arc-site-service.\n */\n primary_site?:\n | Site\n | (RepresentationOfANormalizedElement & {\n referent?: {\n type?: 'site';\n [k: string]: unknown;\n };\n [k: string]: unknown;\n });\n /**\n * A primary section object or reference to one. In the Arc ecosystem, a reference here is denormalized into a site from the arc-site-service.\n */\n primary_section?:\n | Section\n | (RepresentationOfANormalizedElement & {\n referent?: {\n type?: 'section';\n [k: string]: unknown;\n };\n [k: string]: unknown;\n });\n /**\n * Deprecated in 0.10.12. (See `sections` instead.) A list of site objects or references to them. In the Arc ecosystem, references in this list are denormalized into sites from the arc-site-service. In a multi-site context, sites will be denormalized against an organization's default website only.\n */\n sites?: (\n | Site\n | (RepresentationOfANormalizedElement & {\n referent?: {\n type?: 'site';\n [k: string]: unknown;\n };\n [k: string]: unknown;\n })\n )[];\n /**\n * A list of site objects or references to them. In the Arc ecosystem, references in this list are denormalized into sites from the arc-site-service. In a multi-site context, sites will be denormalized against an organization's default website only.\n */\n sections?: (\n | Section\n | (RepresentationOfANormalizedElement & {\n referent?: {\n type?: 'section';\n [k: string]: unknown;\n };\n [k: string]: unknown;\n })\n )[];\n /**\n * A list of user-editable manually entered keywords for search purposes. In the Arc ecosystem, these can be generated and saved in source CMS systems, editors, etc.\n */\n seo_keywords?: string[];\n /**\n * A list of stock symbols of companies related to this content. In the Arc ecosystem, these can be generated and saved in source CMS systems, editors, etc.\n */\n stock_symbols?: string[];\n /**\n * A list of WebSked task IDs that this content was created or curated to satisfy.\n *\n * @maxItems 200\n */\n associated_tasks?: string[];\n additional_properties?: HasAdditionalProperties;\n}\n/**\n * Models a keyword used in describing a piece of content.\n */\nexport interface Keyword {\n /**\n * The keyword used to describe a piece of content\n */\n keyword: string;\n /**\n * An arbitrary weighting to give the keyword\n */\n score: number;\n /**\n * The Part of Speech tag for this keyword.\n */\n tag?: string;\n /**\n * An optional count of the frequency of the keyword as it appears in the content it describes\n */\n frequency?: number;\n}\n/**\n * Models a named entity (i.e. name of a person, place, or organization) used in a piece of content.\n */\nexport interface NamedEntity {\n /**\n * A unique identifier for the concept of the named entity.\n */\n _id: string;\n /**\n * The actual string of text that was identified as a named entity.\n */\n name: string;\n /**\n * A description of what the named entity is. E.g. 'organization', 'person', or 'location'.\n */\n type: string;\n score?: number;\n}\n/**\n * Models a topic used in describing a piece of content.\n */\nexport interface Topic {\n /**\n * The unique identifier for this topic.\n */\n _id: string;\n /**\n * The general name for this topic.\n */\n name?: string;\n /**\n * An arbitrary weighting to give the topic\n */\n score: number;\n /**\n * A short identifier for this topic. Usually used in cases where a long form id cannot work.\n */\n uid: string;\n}\n/**\n * Models a auxiliary used in targeting a piece of content.\n */\nexport interface Auxiliary {\n /**\n * The unique identifier for this auxiliary.\n */\n _id: string;\n /**\n * The general name for this auxiliary.\n */\n name?: string;\n /**\n * A short identifier for this auxiliary. Usually used in cases where a long form id cannot work.\n */\n uid: string;\n}\n/**\n * Models a keyword used in describing a piece of content.\n */\nexport interface Tag {\n _id?: GloballyUniqueIDTrait;\n type?: 'tag';\n subtype?: SubtypeOrTemplate;\n /**\n * The text of the tag as displayed to users.\n */\n text: string;\n /**\n * A more detailed description of the tag.\n */\n description?: string;\n additional_properties?: HasAdditionalProperties;\n slug?: Slug;\n}\n/**\n * Models a category used in classifying a piece of content.\n */\nexport interface Category {\n /**\n * The unique ID for this category within its classifier.\n */\n _id: string;\n /**\n * The unique identifier for the classifier that matched this category.\n */\n classifier: string;\n /**\n * The human readable label for this category.\n */\n name: string;\n /**\n * The score assigned to this category between 0 and 1, where 1 is an exact match.\n */\n score?: number;\n}\n/**\n * Models a keyword used in describing a piece of content.\n */\nexport interface ContentTopic {\n /**\n * The unique Wikidata ID for this topic.\n */\n _id: string;\n /**\n * A topic this piece of content is about.\n */\n label: string;\n /**\n * The score assigned to this topic between 0 and 1, where 1 is an exact match.\n */\n score: number;\n}\n/**\n * Models a named entity (i.e. name of a person, place, or organization) used in a piece of content.\n */\nexport interface Entity {\n /**\n * The unique Wikidata ID for this entity.\n */\n _id?: string;\n /**\n * A unique identifier for a custom-defined entity.\n */\n custom_id?: string;\n /**\n * The actual string of text that was identified as a named entity.\n */\n label: string;\n /**\n * A description of what the named entity is. E.g. 'organization', 'person', or 'location'.\n */\n type?: string;\n /**\n * The score assigned to this entity between 0 and 1, where 1 is an exact match.\n */\n score?: number;\n}\n/**\n * Models a category used in classifying a piece of content.\n */\nexport interface CustomCategory {\n /**\n * The unique ID for this category within its classifier.\n */\n _id: string;\n /**\n * The unique identifier for the classifier that matched this category.\n */\n classifier: string;\n /**\n * The human readable label for this category.\n */\n name: string;\n /**\n * The score assigned to this category between 0 and 1, where 1 is an exact match.\n */\n score?: number;\n}\n/**\n * Models a named custom entity (i.e. name of a person, place, or organization) used in a piece of content.\n */\nexport interface CustomEntity {\n /**\n * The unique ID for this entity.\n */\n _id?: string;\n /**\n * A unique identifier for a custom-defined entity.\n */\n custom_id?: string;\n /**\n * The actual string of text that was identified as a named entity.\n */\n label: string;\n /**\n * A description of what the named entity is. E.g. 'organization', 'person', or 'location'.\n */\n type?: string;\n /**\n * The score assigned to this entity between 0 and 1, where 1 is an exact match.\n */\n score?: number;\n}\n/**\n * A hierarchical section or 'site' in a taxonomy. In the Arc ecosystem, these are stored in the arc-site-service.\n */\nexport interface Site {\n type: 'site';\n _id?: GloballyUniqueIDTrait;\n version: DescribesTheANSVersionOfThisObject;\n additional_properties?: HasAdditionalProperties;\n /**\n * The name of this site\n */\n name: string;\n /**\n * A short description or tagline about this site\n */\n description?: string;\n /**\n * The url path to this site\n */\n path?: string;\n /**\n * The id of this section's parent site, if any\n */\n parent_id?: string;\n /**\n * Is this the primary site?\n */\n primary?: boolean;\n}\n/**\n * A hierarchical section in a taxonomy. In the Arc ecosystem, these are stored in the arc-site-service.\n */\nexport interface Section {\n type: 'section';\n _id?: GloballyUniqueIDTrait;\n _website?: Website;\n version: DescribesTheANSVersionOfThisObject;\n additional_properties?: HasAdditionalProperties;\n /**\n * The name of this site\n */\n name: string;\n /**\n * A short description or tagline about this site\n */\n description?: string;\n /**\n * The url path to this site\n */\n path?: string;\n /**\n * The id of this section's parent section in the default hierarchy, if any.\n */\n parent_id?: string;\n /**\n * The id of this section's parent section in various commonly-used hierarchies, where available.\n */\n parent?: {\n default?: string;\n [k: string]: unknown;\n };\n /**\n * Is this the primary site?\n */\n primary?: boolean;\n}\n/**\n * Lists of promotional content to use when highlighting the story. In the Arc ecosystem, references in these lists will be denormalized.\n */\nexport interface PromoItems {\n basic?:\n | AContentObject\n | RepresentationOfANormalizedElement\n | HttpsRawGithubusercontentComWashingtonpostAnsSchemaMasterSrcMainResourcesSchemaAns01012StoryElementsRawHtmlJson\n | CustomEmbed;\n /**\n * This interface was referenced by `PromoItems`'s JSON-Schema definition\n * via the `patternProperty` \".*\".\n */\n [k: string]:\n | AContentObject\n | RepresentationOfANormalizedElement\n | HttpsRawGithubusercontentComWashingtonpostAnsSchemaMasterSrcMainResourcesSchemaAns01012StoryElementsRawHtmlJson\n | CustomEmbed\n | undefined;\n}\n/**\n * Holds common attributes of ANS Content objects.\n */\nexport interface AContentObject {\n type: string;\n _id?: GloballyUniqueIDTrait;\n version: DescribesTheANSVersionOfThisObject;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n language?: Locale;\n copyright?: CopyrightInformation;\n canonical_url?: CanonicalURL;\n short_url?: Short_Url;\n created_date?: CreatedDate;\n last_updated_date?: LastUpdatedDate;\n publish_date?: Publish_Date;\n first_publish_date?: FirstPublishDate;\n display_date?: Display_Date;\n location?: LocationRelatedTrait;\n geo?: Geo;\n address?: Address;\n editor_note?: Editor_Note;\n status?: Status;\n headlines?: Headlines;\n subheadlines?: SubHeadlines;\n description?: Description;\n credits?: CreditTrait;\n vanity_credits?: VanityCreditsTrait;\n taxonomy?: Taxonomy;\n promo_items?: PromoItems;\n related_content?: Related_Content;\n owner?: OwnerInformation;\n planning?: SchedulingInformation;\n workflow?: WorkflowInformation;\n pitches?: Pitches;\n revision?: Revision;\n syndication?: Syndication;\n source?: Source;\n distributor?: Distributor;\n tracking?: Tracking;\n comments?: Comments;\n label?: Label;\n slug?: Slug;\n content_restrictions?: ContentRestrictions;\n additional_properties?: HasAdditionalProperties;\n content_aliases?: AliasesTrait;\n contributors?: Contributors;\n [k: string]: unknown;\n}\n/**\n * Lists of content items or references this story is related to, arbitrarily keyed. In the Arc ecosystem, references in this object will be denormalized into the fully-inflated content objects they represent.\n */\nexport interface Related_Content {\n /**\n * An attached redirect. In Arc, when this content item is fetched by url, content api will instead return this redirect object with appropriate headers. In all other cases, this content should be treated normally.\n *\n * @maxItems 1\n */\n redirect?: [] | [ARedirectObject];\n /**\n * This interface was referenced by `Related_Content`'s JSON-Schema definition\n * via the `patternProperty` \".*\".\n */\n [k: string]: [ARedirectObject] | (AContentObject | RepresentationOfANormalizedElement | CustomEmbed)[] | undefined;\n}\n/**\n * A redirect to another story.\n */\nexport interface ARedirectObject {\n type: 'redirect';\n _id?: GloballyUniqueIDTrait;\n version: DescribesTheANSVersionOfThisObject;\n owner?: OwnerInformation;\n revision?: Revision;\n canonical_url: CanonicalURL;\n redirect_url: CanonicalURL;\n}\n/**\n * Various unrelated fields that should be preserved for backwards-compatibility reasons. See also trait_source.\n */\nexport interface OwnerInformation {\n /**\n * The machine-readable unique identifier of the organization whose database this content is stored in. In Arc, this is equivalent to ARC_ORG_NAME.\n */\n id?: string;\n /**\n * Deprecated in 0.10.12. See `distributor.name`. (Formerly: The human-readable name of original producer of content. Distinguishes between Wires, Staff and other sources.)\n */\n name?: string;\n /**\n * True if this content is advertorial or native advertising.\n */\n sponsored?: boolean;\n [k: string]: unknown;\n}\n/**\n * Trait that applies revision information to a document. In the Arc ecosystem, many of these fields are populated in stories by the Story API.\n */\nexport interface Revision {\n /**\n * The unique id of this revision.\n */\n revision_id?: string;\n /**\n * The unique id of the revision that this revisions was branched from, or preceded it on the current branch.\n */\n parent_id?: string;\n /**\n * The name of the branch this revision was created on.\n */\n branch?: string;\n /**\n * A list of identifiers of editions that point to this revision.\n */\n editions?: string[];\n /**\n * The unique user id of the person who created this revision.\n */\n user_id?: string;\n /**\n * Whether or not this revision's parent story is published, in any form or place\n */\n published?: boolean;\n additional_properties?: HasAdditionalProperties;\n}\n/**\n * A custom embed element. Can be used to reference content from external providers about which little is known.\n */\nexport interface CustomEmbed {\n type: 'custom_embed';\n _id?: GloballyUniqueIDTrait;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n additional_properties?: HasAdditionalProperties;\n embed: Embed;\n}\n/**\n * The embed data.\n */\nexport interface Embed {\n id: EmbedID;\n url: EmbedProviderURL;\n config?: EmbedConfiguration;\n}\n/**\n * Arbitrary configuration data generated by a plugin. Users are responsible for maintaining schema.\n */\nexport interface EmbedConfiguration {\n referent?: {\n [k: string]: unknown;\n };\n type?: {\n [k: string]: unknown;\n };\n version?: {\n [k: string]: unknown;\n };\n /**\n * This interface was referenced by `EmbedConfiguration`'s JSON-Schema definition\n * via the `patternProperty` \"^([a-zA-Z0-9_])*$\".\n */\n [k: string]: unknown;\n}\n/**\n * Trait that applies planning information to a document or resource. In the Arc ecosystem, this data is generated by WebSked. Newsroom use only. All these fields should be available and editable in WebSked.\n */\nexport interface SchedulingInformation {\n additional_properties?: HasAdditionalProperties;\n /**\n * Date to be used for chronological sorting in WebSked.\n */\n websked_sort_date?: string;\n /**\n * The delta between the story's planned publish date and actual first publish time, in minutes.\n */\n deadline_miss?: number;\n internal_note?: InternalNote;\n budget_line?: BudgetLine;\n /**\n * Scheduling information.\n */\n scheduling?: {\n /**\n * When the content is planned to be published.\n */\n planned_publish_date?: string;\n /**\n * When the content was first published.\n */\n scheduled_publish_date?: string;\n /**\n * Will this content have galleries?\n */\n will_have_gallery?: boolean;\n /**\n * Will this content have graphics?\n */\n will_have_graphic?: boolean;\n /**\n * Will this content have images?\n */\n will_have_image?: boolean;\n /**\n * Will this content have videos?\n */\n will_have_video?: boolean;\n };\n /**\n * Story length information.\n */\n story_length?: {\n /**\n * The anticipated number of words in the story.\n */\n word_count_planned?: number;\n /**\n * Current number of words.\n */\n word_count_actual?: number;\n /**\n * The anticipated length of the story in inches.\n */\n inch_count_planned?: number;\n /**\n * The current length of the story in inches.\n */\n inch_count_actual?: number;\n /**\n * The anticipated length of the story in lines.\n */\n line_count_planned?: number;\n /**\n * The current length of the story in lines.\n */\n line_count_actual?: number;\n /**\n * The anticipated number of characters in the story.\n */\n character_count_planned?: number;\n /**\n * The current number of characters in the story.\n */\n character_count_actual?: number;\n /**\n * The encoding used for counting characters in the story.\n */\n character_encoding?: string;\n };\n}\n/**\n * Trait that applies workflow information to a document or resource. In the Arc ecosystem, this data is generated by WebSked.\n */\nexport interface WorkflowInformation {\n additional_properties?: HasAdditionalProperties;\n /**\n * Code indicating the story's current workflow status. This number should match the values configured in WebSked.\n */\n status_code?: number;\n /**\n * This note will be used for any task automatically generated via WebSked task triggers.\n */\n note?: string;\n}\n/**\n * Trait that represents a story's pitches. In the Arc ecosystem, this data is generated by WebSked.\n */\nexport interface Pitches {\n additional_properties?: HasAdditionalProperties;\n /**\n * A list of the story's pitches to a platform.\n */\n platform?: PlatformPitch[];\n /**\n * A list of the story's pitches to a publication.\n */\n publication?: PublicationPitch[];\n}\n/**\n * Trait that represents a pitch to a platform. In the Arc ecosystem, this data is generated by WebSked.\n */\nexport interface PlatformPitch {\n additional_properties?: HasAdditionalProperties;\n /**\n * The path of the platform that this pitch targets.\n */\n platform_path?: string;\n creation_event?: PlatformPitchEvent;\n latest_event?: PlatformPitchEvent;\n}\n/**\n * Trait that represents an update event for a pitch to a platform. In the Arc ecosystem, this data is generated by WebSked.\n */\nexport interface PlatformPitchEvent {\n additional_properties?: HasAdditionalProperties;\n /**\n * The current status of the pitch.\n */\n status?: string;\n /**\n * The time of this update.\n */\n time?: string;\n /**\n * The ID of the user who made this update.\n */\n user_id?: string;\n /**\n * Optional note associated with this update.\n */\n note?: string;\n}\n/**\n * Trait that represents a pitch to a publication. In the Arc ecosystem, this data is generated by WebSked.\n */\nexport interface PublicationPitch {\n additional_properties?: HasAdditionalProperties;\n /**\n * The ID of the publication that this pitch targets.\n */\n publication_id?: string;\n creation_event?: PublicationPitchEvent;\n latest_event?: PublicationPitchEvent;\n}\n/**\n * Trait that represents an update event for a pitch to a publication. In the Arc ecosystem, this data is generated by WebSked.\n */\nexport interface PublicationPitchEvent {\n additional_properties?: HasAdditionalProperties;\n /**\n * The current status of the pitch.\n */\n status?: string;\n /**\n * The time of this update.\n */\n time?: string;\n /**\n * The ID of the user who made this update.\n */\n user_id?: string;\n /**\n * Optional note associated with this update.\n */\n note?: string;\n /**\n * The ID of the publication edition that this pitch targets.\n */\n edition_id?: string;\n /**\n * The time of the publication edition that this pitch targets.\n */\n edition_time?: string;\n}\n/**\n * Key-boolean pair of syndication services where this article may go\n */\nexport interface Syndication {\n /**\n * Necessary for fulfilling contractual agreements with third party clients\n */\n external_distribution?: boolean;\n /**\n * Necessary so that we can filter out all articles that editorial has deemed should not be discoverable via search\n */\n search?: boolean;\n /**\n * This interface was referenced by `Syndication`'s JSON-Schema definition\n * via the `patternProperty` \".*\".\n */\n [k: string]: boolean | undefined;\n}\n/**\n * Information about the original source and/or owner of this content\n */\nexport interface Source {\n /**\n * The id of this content in a foreign CMS.\n */\n source_id?: string;\n /**\n * Deprecated in 0.10.12. See `distributor.category` and `distributor.subcategory`. (Formerly: The method used to enter this content. E.g. 'staff', 'wires'.)\n */\n source_type?: string;\n /**\n * Deprecated in 0.10.12. See `distributor.name`. (Formerly: The human-readable name of the organization who first produced this content. E.g., 'Reuters'.)\n */\n name?: string;\n /**\n * The software (CMS or editor) that was used to enter this content. E.g., 'wordpress', 'ellipsis'.\n */\n system?: string;\n /**\n * A link to edit this content in its source CMS.\n */\n edit_url?: string;\n additional_properties?: HasAdditionalProperties;\n}\n/**\n * Tracking information, probably implementation-dependent\n */\nexport interface Tracking {\n [k: string]: unknown;\n}\n/**\n * Comment configuration data\n */\nexport interface Comments {\n /**\n * How long (in days) after publish date until comments are closed.\n */\n comments_period?: number;\n /**\n * If false, commenting is disabled on this content.\n */\n allow_comments?: boolean;\n /**\n * If false, do not render comments on this content.\n */\n display_comments?: boolean;\n /**\n * If true, comments must be moderator-approved before being displayed.\n */\n moderation_required?: boolean;\n additional_properties?: HasAdditionalProperties;\n [k: string]: unknown;\n}\n/**\n * What the Washington Post calls a Kicker\n */\nexport interface Label {\n /**\n * The default label object for this piece of content.\n */\n basic?: {\n /**\n * The text of this label.\n */\n text: string;\n /**\n * An optional destination url of this label.\n */\n url?: string;\n /**\n * If false, this label should be hidden.\n */\n display?: boolean;\n additional_properties?: HasAdditionalProperties;\n };\n /**\n * Additional user-defined keyed label objects.\n *\n * This interface was referenced by `Label`'s JSON-Schema definition\n * via the `patternProperty` \"^[a-zA-Z0-9_]*$\".\n */\n [k: string]:\n | {\n /**\n * The text of this label.\n */\n text: string;\n /**\n * An optional destination url of this label.\n */\n url?: string;\n /**\n * If false, this label should be hidden.\n */\n display?: boolean;\n additional_properties?: HasAdditionalProperties;\n }\n | undefined;\n}\n/**\n * Trait that applies contains the content restrictions of an ANS object.\n */\nexport interface ContentRestrictions {\n /**\n * The content restriction code/level/flag associated with the ANS object\n */\n content_code?: string;\n /**\n * Embargo configuration to enforce publishing restrictions. Embargoed content must not go live.\n */\n embargo?: {\n /**\n * The boolean flag to indicate if the embargo is active or not. If this field is false, ignore the embargo.\n */\n active: boolean;\n /**\n * An optional end time for the embargo to indicate when it ends. When it's not defined, it means the embargo keeps applying. The end time should be ignored if active flag is false.\n */\n end_time?: string;\n /**\n * An optional description for the embargo.\n */\n description?: string;\n };\n /**\n * Geo-Restriction configuration that contains the restriction ids that this content should be associated with.\n */\n geo?: {\n /**\n * An array containing the geo-restriction objects. Limited to a size of 1 for now.\n *\n * @minItems 1\n * @maxItems 1\n */\n restrictions: [\n {\n /**\n * The _id of the restriction that is stored in Global Settings.\n */\n restriction_id: string;\n },\n ];\n };\n [k: string]: unknown;\n}\n/**\n * Trait that holds information on who created and contributed to a given document in Arc.\n */\nexport interface Contributors {\n /**\n * The Creator of the Document.\n */\n created_by?: {\n /**\n * The unique ID of the Arc user who created the Document\n */\n user_id?: string;\n /**\n * The display name of the Arc user who created the Document\n */\n display_name?: string;\n [k: string]: unknown;\n };\n}\n/**\n * An html content element\n */\nexport interface HttpsRawGithubusercontentComWashingtonpostAnsSchemaMasterSrcMainResourcesSchemaAns01012StoryElementsRawHtmlJson {\n type: 'raw_html';\n _id?: GloballyUniqueIDTrait;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n additional_properties?: HasAdditionalProperties;\n /**\n * Any arbitrary chunk of HTML.\n */\n content: string;\n}\n/**\n * Coordinates representing the 'visual center' of an image. The X axis is horizontal line and the Y axis the vertical line, with 0,0 being the LEFT, TOP of the image.\n */\nexport interface FocalPoint {\n /**\n * The coordinate point on the horizontal axis\n */\n x: number;\n /**\n * The coordinate point on the vertical axis\n */\n y: number;\n [k: string]: unknown;\n}\n/**\n * Mapping of integers to tokens, where the integer represents the Signing Service's secret version, and token represents an object's public key for usage on the frontend.\n */\nexport interface Auth {\n /**\n * This interface was referenced by `Auth`'s JSON-Schema definition\n * via the `patternProperty` \"^\\d+$\".\n */\n [k: string]: string;\n}\nexport interface Book {\n book_title?: Title;\n book_url?: URL;\n}\nexport interface School {\n school_name?: SchoolName;\n}\n/**\n * An item that conforms to this schema can be rendered in a sequence\n */\nexport interface AnElementThatCanBeListedAsPartOfContentElements {\n type: string;\n _id?: GloballyUniqueIDTrait;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n additional_properties?: HasAdditionalProperties;\n gallery_properties?: HasGalleryProperties;\n [k: string]: unknown;\n}\n/**\n * An object for overrides for images when images are used in a gallery. Example usage: Each image in a gallery may have the images own focal point overridden by the gallery.\n */\nexport interface HasGalleryProperties {\n [k: string]: unknown;\n}\n/**\n * Website-specific metadata for url generation for multi-site copies. These fields are not indexed in Content API.\n */\nexport interface WebsitesInput {\n /**\n * This interface was referenced by `WebsitesInput`'s JSON-Schema definition\n * via the `patternProperty` \"^[a-zA-Z0-9_]*\".\n */\n [k: string]: {\n website_section?: RepresentationOfANormalizedElement | Section;\n website_url?: WebsiteURL;\n };\n}\n/**\n * Holds attributes of an ANS story. In the Arc ecosystem, these are stored in the Story API.\n */\nexport interface AStory {\n type: 'story';\n _id?: GloballyUniqueIDTrait;\n version: DescribesTheANSVersionOfThisObject;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n language?: Locale;\n copyright?: CopyrightInformation;\n canonical_url?: CanonicalURL;\n canonical_url_external?: CanonicalExternalURL;\n canonical_website?: CanonicalWebsite;\n website?: Website;\n website_url?: WebsiteURL;\n short_url?: Short_Url;\n created_date?: CreatedDate;\n last_updated_date?: LastUpdatedDate;\n publish_date?: Publish_Date;\n first_publish_date?: FirstPublishDate;\n display_date?: Display_Date;\n location?: LocationRelatedTrait;\n geo?: Geo;\n address?: Address;\n editor_note?: Editor_Note;\n status?: Status;\n headlines?: Headlines;\n subheadlines?: SubHeadlines;\n description?: Description;\n credits?: CreditTrait;\n vanity_credits?: VanityCreditsTrait;\n taxonomy?: Taxonomy;\n promo_items?: PromoItems;\n related_content?: Related_Content;\n owner?: OwnerInformation;\n planning?: SchedulingInformation;\n workflow?: WorkflowInformation;\n pitches?: Pitches;\n revision?: Revision;\n syndication?: Syndication;\n source?: Source;\n distributor?: Distributor;\n tracking?: Tracking;\n comments?: Comments;\n label?: Label;\n slug?: Slug;\n content_restrictions?: ContentRestrictions;\n rendering_guides?: RenderingGuides;\n additional_properties?: HasAdditionalProperties;\n content_aliases?: AliasesTrait;\n corrections?: Corrections;\n content_elements?: ACollectionOfContent;\n publishing?: PublishingInformation;\n variations?: VariantContentMetadata;\n voice_transcripts?: VoiceTranscriptSConfigurationAndOutput;\n websites?: WebsitesInput;\n contributors?: Contributors;\n}\n/**\n * Trait that provides suggestions for the rendering system.\n */\nexport interface RenderingGuides {\n /**\n * The preferred rendering method of the story. Blank means there is no preference. If the rendering application is aware of these other options, it can decide to either use one of them, render messaging to the viewer, or render the story as normal\n */\n preferred_method?: (('website' | 'native') | string)[];\n [k: string]: unknown;\n}\n/**\n * Describes a change that has been made to the document for transparency, or describes inaccuracies or falsehoods that remain in the document.\n */\nexport interface Correction {\n type: 'correction';\n _id?: GloballyUniqueIDTrait;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n additional_properties?: HasAdditionalProperties;\n /**\n * Type of correction. E.g., clarification, retraction.\n */\n correction_type?: string;\n /**\n * The text of the correction.\n */\n text: string;\n}\n/**\n * The current published state of all editions of a content item as well as any scheduled publishing information. Machine-generated.\n */\nexport interface PublishingInformation {\n has_published_edition: HasPublishedEdition;\n /**\n * A map of edition names to the current publish state for that edition\n */\n editions?: {\n default: Edition;\n [k: string]: Edition;\n };\n scheduled_operations?: ScheduledOperations;\n additional_properties?: HasAdditionalProperties;\n}\n/**\n * This interface was referenced by `undefined`'s JSON-Schema definition\n * via the `patternProperty` \"^[a-zA-Z0-9_]*$\".\n */\nexport interface Edition {\n edition_name: EditionName;\n edition_date: EditionDate;\n edition_first_publish_date?: FirstPublishedDateEdition;\n edition_display_date?: DisplayDateEdition;\n edition_publish_date?: PublishDateEdition;\n edition_published: PublishStatus;\n edition_revision_id?: RevisionID;\n additional_properties?: HasAdditionalProperties;\n}\n/**\n * A map of lists of operations scheduled to be performed on this content item, sorted by operation type.\n */\nexport interface ScheduledOperations {\n publish_edition?: {\n operation?: 'publish_edition';\n operation_revision_id?: RevisionIDOperation;\n operation_edition?: EditionNameOperation;\n operation_date?: OperationDate;\n additional_properties?: HasAdditionalProperties;\n }[];\n unpublish_edition?: {\n operation?: 'unpublish_edition';\n operation_edition?: EditionNameOperation1;\n operation_date?: OperationDate1;\n additional_properties?: HasAdditionalProperties;\n }[];\n}\n/**\n * Holds variant content metadata, including content zone IDs for use within 'content_elements' and mapping from website IDs to variant IDs\n */\nexport interface VariantContentMetadata {\n additional_properties?: HasAdditionalProperties;\n /**\n * A list of content zone IDs for use within the 'content_elements' array of the hub story\n *\n * @maxItems 10\n */\n content_zone_ids?:\n | []\n | [string]\n | [string, string]\n | [string, string, string]\n | [string, string, string, string]\n | [string, string, string, string, string]\n | [string, string, string, string, string, string]\n | [string, string, string, string, string, string, string]\n | [string, string, string, string, string, string, string, string]\n | [string, string, string, string, string, string, string, string, string]\n | [string, string, string, string, string, string, string, string, string, string];\n variants?: VariantMetadata[];\n}\n/**\n * Variant metadata describing its ID as well as the websites to which it is assigned\n */\nexport interface VariantMetadata {\n _id?: GloballyUniqueIDTrait1;\n additional_properties?: HasAdditionalProperties;\n content?: AStory1;\n created_date?: CreatedDate;\n last_updated_date?: LastUpdatedDate;\n /**\n * User-facing name for the variant\n */\n name?: string;\n publish_date?: Publish_Date;\n /**\n * Published status for the variant\n */\n published?: boolean;\n type: 'variant';\n /**\n * websites assigned to this variant; individual values must be mutually exclusive with other variants\n *\n * @maxItems 50\n */\n websites?: string[];\n}\n/**\n * Variant content. Only 'story' data is supported, but this may expand in the future.\n */\nexport interface AStory1 {\n type: 'story';\n _id?: GloballyUniqueIDTrait;\n version: DescribesTheANSVersionOfThisObject;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n language?: Locale;\n copyright?: CopyrightInformation;\n canonical_url?: CanonicalURL;\n canonical_url_external?: CanonicalExternalURL;\n canonical_website?: CanonicalWebsite;\n website?: Website;\n website_url?: WebsiteURL;\n short_url?: Short_Url;\n created_date?: CreatedDate;\n last_updated_date?: LastUpdatedDate;\n publish_date?: Publish_Date;\n first_publish_date?: FirstPublishDate;\n display_date?: Display_Date;\n location?: LocationRelatedTrait;\n geo?: Geo;\n address?: Address;\n editor_note?: Editor_Note;\n status?: Status;\n headlines?: Headlines;\n subheadlines?: SubHeadlines;\n description?: Description;\n credits?: CreditTrait;\n vanity_credits?: VanityCreditsTrait;\n taxonomy?: Taxonomy;\n promo_items?: PromoItems;\n related_content?: Related_Content;\n owner?: OwnerInformation;\n planning?: SchedulingInformation;\n workflow?: WorkflowInformation;\n pitches?: Pitches;\n revision?: Revision;\n syndication?: Syndication;\n source?: Source;\n distributor?: Distributor;\n tracking?: Tracking;\n comments?: Comments;\n label?: Label;\n slug?: Slug;\n content_restrictions?: ContentRestrictions;\n rendering_guides?: RenderingGuides;\n additional_properties?: HasAdditionalProperties;\n content_aliases?: AliasesTrait;\n corrections?: Corrections;\n content_elements?: ACollectionOfContent;\n publishing?: PublishingInformation;\n variations?: VariantContentMetadata;\n voice_transcripts?: VoiceTranscriptSConfigurationAndOutput;\n websites?: WebsitesInput;\n contributors?: Contributors;\n}\n/**\n * The transcription settings as requested by an end-user or API caller. These values should be displayed to editorial users in Arc apps.\n */\nexport interface OptionsRequested {\n enabled: Enabled;\n voice?: VoiceID;\n [k: string]: unknown;\n}\n/**\n * The transcription settings that were used by the renderer to generate the final output. (If these differ from 'options' it may indicate an inability to render exactly as specified.) These values can be used when rendering to readers or external users.\n */\nexport interface OptionsUsed {\n enabled: Enabled1;\n voice?: VoiceID1;\n [k: string]: unknown;\n}\n/**\n * Configuration for a piece of audio content, over a stream.\n */\nexport interface AStreamOfAudio {\n filesize?: FileSize;\n audio_codec?: AudioCodec;\n stream_type?: AudioStreamType;\n url: URL1;\n bitrate?: Bitrate;\n [k: string]: unknown;\n}\n/**\n * Holds attributes of an ANS video component. In the Arc ecosystem, these are stored in Goldfish.\n */\nexport interface VideoContent {\n type: 'video';\n _id?: GloballyUniqueIDTrait;\n version: DescribesTheANSVersionOfThisObject;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n language?: Locale;\n copyright?: CopyrightInformation;\n canonical_url?: CanonicalURL;\n canonical_website?: CanonicalWebsite;\n website?: Website;\n website_url?: WebsiteURL;\n short_url?: Short_Url;\n created_date?: CreatedDate;\n last_updated_date?: LastUpdatedDate;\n publish_date?: Publish_Date;\n first_publish_date?: FirstPublishDate;\n display_date?: Display_Date;\n location?: LocationRelatedTrait;\n geo?: Geo;\n address?: Address;\n editor_note?: Editor_Note;\n status?: Status;\n headlines?: Headlines;\n subheadlines?: SubHeadlines;\n description?: Description;\n credits?: CreditTrait;\n vanity_credits?: VanityCreditsTrait;\n taxonomy?: Taxonomy;\n promo_items?: PromoItems;\n related_content?: Related_Content;\n owner?: OwnerInformation;\n planning?: SchedulingInformation;\n workflow?: WorkflowInformation;\n pitches?: Pitches;\n revision?: Revision;\n syndication?: Syndication;\n source?: Source;\n distributor?: Distributor;\n tracking?: Tracking;\n comments?: Comments;\n label?: Label;\n slug?: Slug;\n content_restrictions?: ContentRestrictions;\n additional_properties?: HasAdditionalProperties;\n content_aliases?: AliasesTrait;\n /**\n * Runtime of the video in milliseconds.\n */\n duration?: number;\n /**\n * A transcript of the contents of the video.\n */\n transcript?: string;\n /**\n * A rating of the video, to be used for appropriate age/content warnings.\n */\n rating?: string;\n /**\n * The type of video (e.g. clip, livestream, etc)\n */\n video_type?: string;\n /**\n * The YouTube ID of the content, if (re)hosted on youtube.com\n */\n youtube_content_id?: string;\n /**\n * The different streams this video can play in.\n */\n streams?: AStreamOfVideo[];\n subtitles?: VideoSubtitleConfigurationSchema;\n promo_image?: AnImage1;\n /**\n * An HTML snippet used to embed this video in another document. Used for oembed responses.\n */\n embed_html?: string;\n corrections?: Corrections;\n websites?: WebsitesInput;\n contributors?: Contributors;\n}\n/**\n * Configuration for a piece of video content, over a stream.\n */\nexport interface AStreamOfVideo {\n /**\n * The height of the video.\n */\n height?: number;\n /**\n * The width of the video.\n */\n width?: number;\n /**\n * The size of the video, in bytes.\n */\n filesize?: number;\n /**\n * The audio codec.\n */\n audio_codec?: string;\n /**\n * The video codec.\n */\n video_codec?: string;\n /**\n * The type of video (e.g. mp4).\n */\n stream_type?: string;\n /**\n * Where to get the stream from.\n */\n url?: string;\n /**\n * The bitrate of the video\n */\n bitrate?: number;\n /**\n * The provider of the video.\n */\n provider?: string;\n [k: string]: unknown;\n}\n/**\n * Data about different subtitle encodings and confidences of auto-transcribed content.\n */\nexport interface VideoSubtitleConfigurationSchema {\n /**\n * How confident the transcriber (human or automated) is of the accuracy of the subtitles.\n */\n confidence?: number;\n /**\n * The locations of any subtitle transcriptions of the video.\n */\n urls?: SubtitleUrl[];\n [k: string]: unknown;\n}\nexport interface SubtitleUrl {\n /**\n * The format of the subtitles (e.g. SRT, DFXP, WEB_VTT, etc)\n */\n format?: string;\n /**\n * The url of the subtitle stream.\n */\n url?: string;\n [k: string]: unknown;\n}\n/**\n * Holds attributes of an ANS image component. In the Arc ecosystem, these are stored in Anglerfish.\n */\nexport interface AnImage1 {\n type: 'image';\n _id?: GloballyUniqueIDTrait;\n version: DescribesTheANSVersionOfThisObject;\n subtype?: SubtypeOrTemplate;\n channels?: ChannelTrait;\n alignment?: Alignment;\n language?: Locale;\n copyright?: CopyrightInformation;\n canonical_url?: CanonicalURL;\n short_url?: Short_Url;\n created_date?: CreatedDate;\n last_updated_date?: LastUpdatedDate;\n publish_date?: Publish_Date;\n first_publish_date?: FirstPublishDate;\n display_date?: Display_Date;\n location?: LocationRelatedTrait;\n geo?: Geo;\n address?: Address;\n editor_note?: Editor_Note;\n status?: Status;\n headlines?: Headlines;\n subheadlines?: SubHeadlines;\n description?: Description;\n credits?: CreditTrait;\n vanity_credits?: VanityCreditsTrait;\n taxonomy?: Taxonomy;\n promo_items?: PromoItems;\n related_content?: Related_Content;\n owner?: OwnerInformation;\n planning?: SchedulingInformation;\n workflow?: WorkflowInformation;\n pitches?: Pitches;\n revision?: Revision;\n syndication?: Syndication;\n source?: Source;\n distributor?: Distributor;\n tracking?: Tracking;\n comments?: Comments;\n label?: Label;\n slug?: Slug;\n content_restrictions?: ContentRestrictions;\n image_type?: ImageType;\n alt_text?: AltText;\n focal_point?: FocalPoint;\n auth?: Auth;\n seo_filename?: SEOFilename;\n additional_properties?: HasAdditionalProperties;\n /**\n * Subtitle for the image.\n */\n subtitle?: string;\n /**\n * Caption for the image.\n */\n caption?: string;\n /**\n * URL for the image.\n */\n url?: string;\n /**\n * Width for the image.\n */\n width?: number;\n /**\n * Height for the image.\n */\n height?: number;\n /**\n * True if the image can legally be licensed to others.\n */\n licensable?: boolean;\n contributors?: Contributors;\n}\n","import type { ANS, SectionReference } from '../../types/index.js';\nimport type { AuthorANS } from '../author/types.js';\n\ntype TagANS = ANS.Tag & { name: string };\n\nexport type CirculationReference = {\n document_id: string;\n website_id: string;\n website_url?: string;\n primary_section?: SectionReference;\n website_primary_section?: SectionReference;\n website_sections: SectionReference[];\n};\n\nexport type Operation = {\n type: string;\n story_id: string;\n operation: string;\n date: string;\n organization_id: string;\n endpoint: string;\n};\n\nexport type ANSContent = ANS.AStory | ANS.AGallery | ANS.AnImage | AuthorANS | TagANS | ANS.VideoContent;\n\nexport type PostANSPayload<ANS extends ANSContent = ANSContent> = {\n sourceId: string;\n sourceType: string;\n ANS: ANS;\n references?: unknown[];\n circulations?: CirculationReference[];\n operations?: Operation[];\n arcAdditionalProperties?: {\n importPriority?: string;\n story?: {\n publish: boolean;\n };\n video?: {\n transcoding: true;\n useLastUpdated: true;\n importPriority: string;\n thumbnailTimeInSeconds: 0;\n };\n };\n};\n\nexport type PostANSParams = {\n website: string;\n groupId: string;\n priority: 'historical' | 'live';\n};\n\nexport type GetANSParams = {\n ansId: string;\n ansType: ANSType;\n};\n\nexport enum ANSType {\n Story = 'story',\n Video = 'video',\n Tag = 'tag',\n Author = 'author',\n Gallery = 'gallery',\n Image = 'image',\n Redirect = 'redirect',\n}\n\nexport enum MigrationStatus {\n Success = 'Success',\n Queued = 'Queued',\n Circulated = 'Circulated',\n Published = 'Published',\n Scheduled = 'Scheduled',\n FailVideo = 'FailVideo',\n FailImage = 'FailImage',\n FailPhoto = 'FailPhoto',\n FailStory = 'FailStory',\n FailGallery = 'FailGallery',\n FailAuthor = 'FailAuthor',\n FailTag = 'FailTag',\n ValidationFailed = 'ValidationFailed',\n}\n\nexport type Summary = SummaryRecord[];\n\nexport type SummaryRecord = {\n id: number;\n sourceId: string;\n sourceType: string;\n sourceLocation: string;\n sourceAdditionalProperties: string;\n ansId: string;\n ansType: ANSType;\n ansLocation: string;\n status: MigrationStatus;\n website: string;\n operations: string;\n circulationLocation: string;\n createDate: string;\n updateDate: string;\n errorMessage?: string;\n priority: string;\n arcAdditionalProperties: string;\n groupId: string;\n tags?: null;\n};\n\nexport type DetailReport = SummaryRecord & { ansContent: ANSContent };\n\nexport type Count = {\n historical: {\n total: number;\n ansTypes: Partial<Record<ANSType, ANSTypeCount>>;\n };\n};\n\ntype ANSTypeCount = Partial<Record<MigrationStatus, number>>;\n\nexport type DetailReportParams = {\n sourceId?: string;\n sourceType?: string;\n ansId?: string;\n ansType?: ANSType;\n version?: string;\n documentType?: string;\n};\n\nexport type CountParams = {\n startDate?: Date;\n endDate?: Date;\n};\n\nexport type SummaryReportParams = {\n status?: MigrationStatus;\n website: string;\n groupId?: string;\n fetchFromId?: string;\n sort?: SummarySortBy;\n sortOrder?: SummarySortOrder;\n};\n\nexport enum SummarySortBy {\n CreateDate = 'createDate',\n UpdateDate = 'updateDate',\n Id = 'id',\n}\n\nexport enum SummarySortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\nexport type GetRemainingTimeParams = {\n priority: 'historical' | 'live';\n ansType: ANSType;\n timeUnit: 'hour' | 'day' | 'minute';\n};\n\nexport type GetRemainingTimeResponse = {\n estTimeRemaining: {\n value: number;\n unit: string;\n };\n estCompletionDate: string;\n estCount: number;\n reportDate: string;\n};\n\nexport type GetRecentGroupIdsResponse = {\n groupIds: string[];\n};\n","import type { ANS } from '../../types';\n\nexport const reference = (\n ref: ANS.RepresentationOfANormalizedElement['referent']\n): ANS.RepresentationOfANormalizedElement => {\n return {\n _id: ref.id,\n type: 'reference' as const,\n referent: {\n ...ref,\n },\n };\n};\n","import type { ANS } from '../types/index.js';\nimport type { CElement } from './types.js';\n\nexport const ContentElement = {\n divider: () => {\n return {\n type: 'divider' as const,\n };\n },\n text: (content: string, alignment: ANS.Alignment | null = 'left') => {\n return {\n type: 'text' as const,\n content,\n alignment: alignment || undefined,\n };\n },\n quote: (items: CElement[], citation = '', subtype: 'blockquote' | 'pullquote' = 'pullquote') => {\n return {\n type: 'quote' as const,\n subtype,\n citation: {\n type: 'text' as const,\n content: citation,\n },\n content_elements: items,\n };\n },\n interstitial_link: (url: string, content: string) => {\n return {\n type: 'interstitial_link' as const,\n url,\n content,\n };\n },\n header: (content: string, level: number) => {\n return {\n type: 'header' as const,\n content,\n level,\n };\n },\n raw_html: (content: string) => {\n return {\n type: 'raw_html' as const,\n content,\n };\n },\n gallery: (id: string) => {\n return {\n type: 'reference' as const,\n referent: {\n type: 'gallery' as const,\n id,\n },\n };\n },\n list: (type: 'ordered' | 'unordered', items: CElement[]) => {\n return {\n type: 'list' as const,\n list_type: type,\n items,\n };\n },\n link_list: (title: string, links: { content: string; url: string }[]) => {\n return {\n type: 'link_list' as const,\n title,\n items: links.map(({ content, url }) => {\n return {\n type: 'interstitial_link' as const,\n content,\n url,\n };\n }),\n };\n },\n image: (id: string, properties?: ANS.AnImage) => {\n return {\n referent: {\n id,\n type: 'image' as const,\n referent_properties: {\n _id: id,\n type: 'image' as const,\n ...properties,\n },\n },\n type: 'reference' as const,\n };\n },\n jwPlayer: (id: string) => {\n return {\n embed: {\n config: {},\n id,\n url: 'https://cdn.jwplayer.com/players',\n },\n subtype: 'jw_player' as const,\n type: 'custom_embed' as const,\n };\n },\n twitter: (id: string, provider = 'https://publish.twitter.com/oembed?url=') => {\n return {\n referent: {\n id,\n provider,\n service: 'oembed' as const,\n type: 'twitter' as const,\n },\n type: 'reference' as const,\n };\n },\n youtube: (id: string, provider = 'https://www.youtube.com/oembed?url=') => {\n return {\n referent: {\n id,\n provider,\n service: 'oembed',\n type: 'youtube',\n },\n type: 'reference' as const,\n };\n },\n facebook_video: (id: string, provider = 'https://www.facebook.com/plugins/post/oembed.json/?url=') => {\n return {\n referent: {\n id,\n provider,\n service: 'oembed',\n type: 'facebook-video',\n },\n type: 'reference' as const,\n };\n },\n facebook_post: (id: string, provider = 'https://www.facebook.com/plugins/post/oembed.json/?url=') => {\n return {\n referent: {\n id,\n provider,\n service: 'oembed',\n type: 'facebook-post',\n },\n type: 'reference' as const,\n };\n },\n soundcloud: (id: string, provider = 'https://soundcloud.com/oembed.json/?url=') => {\n return {\n referent: {\n id,\n provider,\n service: 'oembed',\n type: 'soundcloud',\n },\n type: 'reference' as const,\n };\n },\n vimeo: (id: string, provider = 'https://vimeo.com/api/oembed.json?url=') => {\n return {\n referent: {\n id,\n provider,\n service: 'oembed',\n type: 'vimeo',\n },\n type: 'reference' as const,\n };\n },\n instagram: (id: string, provider = 'https://api.instagram.com/oembed?url=') => {\n return {\n referent: {\n id,\n provider,\n service: 'oembed',\n type: 'instagram',\n },\n type: 'reference' as const,\n };\n },\n dailymotion: (id: string, provider = 'https://www.dailymotion.com/services/oembed?url=') => {\n return {\n referent: {\n id,\n provider,\n service: 'oembed',\n type: 'dailymotion',\n },\n type: 'reference' as const,\n };\n },\n tiktok: (id: string, provider = 'https://www.tiktok.com/oembed?url=') => {\n return {\n referent: {\n id,\n provider,\n service: 'oembed',\n type: 'tiktok',\n },\n type: 'reference' as const,\n };\n },\n issuu: (id: string, provider = 'https://issuu.com/oembed_wp?url=') => {\n return {\n referent: {\n id,\n provider,\n service: 'oembed',\n type: 'issuu',\n },\n type: 'reference' as const,\n };\n },\n kickstarter: (id: string, provider = 'https://www.kickstarter.com/services/oembed?url=') => {\n return {\n referent: {\n id,\n provider,\n service: 'oembed',\n type: 'kickstarter',\n },\n type: 'reference' as const,\n };\n },\n polldaddy: (id: string, provider = 'https://polldaddy.com/oembed/?url=') => {\n return {\n referent: {\n id,\n provider,\n service: 'oembed',\n type: 'polldaddy',\n },\n type: 'reference' as const,\n };\n },\n};\n","import { ContentElement } from '../../content-elements/content-elements.js';\nimport type { ContentElementType } from '../../content-elements/types.js';\n\nconst socialRegExps = {\n instagram:\n /(?:https?:\\/\\/)?(?:www.)?instagram.com\\/?([a-zA-Z0-9\\.\\_\\-]+)?\\/([p]+)?([reel]+)?([tv]+)?([stories]+)?\\/([a-zA-Z0-9\\-\\_\\.]+)\\/?([0-9]+)?/,\n twitter: /https:\\/\\/(?:www\\.)?twitter\\.com\\/[^\\/]+\\/status(?:es)?\\/(\\d+)/,\n tiktok:\n /https:\\/\\/(?:m|www|vm)?\\.?tiktok\\.com\\/((?:.*\\b(?:(?:usr|v|embed|user|video)\\/|\\?shareId=|\\&item_id=)(\\d+))|\\w+)/,\n facebookPost:\n /https:\\/\\/www\\.facebook\\.com\\/(photo(\\.php|s)|permalink\\.php|media|questions|notes|[^\\/]+\\/(activity|posts))[\\/?].*$/,\n facebookVideo: /https:\\/\\/www\\.facebook\\.com\\/([^\\/?].+\\/)?video(s|\\.php)[\\/?].*/,\n};\n\nfunction match(url: string, regex: RegExp): string | undefined {\n return url.match(regex)?.[0];\n}\n\nexport function youtubeURLParser(url: string | null = '') {\n const regExp =\n /(?:youtube(?:-nocookie)?\\.com\\/(?:[^\\/\\n\\s]+\\/\\S+\\/|(?:v|e(?:mbed)?)\\/|\\S*?[?&]vi?=)|youtu\\.be\\/)([a-zA-Z0-9_-]{11})/;\n const id = url?.match(regExp)?.[1];\n if (id) {\n return `https://youtu.be/${id}`;\n }\n\n const paylistMatch = url?.match(/[?&]list=([^#&?]+)/);\n if (paylistMatch?.[1]) {\n return `https://www.youtube.com/embed/videoseries?list=${paylistMatch?.[1]}`;\n }\n\n return undefined;\n}\n\nexport function twitterURLParser(url: string) {\n return match(url, socialRegExps.twitter);\n}\n\nexport function instagramURLParser(url: string) {\n return match(url, socialRegExps.instagram);\n}\n\nexport function tiktokURLParser(url: string) {\n return match(url, socialRegExps.tiktok);\n}\n\nexport function facebookVideoURLParser(url: string) {\n return match(url, socialRegExps.facebookVideo);\n}\n\nexport function facebookPostURLParser(url: string) {\n return match(url, socialRegExps.facebookPost);\n}\n\nexport function createSocial(url = ''): ContentElementType<'instagram' | 'tiktok' | 'youtube' | 'twitter'>[] {\n const embeds: ContentElementType<'instagram' | 'tiktok' | 'youtube' | 'twitter'>[] = [];\n\n const instagram = instagramURLParser(url);\n if (instagram) {\n embeds.push(ContentElement.instagram(instagram));\n }\n\n const twitter = twitterURLParser(url);\n if (twitter) {\n embeds.push(ContentElement.twitter(twitter));\n }\n\n const tiktok = tiktokURLParser(url);\n if (tiktok) {\n embeds.push(ContentElement.tiktok(tiktok));\n }\n\n const youtube = youtubeURLParser(url);\n if (youtube) {\n embeds.push(ContentElement.youtube(youtube));\n }\n\n const facebookPost = facebookPostURLParser(url);\n if (facebookPost) {\n embeds.push(ContentElement.facebook_post(facebookPost));\n }\n\n const facebookVideo = facebookVideoURLParser(url);\n if (facebookVideo) {\n embeds.push(ContentElement.facebook_video(facebookVideo));\n }\n\n return embeds;\n}\n\nexport const randomId = () => `${new Date().toISOString()}-${Math.random()}`;\n","import encode from 'base32-encode';\nimport { v5 as uuidv5 } from 'uuid';\n\nexport const generateArcId = (identifier: string, orgHostname: string) => {\n const namespace = uuidv5(orgHostname, uuidv5.DNS);\n const buffer = uuidv5(identifier, namespace, Buffer.alloc(16));\n return encode(buffer, 'RFC4648', { padding: false });\n};\n\n/**\n * Utility class for generating Arc IDs and source IDs\n *\n * @example\n * ```ts\n * const generator = new IdGenerator(['my-org']);\n * const arcId = generator.getArcId('123'); // Generates a unique for 'my-org' Arc ID\n * const sourceId = generator.getSourceId('123', ['my-site']); // Generates 'my-site-123'\n * ```\n */\nexport class IdGenerator {\n private namespace: string;\n\n constructor(namespaces: string[]) {\n if (!namespaces.length) {\n throw new Error('At least 1 namespace is required');\n }\n\n this.namespace = namespaces.join('-');\n }\n\n getArcId(id: number | string) {\n return generateArcId(id.toString(), this.namespace);\n }\n\n getSourceId(id: number | string, prefixes: string[] = []) {\n return [...prefixes, id].join('-');\n }\n}\n","import assert from 'node:assert';\nimport type { ArcAPIType } from '../../api';\nimport type { Section, SectionReference, SetSectionPayload } from '../../types';\nimport { reference } from './ans';\n\nexport type NavigationTreeNode<T = unknown> = {\n id: string;\n children: NavigationTreeNode<T>[];\n parent: NavigationTreeNode<T> | null;\n meta: T;\n};\n\nexport type NavigationItem = {\n id: string;\n [key: `N${number}`]: string;\n};\n\nexport const buildTree = <T = any>(items: NavigationItem[]) => {\n const tree: NavigationTreeNode<T>[] = [\n {\n id: '/',\n children: [],\n meta: new Proxy(\n {},\n {\n get: () => {\n throw new Error('Root node meta is not accessible');\n },\n }\n ),\n parent: null,\n } as any,\n ];\n\n // Track nodes at each level to maintain parent-child relationships\n // stores last node at each level\n const currLevelNodes: Record<number, NavigationTreeNode<T>> = {\n 0: tree[0],\n };\n\n for (const item of items) {\n const node: NavigationTreeNode<T> = {\n id: item.id,\n parent: null,\n children: [],\n meta: item as any,\n };\n\n // Determine the level of this node\n const levelKey = Object.keys(item).find((key) => key.startsWith('N') && item[key as keyof NavigationItem]);\n const level = Number(levelKey?.replace('N', '')) || 0;\n if (!level) {\n throw new Error(`Invalid level for section ${item.id}`);\n }\n\n // This is a child node - attach to its parent\n const parentLevel = level - 1;\n const parentNode = currLevelNodes[parentLevel];\n\n if (parentNode) {\n node.parent = parentNode;\n parentNode.children.push(node);\n } else {\n throw new Error(`Parent node not found for section ${item.id}`);\n }\n\n // Set this as the current node for its level\n currLevelNodes[level] = node;\n }\n\n // return root nodes children\n return tree[0].children;\n};\n\nexport const flattenTree = <T = any>(tree: NavigationTreeNode<T>[]): NavigationTreeNode<T>[] => {\n const flatten: NavigationTreeNode<T>[] = [];\n\n const traverse = (node: NavigationTreeNode<T>) => {\n flatten.push(node);\n for (const child of node.children) {\n traverse(child);\n }\n };\n\n // traverse all root nodes and their children\n for (const node of tree) {\n traverse(node);\n }\n\n return flatten;\n};\n\nexport const buildAndFlattenTree = <T>(items: NavigationItem[]) => flattenTree<T>(buildTree(items));\n\nexport const groupByWebsites = (sections: Section[]) => {\n return sections.reduce(\n (acc, section) => {\n const website = section._website!;\n if (!acc[website]) acc[website] = [];\n acc[website].push(section);\n return acc;\n },\n {} as Record<string, Section[]>\n );\n};\n\nexport const references = (sections: Section[]) => {\n return sections.map(\n (s) =>\n reference({\n id: s._id,\n website: s._website,\n type: 'section',\n }) as SectionReference\n );\n};\n\nexport const isReference = (section: any): section is SectionReference => {\n return section?.type === 'reference' && section?.referent?.type === 'section';\n};\n\nexport const removeDuplicates = <T extends Section | SectionReference>(sections: T[]): T[] => {\n const map = new Map();\n\n sections.forEach((s) => {\n if (isReference(s)) {\n map.set(`${s.referent.id}${s.referent.website}`, s);\n } else {\n map.set(`${s._id}${s._website}`, s);\n }\n });\n\n return [...map.values()];\n};\n\nexport class SectionsRepository {\n public sectionsByWebsite: Record<string, Section[]> = {};\n public websitesAreLoaded = false;\n\n constructor(protected arc: ArcAPIType) {}\n\n async put(ans: SetSectionPayload) {\n await this.arc.Site.putSection(ans);\n const created = await this.arc.Site.getSection(ans._id, ans.website);\n this.save(created);\n }\n\n async loadWebsite(website: string) {\n const sections: Section[] = [];\n let next = true;\n let offset = 0;\n\n while (next) {\n const migrated = await this.arc.Site.getSections({ website, offset }).catch((_) => {\n return { q_results: [] };\n });\n if (migrated.q_results.length) {\n sections.push(...migrated.q_results);\n offset += migrated.q_results.length;\n } else {\n next = false;\n }\n }\n\n return sections;\n }\n\n async loadWebsites(websites: string[]) {\n for (const website of websites) {\n this.sectionsByWebsite[website] = await this.loadWebsite(website);\n }\n\n this.websitesAreLoaded = true;\n }\n\n save(section: Section) {\n const website = section._website;\n\n assert.ok(website, 'Section must have a website');\n\n this.sectionsByWebsite[website] = this.sectionsByWebsite[website] || [];\n\n if (!this.sectionsByWebsite[website].find((s) => s._id === section._id)) {\n this.sectionsByWebsite[website].push(section);\n }\n }\n\n getById(id: string, website: string) {\n this.ensureWebsitesLoaded();\n\n const section = this.sectionsByWebsite[website]?.find((s) => s._id === id);\n return section;\n }\n\n getByWebsite(website: string) {\n this.ensureWebsitesLoaded();\n\n return this.sectionsByWebsite[website];\n }\n\n getParentSections(section: Section) {\n this.ensureWebsitesLoaded();\n\n const parents: Section[] = [];\n let current = section;\n\n while (current.parent?.default && current.parent.default !== '/') {\n const parent = this.getById(current.parent.default, section._website!);\n if (!parent) break;\n\n parents.push(parent);\n current = parent;\n }\n\n return parents;\n }\n\n protected ensureWebsitesLoaded() {\n assert.ok(this.websitesAreLoaded, 'call .loadWebsites() first');\n }\n}\n","import * as ANS from './ans.js';\nimport * as ContentElements from './content.js';\nimport * as Id from './id.js';\nimport * as Section from './section.js';\n\nexport const ArcUtils = {\n Id,\n ANS,\n ContentElements,\n Section,\n};\n","import type { ANSContent, CirculationReference, PostANSParams, PostANSPayload } from '../api/migration-center/types.js';\nimport type { ContentElementType } from '../content-elements/types.js';\nimport type { ANS } from '../types/index.js';\nimport type { MaybePromise, Optional } from '../types/utils.js';\n\n/**\n * Base class for all arc entities, it provides common methods and properties\n * If you want to create a new entity subtype you should extend this class\n *\n * Use case: You want to migrate stories from BBC\n * You define `class BBCStory extends ArcDocument<ANS.AStory>` and implement all abstract methods\n * Then you can override the specific methods to enrich the story with the data from BBC\n *\n * To migrate it call .migrate() method\n */\nexport abstract class Document<ANS extends ANSContent> {\n public ans: ANS | null = null;\n public circulations: CirculationReference[] = [];\n\n async init(): Promise<void> {\n // fetch necessary data and validate it here\n }\n\n abstract sourceId(): MaybePromise<string>;\n abstract sourceType(): MaybePromise<string>;\n abstract websiteId(): MaybePromise<string>;\n abstract legacyUrl(): MaybePromise<string>;\n abstract arcId(): MaybePromise<string>;\n abstract type(): MaybePromise<string>;\n abstract groupId(): MaybePromise<string>;\n abstract version(): ANS.DescribesTheANSVersionOfThisObject;\n\n abstract getAns(): MaybePromise<ANS>;\n\n async prepare(): Promise<{\n params: PostANSParams;\n payload: PostANSPayload<ANS>;\n }> {\n await this.init();\n\n const payload = await this.payload();\n const params = await this.params();\n\n return { payload, params };\n }\n\n private async payload(): Promise<PostANSPayload<ANS>> {\n this.ans = await this.getAns();\n this.circulations = await this.getCirculations();\n\n return {\n sourceId: await this.sourceId(),\n sourceType: await this.sourceType(),\n ANS: this.ans,\n circulations: this.circulations,\n arcAdditionalProperties: this.additionalProperties(),\n };\n }\n\n private async params(): Promise<PostANSParams> {\n if (!this.websiteId()) {\n throw new Error('Website is not initialized! get params() should be called after payload()!');\n }\n\n return {\n website: await this.websiteId(),\n groupId: await this.groupId(),\n priority: this.priority(),\n };\n }\n\n protected additionalProperties(): PostANSPayload['arcAdditionalProperties'] {\n return {\n story: {\n publish: false,\n },\n };\n }\n\n protected priority(): 'historical' | 'live' {\n return 'historical';\n }\n\n protected getDistributor(): MaybePromise<Optional<ANS.Distributor>> {\n return;\n }\n\n protected getLanguage() {\n return 'en-GB';\n }\n\n protected getComments(): Optional<ANS.Comments> {\n return;\n }\n\n protected async getSource(): Promise<Optional<ANS.Source>> {\n return {\n name: 'code-store',\n system: 'code-store',\n source_id: await this.sourceId(),\n };\n }\n\n protected getSubheadlines(): Optional<ANS.SubHeadlines> {\n return {\n basic: '',\n };\n }\n\n protected getDescription(): Optional<ANS.Description> {\n return this.getSubheadlines();\n }\n\n protected formatDate(date?: Date) {\n if (!date) return;\n return date.toISOString();\n }\n\n protected getDisplayDate(): MaybePromise<Optional<Date>> {\n return new Date();\n }\n\n protected async getContentElements(): Promise<ContentElementType<any>[]> {\n return [];\n }\n\n protected getPublicationDate(): MaybePromise<Optional<Date>> {\n return new Date();\n }\n\n protected getHeadlines(): Optional<ANS.Headlines> {\n return {\n basic: '',\n };\n }\n\n protected getTags(): MaybePromise<Optional<ANS.Tag[]>> {\n return;\n }\n\n protected getSubtype(): MaybePromise<Optional<ANS.SubtypeOrTemplate>> {\n return;\n }\n\n protected getLabel(): MaybePromise<Optional<ANS.Label>> {\n return;\n }\n\n protected getRelatedContent(): MaybePromise<Optional<ANS.Related_Content>> {\n return;\n }\n\n protected async getPromoItems(): Promise<Optional<ANS.PromoItems>> {\n return;\n }\n\n protected getWebskedStatusCode(): MaybePromise<ANS.WorkflowInformation['status_code']> {\n return;\n }\n\n protected getCreditsBy(): MaybePromise<ANS.By> {\n return [];\n }\n\n protected getCirculations(): MaybePromise<CirculationReference[]> {\n return [];\n }\n\n protected getEditorNote(): MaybePromise<Optional<ANS.Editor_Note>> {\n return;\n }\n\n protected getContentRestrictions(): MaybePromise<Optional<ANS.ContentRestrictions>> {\n return;\n }\n\n protected getOwnerInformation(): MaybePromise<Optional<ANS.OwnerInformation>> {\n return;\n }\n\n protected getSyndication(): MaybePromise<Optional<ANS.Syndication>> {\n return;\n }\n\n protected getSchedulingInformation(): MaybePromise<Optional<ANS.SchedulingInformation>> {\n return;\n }\n\n protected getTaxonomy(): MaybePromise<Optional<ANS.Taxonomy>> {\n return;\n }\n}\n","import type { ANSContent } from '../api/migration-center/types.js';\nimport type { ANS } from '../types/index.js';\nimport { Document } from './doc.js';\n\n/**\n * Base class for all arc stories, it provides common methods and properties\n * If you want to create a new story subtype you should extend this class\n *\n * Use case: You want to migrate stories from BBC\n * You define `class BBCStory extends ArcStory` and implement all abstract methods\n * Then you need to override the specific methods to enrich the story with the data from BBC\n *\n * For example:\n * To add tag to BBC stories you need to override\n * protected getTags(): MaybePromise<ArcTypes.Story.Tag[]> {\n * return [{\n * slug: 'bbc',\n * text: 'bbc',\n * }];\n * }\n */\nexport abstract class Story<ANS extends ANSContent = ANS.AStory> extends Document<ANS> {\n type() {\n return 'story' as const;\n }\n\n async getAns() {\n const id = await this.arcId();\n const version = this.version();\n const type = this.type();\n const publicationDate = await this.getPublicationDate();\n const displayDate = await this.getDisplayDate();\n const headlines = this.getHeadlines();\n const subheadlines = this.getSubheadlines();\n const description = this.getDescription();\n const language = this.getLanguage();\n const tags = await this.getTags();\n const subtype = await this.getSubtype();\n const label = await this.getLabel();\n const by = await this.getCreditsBy();\n const relatedContent = await this.getRelatedContent();\n const editorNote = await this.getEditorNote();\n const distributor = await this.getDistributor();\n const promoItems = await this.getPromoItems();\n const contentElements = await this.getContentElements();\n const webskedStatusCode = await this.getWebskedStatusCode();\n const websiteId = await this.websiteId();\n const source = await this.getSource();\n const comments = await this.getComments();\n const legacyUrl = await this.legacyUrl();\n const owner = await this.getOwnerInformation();\n const syndication = await this.getSyndication();\n const contentRestrictions = await this.getContentRestrictions();\n const planning = await this.getSchedulingInformation();\n const taxonomy = await this.getTaxonomy();\n const additionalMetaProperties = await this.getMigrationMetaProperties();\n\n return {\n type,\n _id: id,\n version,\n website: websiteId,\n canonical_website: websiteId,\n language,\n subtype,\n label,\n editor_note: editorNote,\n credits: {\n by,\n },\n headlines,\n subheadlines,\n description,\n distributor,\n planning,\n promo_items: promoItems,\n related_content: relatedContent,\n content_restrictions: contentRestrictions,\n created_date: this.formatDate(new Date()),\n first_publish_date: this.formatDate(publicationDate),\n publish_date: this.formatDate(publicationDate),\n display_date: this.formatDate(displayDate),\n source,\n comments,\n owner,\n syndication,\n taxonomy: {\n ...taxonomy,\n tags,\n },\n workflow: {\n status_code: webskedStatusCode,\n },\n content_elements: contentElements,\n additional_properties: {\n url: legacyUrl,\n ...additionalMetaProperties,\n },\n } as unknown as ANS;\n }\n\n protected async getMigrationMetaProperties(): Promise<Record<string, any>> {\n return {\n // used in dashboard for migration\n migration_source_id: await this.sourceId(),\n migration_source_type: await this.sourceType(),\n // used in dashboard to show the original url\n migration_url: await this.legacyUrl(),\n migration_group_id: await this.groupId(),\n };\n }\n}\n","export const BLOCK_ELEMENT_TAGS = [\n 'ADDRESS',\n 'ARTICLE',\n 'ASIDE',\n 'BLOCKQUOTE',\n 'DETAILS',\n 'DIV',\n 'DL',\n 'FIELDSET',\n 'FIGCAPTION',\n 'FIGURE',\n 'FOOTER',\n 'FORM',\n 'H1',\n 'H2',\n 'H3',\n 'H4',\n 'H5',\n 'H6',\n 'HEADER',\n 'HR',\n 'LINE',\n 'MAIN',\n 'MENU',\n 'NAV',\n 'OL',\n 'P',\n 'PARAGRAPH',\n 'PRE',\n 'SECTION',\n 'TABLE',\n 'UL',\n 'LI',\n 'BODY',\n 'HTML',\n];\n","import { decode } from 'html-entities';\nimport { CommentNode, HTMLElement, type Node, type Options, TextNode, parse } from 'node-html-parser';\nimport type { CElement, ContentElementType } from '../types.js';\n\nexport const isTextNode = (node?: Node): node is TextNode => {\n return node instanceof TextNode;\n};\n\nexport const isHTMLElement = (node?: Node): node is HTMLElement => {\n return node instanceof HTMLElement;\n};\n\nexport const isCommentNode = (node?: Node): node is CommentNode => {\n return node instanceof CommentNode;\n};\n\nexport const nodeTagIs = (node: Node, name: string): node is HTMLElement => {\n return isHTMLElement(node) && node.tagName?.toLowerCase() === name.toLowerCase();\n};\n\nexport const nodeTagIn = (node: Node, names: string[]): node is HTMLElement => {\n return isHTMLElement(node) && names.includes(node.tagName?.toLowerCase());\n};\n\nexport const isTextCE = (ce?: CElement): ce is ContentElementType<'text'> => {\n return ce?.type === 'text';\n};\n\nexport const decodeHTMLEntities = (str: string) => decode(str);\n\nexport const htmlToText = (html?: string | null, parseOptions?: Partial<Options>) => {\n if (!html) return '';\n const doc = parse(html, parseOptions);\n return decodeHTMLEntities(doc.innerText);\n};\n\nexport const getHTMLElementAttribute = (e: HTMLElement, key: string) => {\n const value = e.getAttribute(key);\n if (value) return value;\n\n return new URLSearchParams(e.rawAttrs.replaceAll(' ', '&')).get(key);\n};\n","import { type CommentNode, type HTMLElement, type Node, parse } from 'node-html-parser';\nimport type { MaybePromise } from '../../types/utils.js';\nimport { ContentElement } from '../content-elements.js';\nimport type { CElement, ContentElementType } from '../types.js';\nimport { BLOCK_ELEMENT_TAGS } from './html.constants.js';\nimport {\n getHTMLElementAttribute,\n isCommentNode,\n isHTMLElement,\n isTextCE,\n isTextNode,\n nodeTagIn,\n nodeTagIs,\n} from './html.utils.js';\n\nexport type NodeHandler = (node: Node) => MaybePromise<CElement[] | undefined>;\nexport type WrapHandler = (node: Node, content: ContentElementType<'text'>) => ContentElementType<'text'> | undefined;\n\n/**\n * HTMLProcessor is responsible for parsing HTML content into structured content elements.\n * It provides a flexible way to handle different HTML nodes and wrap text content.\n *\n * The processor can be extended with custom handlers for specific node types and\n * wrappers for text content.\n *\n * @example\n * ```ts\n * // Create and initialize processor\n * const processor = new HTMLProcessor();\n * processor.init();\n *\n * // Parse HTML content\n * const html = '<div><p>Some text</p><img src=\"image.jpg\"></div>';\n * const elements = await processor.parse(html);\n * ```\n *\n * The processor comes with built-in handlers for common HTML elements like links,\n * text formatting (i, u, strong), and block elements. Custom handlers can be added\n * using the `handle()` and `wrap()` methods.\n */\nexport class HTMLProcessor {\n protected parallelProcessing = true;\n\n protected handlers = {\n node: new Map<string, NodeHandler>(),\n wrap: new Map<string, WrapHandler>(),\n };\n\n init() {\n // wrappers are used to wrap the content of nested text nodes\n // in a specific way\n this.wrap('link', (node, text) => {\n if (nodeTagIn(node, ['a'])) {\n const attributes = ['href', 'target', 'rel']\n .map((attr) => [attr, getHTMLElementAttribute(node, attr)])\n .filter(([_, value]) => value)\n .map(([key, value]) => `${key}=\"${value}\"`)\n .join(' ');\n\n return {\n ...text,\n content: `<a ${attributes}>${text.content}</a>`,\n };\n }\n });\n\n this.wrap('i', (node, text) => {\n if (nodeTagIn(node, ['i'])) {\n return {\n ...text,\n content: `<i>${text.content}</i>`,\n };\n }\n });\n\n this.wrap('u', (node, text) => {\n if (nodeTagIn(node, ['u'])) {\n return {\n ...text,\n content: `<u>${text.content}</u>`,\n };\n }\n });\n\n this.wrap('sup/sub', (node, text) => {\n if (nodeTagIn(node, ['sup', 'sub'])) {\n return {\n ...text,\n content: `<mark class=\"${node.tagName.toLowerCase()}\">${text.content}</mark>`,\n };\n }\n });\n\n this.wrap('strong', (node, text) => {\n if (nodeTagIn(node, ['strong', 'b'])) {\n return {\n ...text,\n content: `<b>${text.content}</b>`,\n };\n }\n });\n\n this.wrap('center', (node, text) => {\n if (nodeTagIn(node, ['center'])) {\n return {\n ...text,\n alignment: 'center',\n };\n }\n });\n\n this.wrap('aligned-paragraph', (node, text) => {\n if (nodeTagIn(node, ['p'])) {\n const styleAttribute = getHTMLElementAttribute(node, 'style') || '';\n if (!styleAttribute) return text;\n\n if (styleAttribute.includes('text-align: right;')) {\n return {\n ...text,\n alignment: 'right',\n };\n }\n if (styleAttribute.includes('text-align: left;')) {\n return {\n ...text,\n alignment: 'left',\n };\n }\n if (styleAttribute.includes('text-align: center;')) {\n return {\n ...text,\n alignment: 'center',\n };\n }\n\n return text;\n }\n });\n\n // handlers are used to handle specific nodes\n // and return a list of content elements\n this.handle('default', (node) => {\n const noTag = isHTMLElement(node) && !node.tagName;\n if (\n noTag ||\n nodeTagIn(node, [\n 'p',\n 'a',\n 'b',\n 'sup',\n 'sub',\n 'span',\n 'strong',\n 'em',\n 'i',\n 'u',\n 'section',\n 'main',\n 'div',\n 'li',\n 'center',\n ])\n ) {\n return this.handleNested(node);\n }\n });\n\n this.handle('headers', (node) => {\n if (nodeTagIn(node, ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'])) {\n return this.createHeader(node);\n }\n });\n\n this.handle('text', (node) => {\n if (isTextNode(node)) {\n return this.createText(node);\n }\n });\n\n this.handle('comment', (node) => {\n if (isCommentNode(node)) {\n return this.handleComment(node);\n }\n });\n\n this.handle('list', async (node) => {\n if (nodeTagIn(node, ['ul', 'ol'])) {\n const listType = node.tagName === 'UL' ? 'unordered' : 'ordered';\n return this.createList(node, listType);\n }\n });\n\n this.handle('table', (node) => {\n if (nodeTagIs(node, 'table')) {\n return this.handleTable(node);\n }\n });\n\n this.handle('iframe', (node) => {\n if (nodeTagIs(node, 'iframe')) {\n return this.handleIframe(node);\n }\n });\n\n this.handle('img', (node) => {\n if (nodeTagIs(node, 'img')) {\n return this.handleImage(node);\n }\n });\n\n this.handle('br', (node) => {\n if (nodeTagIs(node, 'br')) {\n return this.handleBreak(node);\n }\n });\n }\n\n protected handle(name: string, handler: NodeHandler) {\n if (this.handlers.node.has(name)) {\n this.warn({ name }, `${name} node handler already set`);\n }\n\n this.handlers.node.set(name, handler);\n }\n\n protected wrap(name: string, handler: WrapHandler) {\n if (this.handlers.wrap.has(name)) {\n this.warn({ name }, `${name} wrap handler already set`);\n }\n\n this.handlers.wrap.set(name, handler);\n }\n\n public async parse(html: string) {\n const doc = parse(html, { comment: true });\n doc.removeWhitespace();\n const elements = await this.process(doc);\n const filtered = elements?.filter((e) => e.type !== 'divider');\n\n return filtered || [];\n }\n\n protected addTextAdditionalProperties(c: ContentElementType<any>, parent: Node) {\n const additionalProperties = c.additional_properties || {};\n const parentNodeIsBlockElement = this.isBlockElement(parent);\n c.additional_properties = {\n ...c.additional_properties,\n isBlockElement: additionalProperties.isBlockElement || parentNodeIsBlockElement,\n };\n return c;\n }\n\n /**\n * Wraps text content elements with additional properties and handlers.\n * This method iterates through an array of content elements and applies\n * wrappers to text elements.\n *\n * @param node - The HTML node containing the text elements\n **/\n protected wrapChildrenTextNodes(node: Node, elements: CElement[]) {\n const wrapped: CElement[] = [];\n const wrappers = [...this.handlers.wrap.values()];\n\n for (const c of elements) {\n if (!isTextCE(c)) {\n wrapped.push(c);\n continue;\n }\n this.addTextAdditionalProperties(c, node);\n\n const handled = wrappers.map((wrapper) => wrapper(node, c)).find(Boolean);\n wrapped.push(handled || c);\n }\n\n return wrapped;\n }\n\n /**\n * Handles nested nodes by processing their children and merging text elements.\n * This method recursively processes the children of a given HTML node and\n * returns a list of content elements.\n *\n * @param node - The HTML node to process\n **/\n protected async handleNested(node: Node) {\n const children = await this.processChildNodes(node);\n const filtered = children.filter(Boolean).flat() as CElement[];\n const merged = this.mergeParagraphs(filtered);\n const wrapped = this.wrapChildrenTextNodes(node, merged);\n\n return wrapped;\n }\n\n protected async processChildNodes(node: Node): Promise<(CElement[] | undefined)[]> {\n if (this.parallelProcessing) {\n return await Promise.all(node.childNodes.map((child) => this.process(child)));\n }\n\n const children: (CElement[] | undefined)[] = [];\n for (const child of node.childNodes) {\n children.push(await this.process(child));\n }\n return children;\n }\n\n /**\n * Processes a single HTML node and converts it into content elements.\n * This method iterates through registered node handlers and attempts to process the node.\n * If a handler successfully processes the node, it returns an array of content elements.\n *\n * @param node - The HTML node to process\n * @returns Promise resolving to an array of content elements, or undefined if node cannot be processed\n */\n protected async process(node: Node) {\n let isKnownNode = false;\n const elements: CElement[] = [];\n\n for (const [name, handler] of this.handlers.node.entries()) {\n try {\n const result = await handler(node);\n\n if (result) {\n // if handler returns an array of elements, it means that the node was handled properly, even if there is no elements inside\n isKnownNode = true;\n elements.push(...result);\n break;\n }\n } catch (error: any) {\n this.warn({ node: node.toString(), error: error.toString(), name }, 'HandlerError');\n }\n }\n if (isKnownNode) return elements;\n this.warn({ node: node.toString() }, 'UnknownNodeError');\n }\n\n /**\n * Merges adjacent text content elements into a single paragraph.\n * This method iterates through an array of content elements and combines\n * adjacent text elements into a single paragraph.\n *\n * @param items - The array of content elements to merge\n **/\n protected mergeParagraphs(items: CElement[]): CElement[] {\n const merged: CElement[] = [];\n let toMerge: ContentElementType<'text'>[] = [];\n\n const merge = (): void => {\n if (!toMerge.length) return;\n\n const paragraph = toMerge.reduce(\n (acc, p) => {\n return {\n ...p,\n content: acc.content + p.content,\n };\n },\n { type: 'text', content: '' }\n );\n\n merged.push(paragraph);\n toMerge = [];\n };\n\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n const isBlockElement = item.additional_properties?.isBlockElement;\n if (isTextCE(item) && !isBlockElement) {\n toMerge.push(item);\n } else {\n merge();\n merged.push(item);\n }\n }\n\n merge();\n\n return merged;\n }\n\n protected handleComment(_: CommentNode): MaybePromise<CElement[]> {\n return [];\n }\n\n protected async handleTable(node: Node) {\n return [ContentElement.raw_html(node.toString())];\n }\n\n protected async handleIframe(node: Node) {\n return [ContentElement.raw_html(node.toString())];\n }\n\n protected async handleImage(node: Node) {\n return [ContentElement.raw_html(node.toString())];\n }\n\n protected async handleBreak(_: Node) {\n return [ContentElement.divider()];\n }\n\n protected async createQuote(node: Node) {\n const items = await this.handleNested(node);\n\n return [ContentElement.quote(items)];\n }\n\n protected async createText(node: Node): Promise<CElement[]> {\n const text = ContentElement.text(node.text);\n return [text];\n }\n\n protected filterListItems(items: ContentElementType<any>[]) {\n return items.filter((i) => ['text', 'list'].includes(i.type));\n }\n\n protected async createList(node: Node, type: 'ordered' | 'unordered'): Promise<ContentElementType<any>[]> {\n const items = await this.handleNested(node);\n return [ContentElement.list(type, this.filterListItems(items))];\n }\n\n protected async createHeader(node: HTMLElement) {\n const level = +node.tagName.split('H')[1] || 3;\n\n return [ContentElement.header(node.innerText, level)];\n }\n\n protected isBlockElement(node: Node) {\n if (!isHTMLElement(node)) return false;\n\n const defaultBlockElements = new Set(BLOCK_ELEMENT_TAGS);\n return defaultBlockElements.has(node.tagName);\n }\n\n protected warn(metadata: Record<string, any>, message: string) {\n console.warn(metadata, message);\n }\n}\n"],"names":["node","uuidv5"],"mappings":";;;;;;;;;;AAQO,MAAM,iBAAiB,GAAG,CAAC,IAAS,KAAY;AACrD,IAAA,IAAI;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE;IACnC;AAAE,IAAA,MAAM;AACN,QAAA,OAAO,EAAE;IACX;AACF,CAAC;AAqBM,MAAM,6BAA6B,GAAG,CAC3C,gBAA+B,KACmD;IAClF,OAAO;AACL,QAAA,CAAC,QAAQ,KAAK,QAAQ;QACtB,CAAC,KAAK,KAAI;AACR,YAAA,MAAM,gBAAgB,CAAC,KAAK,CAAC;QAC/B,CAAC;KACF;AACH,CAAC;;ACzCK,MAAO,QAAS,SAAQ,KAAK,CAAA;IAQjC,WAAA,CAAY,OAAe,EAAE,CAAa,EAAA;QACxC,MAAM,kBAAkB,GAAG,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,4BAA4B,CAAC;QAC5E,MAAM,cAAc,GAAG,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,wBAAwB,CAAC;AACpE,QAAA,MAAM,IAAI,GAAG;YACX,IAAI,EAAE,CAAA,EAAG,OAAO,CAAA,KAAA,CAAO;YACvB,OAAO,EAAE,CAAC,CAAC,OAAO;AAClB,YAAA,YAAY,EAAE,CAAC,CAAC,QAAQ,EAAE,IAAI;AAC9B,YAAA,cAAc,EAAE,CAAC,CAAC,QAAQ,EAAE,MAAM;AAClC,YAAA,cAAc,EAAE,CAAC,CAAC,QAAQ,EAAE,MAAM;YAClC,kBAAkB;YAClB,cAAc;YACd,OAAO;SACR;AACD,QAAA,MAAM,OAAO,GAAG,iBAAiB,CAAC,IAAI,CAAC;QAEvC,KAAK,CAAC,OAAO,CAAC;AAEd,QAAA,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IA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