@code.store/arcxp-sdk-ts 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +103 -1
- package/package.json +10 -2
package/README.md
CHANGED
|
@@ -1,2 +1,104 @@
|
|
|
1
1
|
# arcxp-sdk-ts
|
|
2
|
-
|
|
2
|
+
<p align="left"> <a href="https://www.typescriptlang.org/" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/devicons/devicon/master/icons/typescript/typescript-original.svg" alt="typescript" width="40" height="40"/> </a> </p>
|
|
3
|
+
|
|
4
|
+
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.
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
Install the package with:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
npm i @code.store/arcxp-sdk-ts
|
|
11
|
+
```
|
|
12
|
+
## Features
|
|
13
|
+
#### API
|
|
14
|
+
* Draft
|
|
15
|
+
* Site
|
|
16
|
+
* Websked
|
|
17
|
+
* Identity
|
|
18
|
+
* Sales
|
|
19
|
+
* Retail Events (WebSockets)
|
|
20
|
+
* Author
|
|
21
|
+
* IFX
|
|
22
|
+
* Migration Center
|
|
23
|
+
|
|
24
|
+
##### Usage example
|
|
25
|
+
```ts
|
|
26
|
+
import { ArcAPI } from '@code.store/arcxp-sdk-ts';
|
|
27
|
+
|
|
28
|
+
const api = ArcAPI({
|
|
29
|
+
credentials: { organizationName: 'YOUR_ORG_NAME', accessToken: 'YOUR_ACCESS_TOKEN' },
|
|
30
|
+
maxRPS: 10,
|
|
31
|
+
});
|
|
32
|
+
const id = await api.Draft.generateId(Date.now().toString());
|
|
33
|
+
```
|
|
34
|
+
#### Content Elements
|
|
35
|
+
* text
|
|
36
|
+
* header
|
|
37
|
+
* image
|
|
38
|
+
* quote
|
|
39
|
+
* interstitial_link
|
|
40
|
+
* raw_html
|
|
41
|
+
* gallery
|
|
42
|
+
* list
|
|
43
|
+
* link_list
|
|
44
|
+
* jwPlayer
|
|
45
|
+
|
|
46
|
+
##### Usage example
|
|
47
|
+
```ts
|
|
48
|
+
import { ContentElement } from '@code.store/arcxp-sdk-ts';
|
|
49
|
+
|
|
50
|
+
const header = ContentElement.header('Header', 4);
|
|
51
|
+
const text = ContentElement.text('text');
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Image migration example
|
|
56
|
+
```ts
|
|
57
|
+
import { ArcTypes, ArcAPI } from '@code.store/arcxp-sdk-ts';
|
|
58
|
+
import { ArcAPI } from '../../../arc';
|
|
59
|
+
|
|
60
|
+
const api = ArcAPI({
|
|
61
|
+
credentials: { organizationName: 'YOUR_ORG_NAME', accessToken: 'YOUR_ACCESS_TOKEN' },
|
|
62
|
+
maxRPS: 10,
|
|
63
|
+
});
|
|
64
|
+
const sourceImageId = 'sourceImageId';
|
|
65
|
+
const id = await api.Draft.generateId(sourceImageId);
|
|
66
|
+
const ans: ArcTypes.Story.AnImage = {
|
|
67
|
+
_id: id,
|
|
68
|
+
description: { basic: 'Description' },
|
|
69
|
+
caption: 'Caption',
|
|
70
|
+
subtitle: 'Subtitle',
|
|
71
|
+
alt_text: 'Alt',
|
|
72
|
+
type: 'image',
|
|
73
|
+
version: '0.10.9',
|
|
74
|
+
image_type: 'photograph',
|
|
75
|
+
source: {
|
|
76
|
+
name: 'codestore-arcxp-sdk-ts',
|
|
77
|
+
system: 'codestore-arcxp-sdk-ts',
|
|
78
|
+
source_id: sourceImageId,
|
|
79
|
+
},
|
|
80
|
+
additional_properties: {
|
|
81
|
+
originalName: 'originalName',
|
|
82
|
+
version: 0,
|
|
83
|
+
originalUrl: 'https://picsum.photos/200',
|
|
84
|
+
published: true,
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
await api.MigrationCenter.postAns(
|
|
89
|
+
{
|
|
90
|
+
website: 'YOUR_WEBSITE',
|
|
91
|
+
groupId: 'images',
|
|
92
|
+
priority: 'historical',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
sourceId: sourceImageId,
|
|
96
|
+
sourceType: 'image',
|
|
97
|
+
ANS: ans,
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
```
|
|
101
|
+
## License
|
|
102
|
+
|
|
103
|
+
[MIT](https://choosealicense.com/licenses/mit/)
|
|
104
|
+
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code.store/arcxp-sdk-ts",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/code-store-platform/arcxp-sdk-ts"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/code-store-platform/arcxp-sdk-ts",
|
|
8
12
|
"files": [
|
|
9
13
|
"dist"
|
|
10
14
|
],
|
|
@@ -13,7 +17,11 @@
|
|
|
13
17
|
"lint": "tsc --noEmit && TIMING=1 eslint \"src/**/*.ts*\"",
|
|
14
18
|
"test": "vitest"
|
|
15
19
|
},
|
|
16
|
-
"keywords": [
|
|
20
|
+
"keywords": [
|
|
21
|
+
"ArcXP",
|
|
22
|
+
"SDK",
|
|
23
|
+
"Code.Store"
|
|
24
|
+
],
|
|
17
25
|
"author": "code.store",
|
|
18
26
|
"license": "MIT",
|
|
19
27
|
"dependencies": {
|