Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1045,8 +1045,8 @@ class Scheme extends BaseModel {
name = "";
code = "";
description = "";
start_date = "";
end_date = "";
anticipated_start_date = "";
anticipated_end_date = "";
labels = [];
static relationships = [
{
Expand All @@ -1060,13 +1060,13 @@ class Scheme extends BaseModel {
this.name = data?.attributes?.name ?? data?.name ?? "";
this.code = data?.attributes?.code ?? data?.code ?? "";
this.description = data?.attributes?.description ?? data?.description ?? "";
this.start_date = data?.attributes?.start_date ?? data?.start_date ?? "";
this.end_date = data?.attributes?.end_date ?? data?.end_date ?? "";
this.anticipated_start_date = data?.attributes?.anticipated_start_date ?? data?.anticipated_start_date ?? "";
this.anticipated_end_date = data?.attributes?.anticipated_end_date ?? data?.anticipated_end_date ?? "";
this.labels = data?.attributes?.labels ?? data?.labels ?? [];
}
jsonApiMapping() {
return {
attributes: ["name", "code", "description", "start_date", "end_date", "labels"]
attributes: ["name", "code", "description", "anticipated_start_date", "anticipated_end_date", "labels"]
};
}
}
Expand All @@ -1077,8 +1077,8 @@ class WorkOrder extends BaseModel {
name = "";
code = "";
description = "";
start_date = "";
end_date = "";
anticipated_start_date = "";
anticipated_end_date = "";
labels = [];
static relationships = [
{
Expand All @@ -1092,13 +1092,13 @@ class WorkOrder extends BaseModel {
this.name = data?.attributes?.name ?? data?.name ?? "";
this.code = data?.attributes?.code ?? data?.code ?? "";
this.description = data?.attributes?.description ?? data?.description ?? "";
this.start_date = data?.attributes?.start_date ?? data?.start_date ?? "";
this.end_date = data?.attributes?.end_date ?? data?.end_date ?? "";
this.anticipated_start_date = data?.attributes?.anticipated_start_date ?? data?.anticipated_start_date ?? "";
this.anticipated_end_date = data?.attributes?.anticipated_end_date ?? data?.anticipated_end_date ?? "";
this.labels = data?.attributes?.labels ?? data?.labels ?? [];
}
jsonApiMapping() {
return {
attributes: ["name", "code", "description", "start_date", "end_date", "labels"]
attributes: ["name", "code", "description", "anticipated_start_date", "anticipated_end_date", "labels"]
};
}
}
Expand Down Expand Up @@ -1501,13 +1501,15 @@ class BaseService extends RequestBuilder {
};
}
async create(model, params) {
if (params) {}
if (params) {
}
const jsonApiSerializer = new JsonApiSerializer(this.hydrator.getModelMap());
const payload = jsonApiSerializer.buildCreatePayload(model);
return await this.client.makePostRequest(this.endpoint, payload);
}
async update(id, model, params) {
if (params) {}
if (params) {
}
const jsonApiSerializer = new JsonApiSerializer(this.hydrator.getModelMap());
const payload = jsonApiSerializer.buildUpdatePayload(model);
return await this.client.makePatchRequest(`${this.endpoint}/${id}`, payload);
Expand Down Expand Up @@ -2160,6 +2162,9 @@ class ClientConfig {
}
// src/models/Organisation.ts
class Organisation extends BaseModel {
constructor() {
super(...arguments);
}
type = "organisations";
static relationships = [];
}
Expand Down
4 changes: 2 additions & 2 deletions dist/models/Scheme.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export declare class Scheme extends BaseModel {
name: string;
code: string;
description: string;
start_date: string;
end_date: string;
anticipated_start_date: string;
anticipated_end_date: string;
labels: Array<Label>;
static relationships: RelationshipDefinition[];
constructor(data?: any);
Expand Down
10 changes: 5 additions & 5 deletions dist/models/Scheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export class Scheme extends BaseModel {
name = '';
code = '';
description = '';
start_date = '';
end_date = '';
anticipated_start_date = '';
anticipated_end_date = '';
labels = [];
static relationships = [
{
Expand All @@ -19,13 +19,13 @@ export class Scheme extends BaseModel {
this.name = data?.attributes?.name ?? data?.name ?? '';
this.code = data?.attributes?.code ?? data?.code ?? '';
this.description = data?.attributes?.description ?? data?.description ?? '';
this.start_date = data?.attributes?.start_date ?? data?.start_date ?? '';
this.end_date = data?.attributes?.end_date ?? data?.end_date ?? '';
this.anticipated_start_date = data?.attributes?.anticipated_start_date ?? data?.anticipated_start_date ?? '';
this.anticipated_end_date = data?.attributes?.anticipated_end_date ?? data?.anticipated_end_date ?? '';
this.labels = data?.attributes?.labels ?? data?.labels ?? [];
}
jsonApiMapping() {
return {
attributes: ['name', 'code', 'description', 'start_date', 'end_date', 'labels'],
attributes: ['name', 'code', 'description', 'anticipated_start_date', 'anticipated_end_date', 'labels'],
};
}
}
4 changes: 2 additions & 2 deletions dist/models/WorkOrder.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export declare class WorkOrder extends BaseModel {
name: string;
code: string;
description: string;
start_date: string;
end_date: string;
anticipated_start_date: string;
anticipated_end_date: string;
labels: Array<Label>;
static relationships: RelationshipDefinition[];
constructor(data?: any);
Expand Down
10 changes: 5 additions & 5 deletions dist/models/WorkOrder.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export class WorkOrder extends BaseModel {
name = '';
code = '';
description = '';
start_date = '';
end_date = '';
anticipated_start_date = '';
anticipated_end_date = '';
labels = [];
static relationships = [
{
Expand All @@ -19,13 +19,13 @@ export class WorkOrder extends BaseModel {
this.name = data?.attributes?.name ?? data?.name ?? '';
this.code = data?.attributes?.code ?? data?.code ?? '';
this.description = data?.attributes?.description ?? data?.description ?? '';
this.start_date = data?.attributes?.start_date ?? data?.start_date ?? '';
this.end_date = data?.attributes?.end_date ?? data?.end_date ?? '';
this.anticipated_start_date = data?.attributes?.anticipated_start_date ?? data?.anticipated_start_date ?? '';
this.anticipated_end_date = data?.attributes?.anticipated_end_date ?? data?.anticipated_end_date ?? '';
this.labels = data?.attributes?.labels ?? data?.labels ?? [];
}
jsonApiMapping() {
return {
attributes: ['name', 'code', 'description', 'start_date', 'end_date', 'labels'],
attributes: ['name', 'code', 'description', 'anticipated_start_date', 'anticipated_end_date', 'labels'],
};
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "git",
"url": "https://github.com/ctrl-hub/sdk.ts"
},
"version": "0.1.131",
"version": "0.1.132",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
Expand Down
10 changes: 5 additions & 5 deletions src/models/Scheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export class Scheme extends BaseModel {
public name: string = '';
public code: string = '';
public description: string = '';
public start_date: string = '';
public end_date: string = '';
public anticipated_start_date: string = '';
public anticipated_end_date: string = '';
public labels: Array<Label> = [];

static relationships: RelationshipDefinition[] = [
Expand All @@ -25,14 +25,14 @@ export class Scheme extends BaseModel {
this.name = data?.attributes?.name ?? data?.name ?? '';
this.code = data?.attributes?.code ?? data?.code ?? '';
this.description = data?.attributes?.description ?? data?.description ?? '';
this.start_date = data?.attributes?.start_date ?? data?.start_date ?? '';
this.end_date = data?.attributes?.end_date ?? data?.end_date ?? '';
this.anticipated_start_date = data?.attributes?.anticipated_start_date ?? data?.anticipated_start_date ?? '';
this.anticipated_end_date = data?.attributes?.anticipated_end_date ?? data?.anticipated_end_date ?? '';
this.labels = data?.attributes?.labels ?? data?.labels ?? [];
}

jsonApiMapping() {
return {
attributes: ['name', 'code', 'description', 'start_date', 'end_date', 'labels'],
attributes: ['name', 'code', 'description', 'anticipated_start_date', 'anticipated_end_date', 'labels'],
};
}
}
10 changes: 5 additions & 5 deletions src/models/WorkOrder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export class WorkOrder extends BaseModel {
public name: string = '';
public code: string = '';
public description: string = '';
public start_date: string = '';
public end_date: string = '';
public anticipated_start_date: string = '';
public anticipated_end_date: string = '';
public labels: Array<Label> = [];

static relationships: RelationshipDefinition[] = [
Expand All @@ -25,14 +25,14 @@ export class WorkOrder extends BaseModel {
this.name = data?.attributes?.name ?? data?.name ?? '';
this.code = data?.attributes?.code ?? data?.code ?? '';
this.description = data?.attributes?.description ?? data?.description ?? '';
this.start_date = data?.attributes?.start_date ?? data?.start_date ?? '';
this.end_date = data?.attributes?.end_date ?? data?.end_date ?? '';
this.anticipated_start_date = data?.attributes?.anticipated_start_date ?? data?.anticipated_start_date ?? '';
this.anticipated_end_date = data?.attributes?.anticipated_end_date ?? data?.anticipated_end_date ?? '';
this.labels = data?.attributes?.labels ?? data?.labels ?? [];
}

jsonApiMapping() {
return {
attributes: ['name', 'code', 'description', 'start_date', 'end_date', 'labels'],
attributes: ['name', 'code', 'description', 'anticipated_start_date', 'anticipated_end_date', 'labels'],
};
}
}