Skip to content

Commit 5949c73

Browse files
authored
Merge pull request #25 from code-store-platform/feat/add-video-api-and-types
Add Video Center API
2 parents d3dd67a + 735c5a9 commit 5949c73

6 files changed

Lines changed: 56 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @code.store/arcxp-sdk-ts
22

3+
## 5.6.0
4+
5+
### Minor Changes
6+
7+
- b1cd942: Add VideoCenter API with importVideo, deleteVideo, and updateVideoUrl methods
8+
39
## 5.5.0
410

511
### Minor Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@code.store/arcxp-sdk-ts",
3-
"version": "5.5.0",
3+
"version": "5.6.0",
44
"description": "A strongly typed set of ArcXP API's and utilities reduce the amount of work required to develop with ArcXP, starting with reducing the boilerplate code you have to write.",
55
"type": "module",
66
"main": "./dist/index.js",

src/api/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { ArcSales, ArcSalesV2 } from './sales/index.js';
1616
import { ArcSigningService } from './signing-service/index.js';
1717
import { ArcSite } from './site/index.js';
1818
import { ArcTags } from './tags/index.js';
19+
import { ArcVideoCenter } from './video-center/index.js';
1920
import { ArcWebsked } from './websked/index.js';
2021

2122
export const ArcAPI = (options: ArcAPIOptions) => {
@@ -38,6 +39,7 @@ export const ArcAPI = (options: ArcAPIOptions) => {
3839
ContentOps: new ArcContentOps(options),
3940
RetailEvents: new ArcRetailEvents(options),
4041
DeveloperRetail: new ArcDeveloperRetail(options),
42+
VideoCenter: new ArcVideoCenter(options),
4143
Custom: new Custom(options),
4244
};
4345

src/api/video-center/index.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { ArcAbstractAPI, type ArcAPIOptions } from '../abstract-api.js';
2+
import type { DeleteVideoParams, ImportVideoParams, ImportVideoPayload, UpdateVideoUrlParams } from './types.js';
3+
4+
export class ArcVideoCenter extends ArcAbstractAPI {
5+
constructor(options: ArcAPIOptions) {
6+
super({ ...options, apiPath: 'goldfish' });
7+
}
8+
9+
async importVideo(payload: ImportVideoPayload, params: ImportVideoParams): Promise<void> {
10+
await this.client.post('/video/v2/import/ans', payload, { params });
11+
}
12+
13+
async deleteVideo(params: DeleteVideoParams): Promise<void> {
14+
await this.client.delete('/video/v2/import/ans', { params });
15+
}
16+
17+
async updateVideoUrl(params: UpdateVideoUrlParams): Promise<void> {
18+
await this.client.post('/video/v2/url/update', undefined, { params });
19+
}
20+
}

src/api/video-center/types.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
export type ImportVideoParams = {
2+
encode: boolean;
3+
isLive: boolean;
4+
useLastUpdated: boolean;
5+
};
6+
7+
export type ImportVideoPayload = {
8+
id?: string;
9+
type?: 'AUTHOR' | 'CLARIFICATION' | 'CORRECTION' | 'IMAGE' | 'REDIRECT' | 'REFERENCE' | 'SECTION' | 'SITE' | 'STORY' | 'VIDEO';
10+
version?: '_0_5_7' | '_0_5_8' | '_0_5_9' | '_0_6_0' | '_0_6_2' | '_0_8_0';
11+
canonicalWebsite?: string;
12+
embedHtml?: string;
13+
promoImage?: Record<string, unknown>;
14+
promoItems?: { basic?: Record<string, unknown> };
15+
streams?: Record<string, unknown>[];
16+
websites?: Record<string, unknown>;
17+
};
18+
19+
export type DeleteVideoParams = {
20+
uuid: string;
21+
hardDelete?: boolean;
22+
};
23+
24+
export type UpdateVideoUrlParams = {
25+
uuid: string;
26+
};

src/types/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export * from '../api/sales/types.js';
1313
export * from '../api/signing-service/types.js';
1414
export * from '../api/site/types.js';
1515
export * from '../api/tags/types.js';
16+
export * from '../api/video-center/types.js';
1617
export * from '../api/websked/types.js';
1718
export * from '../content-elements/types.js';
1819
export * as ANS from './ans-types';

0 commit comments

Comments
 (0)