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 {
239239 try {
240240 // @todo switch on cookie, "X-Session-Token" or client_credentials
241241 const fetchResponse = await fetch ( url , {
242- credentials : 'include' ,
242+ credentials : 'include' , // @todo only required for cookie based auth,
243243 headers : headers ,
244244 } ) ;
245245 let json = await fetchResponse . json ( ) ;
Original file line number Diff line number Diff line change @@ -1049,6 +1049,11 @@ class Scheme extends BaseModel {
10491049 name : "work_orders" ,
10501050 type : "array" ,
10511051 modelType : "work-orders"
1052+ } ,
1053+ {
1054+ name : "template" ,
1055+ type : "single" ,
1056+ modelType : "scheme-templates"
10521057 }
10531058 ] ;
10541059 constructor ( data ) {
@@ -1081,6 +1086,11 @@ class WorkOrder extends BaseModel {
10811086 name : "operations" ,
10821087 type : "array" ,
10831088 modelType : "operations"
1089+ } ,
1090+ {
1091+ name : "template" ,
1092+ type : "single" ,
1093+ modelType : "work-order-templates"
10841094 }
10851095 ] ;
10861096 constructor ( data ) {
@@ -1569,13 +1579,15 @@ class BaseService extends RequestBuilder {
15691579 } ;
15701580 }
15711581 async create ( model , params ) {
1572- if ( params ) { }
1582+ if ( params ) {
1583+ }
15731584 const jsonApiSerializer = new JsonApiSerializer ( this . hydrator . getModelMap ( ) ) ;
15741585 const payload = jsonApiSerializer . buildCreatePayload ( model ) ;
15751586 return await this . client . makePostRequest ( this . endpoint , payload ) ;
15761587 }
15771588 async update ( id , model , params ) {
1578- if ( params ) { }
1589+ if ( params ) {
1590+ }
15791591 const jsonApiSerializer = new JsonApiSerializer ( this . hydrator . getModelMap ( ) ) ;
15801592 const payload = jsonApiSerializer . buildUpdatePayload ( model ) ;
15811593 return await this . client . makePatchRequest ( `${ this . endpoint } /${ id } ` , payload ) ;
@@ -2271,6 +2283,9 @@ class ClientConfig {
22712283}
22722284// src/models/Organisation.ts
22732285class Organisation extends BaseModel {
2286+ constructor ( ) {
2287+ super ( ...arguments ) ;
2288+ }
22742289 type = "organisations" ;
22752290 static relationships = [ ] ;
22762291}
Original file line number Diff line number Diff line change @@ -13,6 +13,11 @@ export class Scheme extends BaseModel {
1313 type : 'array' ,
1414 modelType : 'work-orders' ,
1515 } ,
16+ {
17+ name : 'template' ,
18+ type : 'single' ,
19+ modelType : 'scheme-templates' ,
20+ }
1621 ] ;
1722 constructor ( data ) {
1823 super ( data ) ;
Original file line number Diff line number Diff line change @@ -13,6 +13,11 @@ export class WorkOrder extends BaseModel {
1313 type : 'array' ,
1414 modelType : 'operations' ,
1515 } ,
16+ {
17+ name : 'template' ,
18+ type : 'single' ,
19+ modelType : 'work-order-templates' ,
20+ }
1621 ] ;
1722 constructor ( data ) {
1823 super ( data ) ;
Original file line number Diff line number Diff line change 44 "type" : " git" ,
55 "url" : " https://github.com/ctrl-hub/sdk.ts"
66 },
7- "version" : " 0.1.139 " ,
7+ "version" : " 0.1.140 " ,
88 "main" : " dist/index.js" ,
99 "types" : " dist/index.d.ts" ,
1010 "type" : " module" ,
Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ export class Scheme extends BaseModel {
1818 type : 'array' ,
1919 modelType : 'work-orders' ,
2020 } ,
21+ {
22+ name : 'template' ,
23+ type : 'single' ,
24+ modelType : 'scheme-templates' ,
25+ }
2126 ] ;
2227
2328 constructor ( data ?: any ) {
Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ export class WorkOrder extends BaseModel {
1818 type : 'array' ,
1919 modelType : 'operations' ,
2020 } ,
21+ {
22+ name : 'template' ,
23+ type : 'single' ,
24+ modelType : 'work-order-templates' ,
25+ }
2126 ] ;
2227
2328 constructor ( data ?: any ) {
You can’t perform that action at this time.
0 commit comments