File tree Expand file tree Collapse file tree 7 files changed +39
-4
lines changed Expand file tree Collapse file tree 7 files changed +39
-4
lines changed Original file line number Diff line number Diff line change @@ -239,7 +239,7 @@ export class Client {
239
239
try {
240
240
// @todo switch on cookie, "X-Session-Token" or client_credentials
241
241
const fetchResponse = await fetch ( url , {
242
- credentials : 'include' ,
242
+ credentials : 'include' , // @todo only required for cookie based auth,
243
243
headers : headers ,
244
244
} ) ;
245
245
let json = await fetchResponse . json ( ) ;
Original file line number Diff line number Diff line change @@ -1049,6 +1049,11 @@ class Scheme extends BaseModel {
1049
1049
name : "work_orders" ,
1050
1050
type : "array" ,
1051
1051
modelType : "work-orders"
1052
+ } ,
1053
+ {
1054
+ name : "template" ,
1055
+ type : "single" ,
1056
+ modelType : "scheme-templates"
1052
1057
}
1053
1058
] ;
1054
1059
constructor ( data ) {
@@ -1081,6 +1086,11 @@ class WorkOrder extends BaseModel {
1081
1086
name : "operations" ,
1082
1087
type : "array" ,
1083
1088
modelType : "operations"
1089
+ } ,
1090
+ {
1091
+ name : "template" ,
1092
+ type : "single" ,
1093
+ modelType : "work-order-templates"
1084
1094
}
1085
1095
] ;
1086
1096
constructor ( data ) {
@@ -1569,13 +1579,15 @@ class BaseService extends RequestBuilder {
1569
1579
} ;
1570
1580
}
1571
1581
async create ( model , params ) {
1572
- if ( params ) { }
1582
+ if ( params ) {
1583
+ }
1573
1584
const jsonApiSerializer = new JsonApiSerializer ( this . hydrator . getModelMap ( ) ) ;
1574
1585
const payload = jsonApiSerializer . buildCreatePayload ( model ) ;
1575
1586
return await this . client . makePostRequest ( this . endpoint , payload ) ;
1576
1587
}
1577
1588
async update ( id , model , params ) {
1578
- if ( params ) { }
1589
+ if ( params ) {
1590
+ }
1579
1591
const jsonApiSerializer = new JsonApiSerializer ( this . hydrator . getModelMap ( ) ) ;
1580
1592
const payload = jsonApiSerializer . buildUpdatePayload ( model ) ;
1581
1593
return await this . client . makePatchRequest ( `${ this . endpoint } /${ id } ` , payload ) ;
@@ -2271,6 +2283,9 @@ class ClientConfig {
2271
2283
}
2272
2284
// src/models/Organisation.ts
2273
2285
class Organisation extends BaseModel {
2286
+ constructor ( ) {
2287
+ super ( ...arguments ) ;
2288
+ }
2274
2289
type = "organisations" ;
2275
2290
static relationships = [ ] ;
2276
2291
}
Original file line number Diff line number Diff line change @@ -13,6 +13,11 @@ export class Scheme extends BaseModel {
13
13
type : 'array' ,
14
14
modelType : 'work-orders' ,
15
15
} ,
16
+ {
17
+ name : 'template' ,
18
+ type : 'single' ,
19
+ modelType : 'scheme-templates' ,
20
+ }
16
21
] ;
17
22
constructor ( data ) {
18
23
super ( data ) ;
Original file line number Diff line number Diff line change @@ -13,6 +13,11 @@ export class WorkOrder extends BaseModel {
13
13
type : 'array' ,
14
14
modelType : 'operations' ,
15
15
} ,
16
+ {
17
+ name : 'template' ,
18
+ type : 'single' ,
19
+ modelType : 'work-order-templates' ,
20
+ }
16
21
] ;
17
22
constructor ( data ) {
18
23
super ( data ) ;
Original file line number Diff line number Diff line change 4
4
"type" : " git" ,
5
5
"url" : " https://github.com/ctrl-hub/sdk.ts"
6
6
},
7
- "version" : " 0.1.139 " ,
7
+ "version" : " 0.1.140 " ,
8
8
"main" : " dist/index.js" ,
9
9
"types" : " dist/index.d.ts" ,
10
10
"type" : " module" ,
Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ export class Scheme extends BaseModel {
18
18
type : 'array' ,
19
19
modelType : 'work-orders' ,
20
20
} ,
21
+ {
22
+ name : 'template' ,
23
+ type : 'single' ,
24
+ modelType : 'scheme-templates' ,
25
+ }
21
26
] ;
22
27
23
28
constructor ( data ?: any ) {
Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ export class WorkOrder extends BaseModel {
18
18
type : 'array' ,
19
19
modelType : 'operations' ,
20
20
} ,
21
+ {
22
+ name : 'template' ,
23
+ type : 'single' ,
24
+ modelType : 'work-order-templates' ,
25
+ }
21
26
] ;
22
27
23
28
constructor ( data ?: any ) {
You can’t perform that action at this time.
0 commit comments