@code.store/arcxp-sdk-ts 3.0.1 → 4.0.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.
@@ -76,7 +76,7 @@ export type PostANSParams = {
76
76
  };
77
77
  export type GetANSParams = {
78
78
  ansId: string;
79
- ansType: string;
79
+ ansType: ANSType;
80
80
  };
81
81
  export declare enum ANSType {
82
82
  Story = "story",
@@ -109,7 +109,7 @@ export type SummaryRecord = {
109
109
  sourceLocation: string;
110
110
  sourceAdditionalProperties: string;
111
111
  ansId: string;
112
- ansType: string;
112
+ ansType: ANSType;
113
113
  ansLocation: string;
114
114
  status: MigrationStatus;
115
115
  website: string;
@@ -142,7 +142,7 @@ export type DetailReportRequest = {
142
142
  sourceId?: string;
143
143
  sourceType?: string;
144
144
  ansId?: string;
145
- ansType?: string;
145
+ ansType?: ANSType;
146
146
  version?: string;
147
147
  documentType?: string;
148
148
  };
@@ -1,6 +1,6 @@
1
1
  import { ArcAbstractAPI, ArcAPIOptions } from '../abstract-api';
2
- import { MigrateBatchResponse } from './types';
2
+ import { MigrateBatchSubscriptionsPayload, MigrateBatchSubscriptionsResponse } from './types';
3
3
  export declare class ArcSales extends ArcAbstractAPI {
4
4
  constructor(options: ArcAPIOptions);
5
- migrate(filePath: string): Promise<MigrateBatchResponse>;
5
+ migrate(payload: MigrateBatchSubscriptionsPayload): Promise<MigrateBatchSubscriptionsResponse>;
6
6
  }
@@ -4,19 +4,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ArcSales = void 0;
7
- const promises_1 = require("fs/promises");
8
7
  const abstract_api_1 = require("../abstract-api");
9
8
  const form_data_1 = __importDefault(require("form-data"));
10
9
  class ArcSales extends abstract_api_1.ArcAbstractAPI {
11
10
  constructor(options) {
12
11
  super({ ...options, apiPath: 'sales/api/v1' });
13
12
  }
14
- async migrate(filePath) {
13
+ async migrate(payload) {
15
14
  const form = new form_data_1.default();
16
- const file = await (0, promises_1.readFile)(filePath);
17
- form.append('file', file, { filename: 'subs.json' });
15
+ form.append('file', JSON.stringify(payload), { filename: 'subs.json', contentType: 'application/json' });
18
16
  const { data } = await this.client.post('/migrate', form, {
19
- headers: { ...form.getHeaders() },
17
+ headers: {
18
+ ...form.getHeaders(),
19
+ },
20
20
  });
21
21
  return data;
22
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/sales/index.ts"],"names":[],"mappings":";;;;;;AAAA,0CAAuC;AACvC,kDAAgE;AAChE,0DAAiC;AAGjC,MAAa,QAAS,SAAQ,6BAAc;IAC1C,YAAY,OAAsB;QAChC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,QAAgB;QAC5B,MAAM,IAAI,GAAG,IAAI,mBAAQ,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,MAAM,IAAA,mBAAQ,EAAC,QAAQ,CAAC,CAAC;QACtC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC;QAErD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAuB,UAAU,EAAE,IAAI,EAAE;YAC9E,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC,UAAU,EAAE,EAAE;SAClC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAhBD,4BAgBC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/sales/index.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAgE;AAChE,0DAAiC;AAGjC,MAAa,QAAS,SAAQ,6BAAc;IAC1C,YAAY,OAAsB;QAChC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAAyC;QACrD,MAAM,IAAI,GAAG,IAAI,mBAAQ,EAAE,CAAC;QAC5B,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC,CAAC;QAEzG,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAoC,UAAU,EAAE,IAAI,EAAE;YAC3F,OAAO,EAAE;gBACP,GAAG,IAAI,CAAC,UAAU,EAAE;aACrB;SACF,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAjBD,4BAiBC"}
@@ -1,7 +1,11 @@
1
- export type BatchSubscriptionMigrate = {
1
+ export type MigrateBatchSubscriptionsPayload = {
2
2
  subscriptions: (PaidSubscription | FreeSubscription)[];
3
3
  payments: PaymentInfo[];
4
4
  };
5
+ export type MigrateBatchSubscriptionsResponse = {
6
+ subscriptionsInBatch?: number;
7
+ batchID?: string;
8
+ };
5
9
  interface BaseSubscription {
6
10
  type: string;
7
11
  legacyID: string;
@@ -61,8 +65,4 @@ export type Refund = {
61
65
  tax: number;
62
66
  providerReference?: string;
63
67
  };
64
- export type MigrateBatchResponse = {
65
- subscriptionsInBatch?: number;
66
- batchID?: string;
67
- };
68
68
  export {};
@@ -1,6 +1,7 @@
1
1
  import { ArcAbstractAPI, ArcAPIOptions } from '../abstract-api';
2
- import { ReportStatusChangePayload } from './types';
2
+ import { CreateTaskPayload, CreateTaskResponse, ReportStatusChangePayload } from './types';
3
3
  export declare class ArcWebsked extends ArcAbstractAPI {
4
4
  constructor(options: ArcAPIOptions);
5
- reportStatusChange(payload: ReportStatusChangePayload): Promise<any>;
5
+ reportStatusChange(payload: ReportStatusChangePayload): Promise<void>;
6
+ createTask(payload: CreateTaskPayload): Promise<CreateTaskResponse>;
6
7
  }
@@ -10,6 +10,10 @@ class ArcWebsked extends abstract_api_1.ArcAbstractAPI {
10
10
  const { data } = await this.client.post('/tasks/workflowStatusChange', payload);
11
11
  return data;
12
12
  }
13
+ async createTask(payload) {
14
+ const { data } = await this.client.post('/tasks', payload);
15
+ return data;
16
+ }
13
17
  }
14
18
  exports.ArcWebsked = ArcWebsked;
15
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/websked/index.ts"],"names":[],"mappings":";;;AAAA,kDAAgE;AAGhE,MAAa,UAAW,SAAQ,6BAAc;IAC5C,YAAY,OAAsB;QAChC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,OAAkC;QACzD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,6BAA6B,EAAE,OAAO,CAAC,CAAC;QAChF,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AATD,gCASC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/websked/index.ts"],"names":[],"mappings":";;;AAAA,kDAAgE;AAGhE,MAAa,UAAW,SAAQ,6BAAc;IAC5C,YAAY,OAAsB;QAChC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,OAAkC;QACzD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAO,6BAA6B,EAAE,OAAO,CAAC,CAAC;QACtF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,OAA0B;QACzC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC3D,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAdD,gCAcC"}
@@ -5,3 +5,56 @@ export type ReportStatusChangePayload = {
5
5
  newWorkflowStatus: number;
6
6
  note: string;
7
7
  };
8
+ export type WebskedEvent = {
9
+ priority: number;
10
+ startDate?: number;
11
+ deadline?: number;
12
+ assignedGroup?: string;
13
+ assignedUser?: string;
14
+ datetime: number;
15
+ user: object;
16
+ note: string;
17
+ status: number;
18
+ customFields: Record<string, {
19
+ value: string;
20
+ }>;
21
+ };
22
+ export type CreateTaskResponse = {
23
+ id: string;
24
+ storyID: string;
25
+ type: number;
26
+ createdDate: number;
27
+ events: WebskedEvent[];
28
+ latestEvent: WebskedEvent;
29
+ creationEvent: WebskedEvent;
30
+ taskTemplateId: string | null;
31
+ website: string;
32
+ authoringApp: string;
33
+ startDate: number;
34
+ content: {
35
+ type: 'ans';
36
+ contentId: string;
37
+ versionId: null;
38
+ };
39
+ };
40
+ export type CreateTaskPayload = {
41
+ priority: number;
42
+ startDate?: number;
43
+ deadline?: number;
44
+ assignedGroup: string;
45
+ note: string;
46
+ status: number;
47
+ customFields: {
48
+ sourceId: {
49
+ value: string;
50
+ };
51
+ };
52
+ type: number;
53
+ storyID: string;
54
+ content: {
55
+ type: 'ans';
56
+ contentId: string;
57
+ };
58
+ website: string;
59
+ authoringApp: string;
60
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code.store/arcxp-sdk-ts",
3
- "version": "3.0.1",
3
+ "version": "4.0.0",
4
4
  "description": "",
5
5
  "type": "commonjs",
6
6
  "main": "./dist/index.js",
@@ -25,6 +25,8 @@
25
25
  "author": "code.store",
26
26
  "license": "MIT",
27
27
  "dependencies": {
28
+ "@changesets/changelog-github": "^0.4.8",
29
+ "@changesets/cli": "^2.26.2",
28
30
  "axios": "^1.4.0",
29
31
  "axios-rate-limit": "^1.3.0",
30
32
  "form-data": "^4.0.0",