@edraj/tsdmart 1.0.7 → 1.0.9

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/.idea/modules.xml CHANGED
File without changes
package/.idea/tsdmart.iml CHANGED
File without changes
package/.idea/vcs.xml CHANGED
File without changes
package/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- ## 1.0.7
1
+ ## 1.0.8
2
2
 
3
3
  - Implementing DMART apis up to 1.1.12
4
4
 
package/index.ts CHANGED
@@ -8,7 +8,7 @@ export enum Status {
8
8
  failed = "failed",
9
9
  }
10
10
 
11
- type Error = {
11
+ export type Error = {
12
12
  type: string;
13
13
  code: number;
14
14
  message: string;
@@ -29,19 +29,19 @@ export type ApiResponse = {
29
29
  records: Array<ApiResponseRecord>;
30
30
  };
31
31
 
32
- type Translation = {
32
+ export type Translation = {
33
33
  ar: string;
34
34
  en: string;
35
35
  kd: string;
36
36
  };
37
37
 
38
- enum UserType {
38
+ export enum UserType {
39
39
  web = "web",
40
40
  mobile = "mobile",
41
41
  bot = "bot",
42
42
  }
43
43
 
44
- type LoginResponseRecord = ApiResponseRecord & {
44
+ export type LoginResponseRecord = ApiResponseRecord & {
45
45
  attributes: {
46
46
  access_token: string;
47
47
  type: UserType;
@@ -51,14 +51,14 @@ type LoginResponseRecord = ApiResponseRecord & {
51
51
 
52
52
  // type LoginResponse = ApiResponse & { records : Array<LoginResponseRecord> };
53
53
 
54
- type Permission = {
54
+ export type Permission = {
55
55
  allowed_actions: Array<ActionType>;
56
56
  conditions: Array<string>;
57
57
  restricted_fields: Array<any>;
58
58
  allowed_fields_values: Map<string, any>;
59
59
  };
60
60
 
61
- enum Language {
61
+ export enum Language {
62
62
  arabic = "arabic",
63
63
  english = "engligh",
64
64
  kurdish = "kurdish",
@@ -66,7 +66,7 @@ enum Language {
66
66
  turkish = "turkish",
67
67
  }
68
68
 
69
- type ProfileResponseRecord = ApiResponseRecord & {
69
+ export type ProfileResponseRecord = ApiResponseRecord & {
70
70
  attributes: {
71
71
  email: string;
72
72
  displayname: Translation;
@@ -233,7 +233,7 @@ export enum ContentTypeMedia {
233
233
  video = "video",
234
234
  }
235
235
 
236
- type Payload = {
236
+ export type Payload = {
237
237
  content_type: ContentType;
238
238
  schema_shortname?: string;
239
239
  checksum: string;
@@ -242,7 +242,7 @@ type Payload = {
242
242
  validation_status: "valid" | "invalid";
243
243
  };
244
244
 
245
- type MetaExtended = {
245
+ export type MetaExtended = {
246
246
  email: string;
247
247
  msisdn: string;
248
248
  is_email_verified: boolean;
@@ -300,7 +300,7 @@ export type ActionResponse = ApiResponse & {
300
300
  >;
301
301
  };
302
302
 
303
- type ActionRequestRecord = {
303
+ export type ActionRequestRecord = {
304
304
  resource_type: ResourceType;
305
305
  uuid?: string;
306
306
  shortname: string;
@@ -316,7 +316,7 @@ export type ActionRequest = {
316
316
  };
317
317
 
318
318
 
319
- type ApiQueryResponse = ApiResponse & {
319
+ export type ApiQueryResponse = ApiResponse & {
320
320
  attributes: { total: number; returned: number };
321
321
  };
322
322
 
@@ -539,8 +539,8 @@ export default class Dmart {
539
539
 
540
540
 
541
541
  public static async fetchDataAsset(
542
- resourceType: string, // Replace with actual type if needed
543
- dataAssetType: string, // Replace with actual type if needed
542
+ resourceType: string,
543
+ dataAssetType: string,
544
544
  spaceName: string,
545
545
  subpath: string,
546
546
  shortname: string,
@@ -605,14 +605,14 @@ export default class Dmart {
605
605
  subpath: string,
606
606
  parent_shortname: string,
607
607
  shortname: string,
608
- ext: string,
608
+ ext: string|null = null,
609
609
  scope: string = "managed"
610
610
  ) {
611
611
  return (
612
612
  `${this.baseURL}/${scope}/payload/${resource_type}/${space_name}/${subpath.replace(
613
613
  /\/+$/,
614
614
  ""
615
- )}/${parent_shortname}/${shortname}.${ext}`.replaceAll("..", ".")
615
+ )}/${parent_shortname}/${shortname}${ext===null?"":ext}`
616
616
  );
617
617
  }
618
618
 
@@ -700,7 +700,7 @@ export default class Dmart {
700
700
  spaceName: string,
701
701
  schemaShortname: string,
702
702
  subpath: string,
703
- record: any // More general than Map<String, dynamic>
703
+ record: any
704
704
  ) {
705
705
  try {
706
706
  const {data} = await axios.post(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edraj/tsdmart",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "A TypeScript implementation of the Dmart that depends on axios.",
5
5
  "author": "Kefah T. Issa",
6
6
  "email": "kefah.issa@gmail.com",