@or-sdk/tickets 1.0.1-322.0 → 1.0.1-326.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/dist/cjs/Tickets.js +22 -0
- package/dist/cjs/Tickets.js.map +1 -1
- package/dist/esm/Tickets.js +18 -0
- package/dist/esm/Tickets.js.map +1 -1
- package/dist/types/Tickets.d.ts +4 -2
- package/dist/types/types.d.ts +38 -0
- package/package.json +1 -1
- package/src/Tickets.ts +41 -2
- package/src/types.ts +41 -6
package/dist/cjs/Tickets.js
CHANGED
|
@@ -75,6 +75,28 @@ var Tickets = (function (_super) {
|
|
|
75
75
|
});
|
|
76
76
|
});
|
|
77
77
|
};
|
|
78
|
+
Tickets.prototype.getTypes = function (query) {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
80
|
+
return __generator(this, function (_a) {
|
|
81
|
+
return [2, this.callApi({
|
|
82
|
+
method: 'get',
|
|
83
|
+
route: '/types',
|
|
84
|
+
params: query,
|
|
85
|
+
})];
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
Tickets.prototype.updateType = function (id, data) {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
91
|
+
return __generator(this, function (_a) {
|
|
92
|
+
return [2, this.callApi({
|
|
93
|
+
method: 'put',
|
|
94
|
+
route: "/types/".concat(id),
|
|
95
|
+
data: data,
|
|
96
|
+
})];
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
};
|
|
78
100
|
return Tickets;
|
|
79
101
|
}(base_1.Base));
|
|
80
102
|
exports.Tickets = Tickets;
|
package/dist/cjs/Tickets.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tickets.js","sourceRoot":"","sources":["../../src/Tickets.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAoC;
|
|
1
|
+
{"version":3,"file":"Tickets.js","sourceRoot":"","sources":["../../src/Tickets.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAoC;AASpC,yCAA0C;AAS1C;IAA6B,2BAAI;IAO/B,iBAAY,MAAqB;QACvB,IAAA,KAAK,GAAiB,MAAM,MAAvB,EAAE,UAAU,GAAK,MAAM,WAAX,CAAY;eAErC,kBAAM;YACJ,KAAK,OAAA;YACL,UAAU,YAAA;YACV,UAAU,EAAE,uBAAW;SACxB,CAAC;IACJ,CAAC;IAOK,4BAAU,GAAhB,UAAiB,IAAuB;;;gBACtC,WAAO,IAAI,CAAC,OAAO,CAAC;wBAClB,MAAM,EAAE,MAAM;wBACd,KAAK,EAAE,QAAQ;wBACf,IAAI,MAAA;qBACL,CAAC,EAAC;;;KACJ;IAOK,0BAAQ,GAAd,UAAe,KAAuB;;;gBACpC,WAAO,IAAI,CAAC,OAAO,CAAC;wBAClB,MAAM,EAAE,KAAK;wBACb,KAAK,EAAE,QAAQ;wBACf,MAAM,EAAE,KAAK;qBACd,CAAC,EAAC;;;KACJ;IAQK,4BAAU,GAAhB,UAAiB,EAAU,EAAE,IAAuB;;;gBAClD,WAAO,IAAI,CAAC,OAAO,CAAC;wBAClB,MAAM,EAAE,KAAK;wBACb,KAAK,EAAE,iBAAU,EAAE,CAAE;wBACrB,IAAI,MAAA;qBACL,CAAC,EAAC;;;KACJ;IACH,cAAC;AAAD,CAAC,AAxDD,CAA6B,WAAI,GAwDhC;AAxDY,0BAAO"}
|
package/dist/esm/Tickets.js
CHANGED
|
@@ -27,5 +27,23 @@ export class Tickets extends Base {
|
|
|
27
27
|
});
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
+
getTypes(query) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
return this.callApi({
|
|
33
|
+
method: 'get',
|
|
34
|
+
route: '/types',
|
|
35
|
+
params: query,
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
updateType(id, data) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
return this.callApi({
|
|
42
|
+
method: 'put',
|
|
43
|
+
route: `/types/${id}`,
|
|
44
|
+
data,
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}
|
|
30
48
|
}
|
|
31
49
|
//# sourceMappingURL=Tickets.js.map
|
package/dist/esm/Tickets.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tickets.js","sourceRoot":"","sources":["../../src/Tickets.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Tickets.js","sourceRoot":"","sources":["../../src/Tickets.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AASpC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAS1C,MAAM,OAAO,OAAQ,SAAQ,IAAI;IAO/B,YAAY,MAAqB;QAC/B,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QAErC,KAAK,CAAC;YACJ,KAAK;YACL,UAAU;YACV,UAAU,EAAE,WAAW;SACxB,CAAC,CAAC;IACL,CAAC;IAOK,UAAU,CAAC,IAAuB;;YACtC,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,MAAM,EAAE,MAAM;gBACd,KAAK,EAAE,QAAQ;gBACf,IAAI;aACL,CAAC,CAAC;QACL,CAAC;KAAA;IAOK,QAAQ,CAAC,KAAuB;;YACpC,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,KAAK;aACd,CAAC,CAAC;QACL,CAAC;KAAA;IAQK,UAAU,CAAC,EAAU,EAAE,IAAuB;;YAClD,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,UAAU,EAAE,EAAE;gBACrB,IAAI;aACL,CAAC,CAAC;QACL,CAAC;KAAA;CACF"}
|
package/dist/types/Tickets.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Base } from '@or-sdk/base';
|
|
2
|
-
import { CreateTypeOptions, TicketsConfig } from './types';
|
|
2
|
+
import { CreateTypeOptions, FindTypesOptions, TicketsConfig, UpdateTypeOptions, TypeRecordEntity, EntitiesListResponse } from './types';
|
|
3
3
|
export declare class Tickets extends Base {
|
|
4
4
|
constructor(params: TicketsConfig);
|
|
5
|
-
createType(data: CreateTypeOptions): Promise<
|
|
5
|
+
createType(data: CreateTypeOptions): Promise<TypeRecordEntity>;
|
|
6
|
+
getTypes(query: FindTypesOptions): Promise<EntitiesListResponse<TypeRecordEntity>>;
|
|
7
|
+
updateType(id: string, data: UpdateTypeOptions): Promise<TypeRecordEntity>;
|
|
6
8
|
}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -3,6 +3,27 @@ export declare type TicketsConfig = {
|
|
|
3
3
|
token: Token;
|
|
4
4
|
serviceUrl?: string;
|
|
5
5
|
};
|
|
6
|
+
declare type CreatedBy = {
|
|
7
|
+
accountId: string;
|
|
8
|
+
userId?: string;
|
|
9
|
+
flowId?: string;
|
|
10
|
+
};
|
|
11
|
+
export interface EntitiesListResponse<R extends Record<string, any> = Record<string, any>> {
|
|
12
|
+
total: number;
|
|
13
|
+
hits: R[];
|
|
14
|
+
}
|
|
15
|
+
export interface TypeRecordEntity {
|
|
16
|
+
id: string;
|
|
17
|
+
accountId: string;
|
|
18
|
+
label: string;
|
|
19
|
+
settings: Record<string, any>;
|
|
20
|
+
initialData: Record<string, any>;
|
|
21
|
+
createdBy: CreatedBy;
|
|
22
|
+
dateCreated: Date;
|
|
23
|
+
dateModified: Date;
|
|
24
|
+
meta?: Record<string, any>;
|
|
25
|
+
_isDeleted: boolean;
|
|
26
|
+
}
|
|
6
27
|
export declare type CreateLabelOptions = {
|
|
7
28
|
label: string;
|
|
8
29
|
color: string;
|
|
@@ -15,3 +36,20 @@ export declare type CreateTypeOptions = {
|
|
|
15
36
|
initialData: Record<string, any>;
|
|
16
37
|
systemLabels?: Pick<CreateLabelOptions, 'label' | 'color'>[];
|
|
17
38
|
};
|
|
39
|
+
export interface UpdateTypeOptions {
|
|
40
|
+
label?: string;
|
|
41
|
+
settings?: Record<string, any>;
|
|
42
|
+
initialData?: Record<string, any>;
|
|
43
|
+
meta?: Record<string, any>;
|
|
44
|
+
_isDeleted?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface FindTypesOptions {
|
|
47
|
+
accountId?: string | string[];
|
|
48
|
+
projection?: string[];
|
|
49
|
+
from?: number;
|
|
50
|
+
size?: number;
|
|
51
|
+
orderBy?: string;
|
|
52
|
+
sortOrder?: string;
|
|
53
|
+
label?: string;
|
|
54
|
+
}
|
|
55
|
+
export {};
|
package/package.json
CHANGED
package/src/Tickets.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { Base } from '@or-sdk/base';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
CreateTypeOptions,
|
|
4
|
+
FindTypesOptions,
|
|
5
|
+
TicketsConfig,
|
|
6
|
+
UpdateTypeOptions,
|
|
7
|
+
TypeRecordEntity,
|
|
8
|
+
EntitiesListResponse,
|
|
9
|
+
} from './types';
|
|
3
10
|
import { SERVICE_KEY } from './constants';
|
|
4
11
|
|
|
5
12
|
/**
|
|
@@ -26,11 +33,43 @@ export class Tickets extends Base {
|
|
|
26
33
|
});
|
|
27
34
|
}
|
|
28
35
|
|
|
29
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Create a Type
|
|
38
|
+
* @param data has CreateTypeOptions values inside
|
|
39
|
+
* @return Type Entity
|
|
40
|
+
*/
|
|
41
|
+
async createType(data: CreateTypeOptions): Promise<TypeRecordEntity> {
|
|
30
42
|
return this.callApi({
|
|
31
43
|
method: 'post',
|
|
32
44
|
route: '/types',
|
|
33
45
|
data,
|
|
34
46
|
});
|
|
35
47
|
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Get the list of available Types
|
|
51
|
+
* @param query has FindTypesOptions values inside
|
|
52
|
+
* @return Type Entity
|
|
53
|
+
*/
|
|
54
|
+
async getTypes(query: FindTypesOptions): Promise<EntitiesListResponse<TypeRecordEntity>> {
|
|
55
|
+
return this.callApi({
|
|
56
|
+
method: 'get',
|
|
57
|
+
route: '/types',
|
|
58
|
+
params: query,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Update the Type by provided id
|
|
64
|
+
* @param id string;
|
|
65
|
+
* @param data has UpdateTypeOptions values inside
|
|
66
|
+
* @return Type Entity
|
|
67
|
+
*/
|
|
68
|
+
async updateType(id: string, data: UpdateTypeOptions): Promise<TypeRecordEntity> {
|
|
69
|
+
return this.callApi({
|
|
70
|
+
method: 'put',
|
|
71
|
+
route: `/types/${id}`,
|
|
72
|
+
data,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
36
75
|
}
|
package/src/types.ts
CHANGED
|
@@ -1,16 +1,33 @@
|
|
|
1
1
|
import { Token } from '@or-sdk/base';
|
|
2
2
|
|
|
3
3
|
export type TicketsConfig = {
|
|
4
|
-
/**
|
|
5
|
-
* token
|
|
6
|
-
*/
|
|
7
4
|
token: Token;
|
|
8
|
-
/**
|
|
9
|
-
* Direct service url, can be used to avoid discovery api call
|
|
10
|
-
*/
|
|
11
5
|
serviceUrl?: string;
|
|
12
6
|
};
|
|
13
7
|
|
|
8
|
+
type CreatedBy = {
|
|
9
|
+
accountId: string;
|
|
10
|
+
userId?: string;
|
|
11
|
+
flowId?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export interface EntitiesListResponse<R extends Record<string, any> = Record<string, any>> {
|
|
15
|
+
total: number;
|
|
16
|
+
hits: R[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface TypeRecordEntity {
|
|
20
|
+
id: string;
|
|
21
|
+
accountId: string;
|
|
22
|
+
label: string;
|
|
23
|
+
settings: Record<string, any>;
|
|
24
|
+
initialData: Record<string, any>;
|
|
25
|
+
createdBy: CreatedBy;
|
|
26
|
+
dateCreated: Date;
|
|
27
|
+
dateModified: Date;
|
|
28
|
+
meta?: Record<string, any>;
|
|
29
|
+
_isDeleted: boolean;
|
|
30
|
+
}
|
|
14
31
|
|
|
15
32
|
export type CreateLabelOptions = {
|
|
16
33
|
label: string;
|
|
@@ -25,3 +42,21 @@ export type CreateTypeOptions = {
|
|
|
25
42
|
initialData: Record<string, any>;
|
|
26
43
|
systemLabels?: Pick<CreateLabelOptions, 'label' | 'color'>[];
|
|
27
44
|
};
|
|
45
|
+
|
|
46
|
+
export interface UpdateTypeOptions {
|
|
47
|
+
label?: string;
|
|
48
|
+
settings?: Record<string, any>;
|
|
49
|
+
initialData?: Record<string, any>;
|
|
50
|
+
meta?: Record<string, any>;
|
|
51
|
+
_isDeleted?: boolean;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface FindTypesOptions {
|
|
55
|
+
accountId?: string | string[];
|
|
56
|
+
projection?: string[];
|
|
57
|
+
from?: number;
|
|
58
|
+
size?: number;
|
|
59
|
+
orderBy?: string;
|
|
60
|
+
sortOrder?: string;
|
|
61
|
+
label?: string;
|
|
62
|
+
}
|