@code.store/arcxp-sdk-ts 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -21
- package/dist/api/content/index.d.ts +7 -0
- package/dist/api/content/index.js +16 -0
- package/dist/api/content/index.js.map +1 -0
- package/dist/api/content/types.d.ts +5 -0
- package/dist/api/content/types.js +3 -0
- package/dist/api/content/types.js.map +1 -0
- package/dist/api/identity/types.d.ts +7 -7
- package/dist/api/index.d.ts +2 -0
- package/dist/api/index.js +2 -0
- package/dist/api/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/cache.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,27 +1,33 @@
|
|
|
1
1
|
# arcxp-sdk-ts
|
|
2
|
+
|
|
2
3
|
<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
|
|
|
4
5
|
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
|
|
|
6
7
|
## Installation
|
|
8
|
+
|
|
7
9
|
Install the package with:
|
|
8
10
|
|
|
9
11
|
```
|
|
10
12
|
npm i @code.store/arcxp-sdk-ts
|
|
11
13
|
```
|
|
14
|
+
|
|
12
15
|
## Features
|
|
16
|
+
|
|
13
17
|
#### API
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
|
|
19
|
+
- Draft
|
|
20
|
+
- Site
|
|
21
|
+
- Websked
|
|
22
|
+
- Identity
|
|
23
|
+
- Sales
|
|
24
|
+
- Retail Events (WebSockets)
|
|
25
|
+
- Author
|
|
26
|
+
- IFX
|
|
27
|
+
- Migration Center
|
|
23
28
|
|
|
24
29
|
##### Usage example
|
|
30
|
+
|
|
25
31
|
```ts
|
|
26
32
|
import { ArcAPI } from '@code.store/arcxp-sdk-ts';
|
|
27
33
|
|
|
@@ -31,28 +37,31 @@ const api = ArcAPI({
|
|
|
31
37
|
});
|
|
32
38
|
const id = await api.Draft.generateId(Date.now().toString());
|
|
33
39
|
```
|
|
40
|
+
|
|
34
41
|
#### Content Elements
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
|
|
43
|
+
- text
|
|
44
|
+
- header
|
|
45
|
+
- image
|
|
46
|
+
- quote
|
|
47
|
+
- interstitial_link
|
|
48
|
+
- raw_html
|
|
49
|
+
- gallery
|
|
50
|
+
- list
|
|
51
|
+
- link_list
|
|
52
|
+
- jwPlayer
|
|
45
53
|
|
|
46
54
|
##### Usage example
|
|
55
|
+
|
|
47
56
|
```ts
|
|
48
57
|
import { ContentElement } from '@code.store/arcxp-sdk-ts';
|
|
49
58
|
|
|
50
59
|
const header = ContentElement.header('Header', 4);
|
|
51
60
|
const text = ContentElement.text('text');
|
|
52
|
-
|
|
53
61
|
```
|
|
54
62
|
|
|
55
63
|
## Image migration example
|
|
64
|
+
|
|
56
65
|
```ts
|
|
57
66
|
import { ArcTypes, ArcAPI } from '@code.store/arcxp-sdk-ts';
|
|
58
67
|
import { ArcAPI } from '../../../arc';
|
|
@@ -98,7 +107,11 @@ await api.MigrationCenter.postAns(
|
|
|
98
107
|
}
|
|
99
108
|
);
|
|
100
109
|
```
|
|
110
|
+
|
|
111
|
+
## Changeset
|
|
112
|
+
|
|
113
|
+
`npx changeset && npx changeset version`
|
|
114
|
+
|
|
101
115
|
## License
|
|
102
116
|
|
|
103
117
|
[MIT](https://choosealicense.com/licenses/mit/)
|
|
104
|
-
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GetStoryParams } from './types';
|
|
2
|
+
import { ArcAbstractAPI, ArcAPIOptions } from '../abstract-api';
|
|
3
|
+
import { AStory } from '../../types/story';
|
|
4
|
+
export declare class ArcContent extends ArcAbstractAPI {
|
|
5
|
+
constructor(options: ArcAPIOptions);
|
|
6
|
+
getStory(params: GetStoryParams): Promise<AStory>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArcContent = void 0;
|
|
4
|
+
const abstract_api_1 = require("../abstract-api");
|
|
5
|
+
class ArcContent extends abstract_api_1.ArcAbstractAPI {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
super({ ...options, apiPath: 'content/v4' });
|
|
8
|
+
}
|
|
9
|
+
async getStory(params) {
|
|
10
|
+
const search = new URLSearchParams({ ...params, published: params.published.toString() }).toString();
|
|
11
|
+
const { data } = await this.client.get(`/stories?${search}`);
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.ArcContent = ArcContent;
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/content/index.ts"],"names":[],"mappings":";;;AACA,kDAAgE;AAGhE,MAAa,UAAW,SAAQ,6BAAc;IAC5C,YAAY,OAAsB;QAChC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,MAAsB;QACnC,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,EAAE,GAAG,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;QAErG,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,MAAM,EAAE,CAAC,CAAC;QAC7D,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAXD,gCAWC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/content/types.ts"],"names":[],"mappings":""}
|
|
@@ -11,15 +11,15 @@ export type MigrateUserPayload = {
|
|
|
11
11
|
lastLoginDate?: string;
|
|
12
12
|
}[];
|
|
13
13
|
profile: {
|
|
14
|
-
firstName
|
|
15
|
-
lastName
|
|
14
|
+
firstName?: string;
|
|
15
|
+
lastName?: string;
|
|
16
16
|
secondLastName?: string;
|
|
17
|
-
displayName
|
|
17
|
+
displayName?: string;
|
|
18
18
|
gender?: 'MALE' | 'FEMALE';
|
|
19
19
|
email: string;
|
|
20
|
-
birthYear
|
|
21
|
-
birthMonth
|
|
22
|
-
birthDay
|
|
20
|
+
birthYear?: string;
|
|
21
|
+
birthMonth?: string;
|
|
22
|
+
birthDay?: string;
|
|
23
23
|
contacts: {
|
|
24
24
|
phone: string;
|
|
25
25
|
type: 'WORK' | 'HOME' | 'PRIMARY' | 'OTHER';
|
|
@@ -29,7 +29,7 @@ export type MigrateUserPayload = {
|
|
|
29
29
|
line2?: string;
|
|
30
30
|
locality: string;
|
|
31
31
|
region?: string;
|
|
32
|
-
postal
|
|
32
|
+
postal?: string;
|
|
33
33
|
country?: string;
|
|
34
34
|
type: 'WORK' | 'HOME' | 'PRIMARY' | 'OTHER';
|
|
35
35
|
}[];
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ArcAPIOptions } from './abstract-api';
|
|
2
2
|
import { ArcAuthor } from './author';
|
|
3
|
+
import { ArcContent } from './content';
|
|
3
4
|
import { ArcDraft } from './draft';
|
|
4
5
|
import { ArcIdentity } from './identity';
|
|
5
6
|
import { ArcIFX } from './ifx';
|
|
@@ -19,4 +20,5 @@ export declare const ArcAPI: (options: ArcAPIOptions) => {
|
|
|
19
20
|
Sales: ArcSales;
|
|
20
21
|
Site: ArcSite;
|
|
21
22
|
Websked: ArcWebsked;
|
|
23
|
+
Content: ArcContent;
|
|
22
24
|
};
|
package/dist/api/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ArcAPI = void 0;
|
|
4
4
|
const author_1 = require("./author");
|
|
5
|
+
const content_1 = require("./content");
|
|
5
6
|
const draft_1 = require("./draft");
|
|
6
7
|
const identity_1 = require("./identity");
|
|
7
8
|
const ifx_1 = require("./ifx");
|
|
@@ -20,6 +21,7 @@ const ArcAPI = (options) => {
|
|
|
20
21
|
Sales: new sales_1.ArcSales(options),
|
|
21
22
|
Site: new site_1.ArcSite(options),
|
|
22
23
|
Websked: new websked_1.ArcWebsked(options),
|
|
24
|
+
Content: new content_1.ArcContent(options),
|
|
23
25
|
};
|
|
24
26
|
return {
|
|
25
27
|
...API,
|
package/dist/api/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;AACA,qCAAqC;AACrC,mCAAmC;AACnC,yCAAyC;AACzC,+BAA+B;AAC/B,yDAAwD;AACxD,mCAAmC;AACnC,iCAAiC;AACjC,uCAAuC;AACvC,2CAAuC;AAEhC,MAAM,MAAM,GAAG,CAAC,OAAsB,EAAE,EAAE;IAC/C,MAAM,GAAG,GAAG;QACV,MAAM,EAAE,IAAI,kBAAS,CAAC,OAAO,CAAC;QAC9B,KAAK,EAAE,IAAI,gBAAQ,CAAC,OAAO,CAAC;QAC5B,QAAQ,EAAE,IAAI,sBAAW,CAAC,OAAO,CAAC;QAClC,GAAG,EAAE,IAAI,YAAM,CAAC,OAAO,CAAC;QACxB,eAAe,EAAE,IAAI,qCAAkB,CAAC,OAAO,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AC;QACxB,eAAe,EAAE,IAAI,qCAAkB,CAAC,OAAO,CAAC;QAChD,KAAK,EAAE,IAAI,gBAAQ,CAAC,OAAO,CAAC;QAC5B,IAAI,EAAE,IAAI,cAAO,CAAC,OAAO,CAAC;QAC1B,OAAO,EAAE,IAAI,oBAAU,CAAC,OAAO,CAAC;QAChC,OAAO,EAAE,IAAI,oBAAU,CAAC,OAAO,CAAC;KACjC,CAAC;IAEF,OAAO;QACL,GAAG,GAAG;QACN,SAAS,EAAE,CAAC,GAAW,EAAE,EAAE;YACzB,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACtD,CAAC;QACD,YAAY,EAAE,CAAC,QAA8B,GAAG,EAAE,EAAE;YAClD,MAAM,OAAO,GAAG,aAAa,OAAO,CAAC,WAAW,CAAC,gBAAgB,iDAAiD,KAAK,EAAE,CAAC;YAC1H,MAAM,OAAO,GAAG;gBACd,aAAa,EAAE,UAAU,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE;aAC3D,CAAC;YACF,OAAO,IAAI,oBAAQ,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;QAC5C,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AA1BW,QAAA,MAAM,UA0BjB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,4 +9,5 @@ export * from './api/ifx/types';
|
|
|
9
9
|
export * from './api/migration-center/types';
|
|
10
10
|
export * from './api/sales/types';
|
|
11
11
|
export * from './api/websked/types';
|
|
12
|
+
export * from './api/content/types';
|
|
12
13
|
export { ArcAPI, WsClient, ContentElement, ContentElementType, ArcTypes };
|
package/dist/index.js
CHANGED
|
@@ -42,4 +42,5 @@ __exportStar(require("./api/ifx/types"), exports);
|
|
|
42
42
|
__exportStar(require("./api/migration-center/types"), exports);
|
|
43
43
|
__exportStar(require("./api/sales/types"), exports);
|
|
44
44
|
__exportStar(require("./api/websked/types"), exports);
|
|
45
|
+
__exportStar(require("./api/content/types"), exports);
|
|
45
46
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA+B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA+B;AActB,uFAdA,YAAM,OAcA;AAbf,yDAAwE;AAa7C,+FAblB,iCAAc,OAakB;AAZzC,+CAA2C;AAY1B,yFAZR,oBAAQ,OAYQ;AAXzB,kDAAoC;AAW2B,4BAAQ;AATvE,uDAAqC;AACrC,oDAAkC;AAClC,mDAAiC;AACjC,kDAAgC;AAChC,+DAA6C;AAC7C,oDAAkC;AAClC,sDAAoC;AACpC,sDAAoC"}
|
package/dist/utils/cache.d.ts
CHANGED