@ptkl/sdk 0.9.12 → 0.9.15

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.
@@ -1,11 +1,69 @@
1
1
  import PlatformBaseClient from "./platformBaseClient";
2
- import { UserClaims, UserModel } from "../types/users";
2
+ import { UserClaims, UserModel, Role, CreateRoleRequest, EditRoleRequest, RoleModel, Permission } from "../types/users";
3
3
  import { AxiosResponse } from "axios";
4
4
  export default class Users extends PlatformBaseClient {
5
- invite(email: string, roles: string[]): Promise<AxiosResponse<any, any>>;
6
- getClaims(): Promise<AxiosResponse<UserClaims>>;
5
+ auth(username: string, password: string, project: string): Promise<AxiosResponse<any>>;
6
+ /**
7
+ * Resend confirmation email
8
+ * @param email User email
9
+ */
10
+ resendConfirmationEmail(email: string): Promise<AxiosResponse<any>>;
11
+ /**
12
+ * Request password reset email
13
+ * This only sends an email with a reset link, does not expose or change passwords
14
+ * @param email User email
15
+ */
16
+ requestPasswordReset(email: string): Promise<AxiosResponse<any>>;
17
+ /**
18
+ * Get current user's model
19
+ */
7
20
  getUser(): Promise<AxiosResponse<UserModel>>;
8
- delete(uuid: string): Promise<AxiosResponse<any, any>>;
9
- permissions(): Promise<AxiosResponse<any, any>>;
10
- auth(username: string, password: string, project: string): Promise<AxiosResponse<any, any>>;
21
+ /**
22
+ * Get current user's claims
23
+ */
24
+ getClaims(): Promise<AxiosResponse<UserClaims>>;
25
+ /**
26
+ * Edit user profile
27
+ * @param data Profile update data
28
+ */
29
+ editProfile(data: any): Promise<AxiosResponse<any>>;
30
+ /**
31
+ * Get user permissions
32
+ */
33
+ getPermissions(): Promise<AxiosResponse<Permission[]>>;
34
+ /**
35
+ * Get list of available permissions
36
+ */
37
+ listPermissions(): Promise<AxiosResponse<Permission[]>>;
38
+ /**
39
+ * Create a new role
40
+ * @param role Role data including name, permissions, workspaces, and level
41
+ */
42
+ createRole(role: CreateRoleRequest): Promise<AxiosResponse<Role>>;
43
+ /**
44
+ * Delete a role
45
+ * @param uuid Role UUID
46
+ */
47
+ deleteRole(uuid: string): Promise<AxiosResponse<{
48
+ status: boolean;
49
+ }>>;
50
+ /**
51
+ * List all roles
52
+ */
53
+ listRoles(): Promise<AxiosResponse<Role[]>>;
54
+ /**
55
+ * Get role details by UUID
56
+ * @param uuid Role UUID
57
+ */
58
+ getRoleModel(uuid: string): Promise<AxiosResponse<RoleModel>>;
59
+ /**
60
+ * Edit a role
61
+ * @param uuid Role UUID
62
+ * @param data Role update data including permissions, workspaces, and level
63
+ */
64
+ editRole(uuid: string, data: EditRoleRequest): Promise<AxiosResponse<Role>>;
65
+ /**
66
+ * @deprecated Use getPermissions() instead
67
+ */
68
+ permissions(): Promise<AxiosResponse<any>>;
11
69
  }
@@ -7,7 +7,6 @@ export { default as System } from './api/system';
7
7
  export { default as User } from './api/users';
8
8
  export { default as Functions } from './api/functions';
9
9
  export { default as APIUser } from './api/apiUser';
10
- export { default as Roles } from './api/roles';
11
10
  export { default as Apps } from './api/apps';
12
11
  export { default as Workflow } from './api/workflow';
13
12
  export { default as ComponentUtils } from './api/componentUtils';
@@ -19,7 +18,11 @@ export { default as Invoicing } from './api/integrations/invoicing';
19
18
  export { default as DMS } from './api/integrations/dms';
20
19
  export { default as SerbiaUtil } from './api/integrations/serbiaUtil';
21
20
  export { default as VPFR } from './api/integrations/vpfr';
21
+ export { default as Project } from './api/project';
22
+ export { default as Config } from './api/config';
22
23
  export type * from './types/component';
23
24
  export type * from './types/integrations';
24
25
  export type * from './types/users';
26
+ export type * from './types/project';
27
+ export type * from './types/config';
25
28
  export default Platform;
@@ -0,0 +1,11 @@
1
+ export interface UserConfig {
2
+ uuid?: string;
3
+ user_uuid: string;
4
+ data: Record<string, any>;
5
+ created_at?: string;
6
+ updated_at?: string;
7
+ }
8
+ export interface ConfigUpdateRequest {
9
+ data: Record<string, any>;
10
+ path: string;
11
+ }
@@ -136,3 +136,15 @@ export type ConversionOptions = {
136
136
  sheet_name?: string; /** Specify order of fields/columns */
137
137
  field_order?: string[];
138
138
  };
139
+ export type NbsIpsQrCode = {
140
+ TransactionType: string;
141
+ Version: string;
142
+ CharacterSet: string;
143
+ RecipientAccountNumber: string;
144
+ RecipientName: string;
145
+ AmountInLocalCurrency: string;
146
+ PayerInformation: string;
147
+ PaymentPurposeCode: string;
148
+ PurposeOfPayment: string;
149
+ PaymentOrderNumber: string;
150
+ };
@@ -0,0 +1,103 @@
1
+ export interface MediaLibrary {
2
+ uuid: string;
3
+ ref: string;
4
+ name: string;
5
+ description?: string;
6
+ type?: string;
7
+ project_uuid: string;
8
+ workspace_uuid?: string;
9
+ created_at: string;
10
+ updated_at: string;
11
+ settings?: MediaLibrarySettings;
12
+ }
13
+ export interface MediaLibrarySettings {
14
+ max_file_size?: number;
15
+ allowed_types?: string[];
16
+ public?: boolean;
17
+ [key: string]: any;
18
+ }
19
+ export interface MediaFile {
20
+ uuid: string;
21
+ key: string;
22
+ name: string;
23
+ path: string;
24
+ size: number;
25
+ mime_type: string;
26
+ library_uuid: string;
27
+ created_at: string;
28
+ updated_at: string;
29
+ metadata?: MediaFileMetadata;
30
+ is_directory?: boolean;
31
+ }
32
+ export interface MediaFileMetadata {
33
+ width?: number;
34
+ height?: number;
35
+ duration?: number;
36
+ [key: string]: any;
37
+ }
38
+ export interface MediaListRequest {
39
+ library_uuid?: string;
40
+ library_ref?: string;
41
+ path?: string;
42
+ page?: number;
43
+ limit?: number;
44
+ search?: string;
45
+ mime_type?: string;
46
+ }
47
+ export interface MediaListResponse {
48
+ files: MediaFile[];
49
+ total: number;
50
+ page: number;
51
+ limit: number;
52
+ }
53
+ export interface MediaUploadRequest {
54
+ library_uuid?: string;
55
+ library_ref?: string;
56
+ path?: string;
57
+ file: File | Blob;
58
+ name?: string;
59
+ metadata?: Record<string, any>;
60
+ }
61
+ export interface MediaDownloadRequest {
62
+ keys: string[];
63
+ zip?: boolean;
64
+ }
65
+ export interface MediaShareRequest {
66
+ keys: string[];
67
+ expires_in?: number;
68
+ password?: string;
69
+ }
70
+ export interface MediaShareResponse {
71
+ url: string;
72
+ expires_at?: string;
73
+ token?: string;
74
+ }
75
+ export interface MediaDirectory {
76
+ name: string;
77
+ path: string;
78
+ }
79
+ export interface MediaMoveRequest {
80
+ keys: string[];
81
+ destination: string;
82
+ }
83
+ export interface MediaDeleteRequest {
84
+ keys: string[];
85
+ }
86
+ export interface ExifData {
87
+ [key: string]: any;
88
+ }
89
+ export interface Html2PdfRequest {
90
+ html: string;
91
+ options?: {
92
+ format?: "A4" | "Letter" | string;
93
+ orientation?: "portrait" | "landscape";
94
+ margin?: {
95
+ top?: string;
96
+ right?: string;
97
+ bottom?: string;
98
+ left?: string;
99
+ };
100
+ [key: string]: any;
101
+ };
102
+ output_path?: string;
103
+ }
@@ -0,0 +1,64 @@
1
+ export interface ProjectModel {
2
+ uuid: string;
3
+ name: string;
4
+ description?: string;
5
+ created_at: string;
6
+ updated_at: string;
7
+ deleted_at?: string | null;
8
+ owner_uuid: string;
9
+ archived: boolean;
10
+ settings?: ProjectSettings;
11
+ }
12
+ export interface ProjectSettings {
13
+ [key: string]: any;
14
+ }
15
+ export interface ProjectUser {
16
+ uuid: string;
17
+ name: string;
18
+ email: string;
19
+ roles: string[];
20
+ created_at: string;
21
+ }
22
+ export interface ProjectInvite {
23
+ uuid: string;
24
+ email: string;
25
+ roles: string[];
26
+ status: string;
27
+ created_at: string;
28
+ expires_at: string;
29
+ project_uuid: string;
30
+ }
31
+ export interface Workspace {
32
+ uuid: string;
33
+ name: string;
34
+ description?: string;
35
+ project_uuid: string;
36
+ created_at: string;
37
+ updated_at: string;
38
+ deleted_at?: string | null;
39
+ }
40
+ export interface Template {
41
+ id: string;
42
+ name: string;
43
+ description?: string;
44
+ version: string;
45
+ category?: string;
46
+ tags?: string[];
47
+ author?: string;
48
+ created_at?: string;
49
+ updated_at?: string;
50
+ }
51
+ export interface TemplateInstallation {
52
+ template_id: string;
53
+ workspace_uuid: string;
54
+ version?: string;
55
+ config?: Record<string, any>;
56
+ }
57
+ export interface Transaction {
58
+ uuid: string;
59
+ type: string;
60
+ amount: number;
61
+ status: string;
62
+ created_at: string;
63
+ metadata?: Record<string, any>;
64
+ }
@@ -32,3 +32,35 @@ export interface UserClaims {
32
32
  Version: string;
33
33
  exp: number;
34
34
  }
35
+ export interface Role {
36
+ uuid: string;
37
+ CreatedAt: string;
38
+ UpdatedAt: string;
39
+ DeletedAt: string | null;
40
+ name: string;
41
+ level: number;
42
+ project_uuid: string;
43
+ is_admin: boolean;
44
+ }
45
+ export interface EditRoleRequest {
46
+ permissions: string[];
47
+ workspaces: string[];
48
+ level: number;
49
+ }
50
+ export interface CreateRoleRequest extends EditRoleRequest {
51
+ name: string;
52
+ }
53
+ export interface RoleModel {
54
+ name: string;
55
+ permissions: string[];
56
+ workspaces: string[];
57
+ level: number;
58
+ }
59
+ export interface Permission {
60
+ uuid: string;
61
+ CreatedAt: string;
62
+ UpdatedAt: string;
63
+ DeletedAt: string | null;
64
+ action: string;
65
+ role_uuid: string;
66
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ptkl/sdk",
3
- "version": "0.9.12",
3
+ "version": "0.9.15",
4
4
  "scripts": {
5
5
  "build": "rollup -c",
6
6
  "build:monaco": "npm run build && node scripts/generate-monaco-types.cjs",
@@ -42,6 +42,7 @@
42
42
  "@rollup/plugin-replace": "^6.0.2",
43
43
  "axios": "^1.7.7",
44
44
  "dom-parser": "^1.1.5",
45
+ "form-data": "^4.0.4",
45
46
  "lodash": "^4.17.21"
46
47
  }
47
48
  }