@ptkl/sdk 0.9.11 → 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.
@@ -0,0 +1,146 @@
1
+ import PlatformBaseClient from "./platformBaseClient";
2
+ import { AxiosResponse } from "axios";
3
+ export default class Project extends PlatformBaseClient {
4
+ /**
5
+ * Get list of all projects for the current user
6
+ */
7
+ list(): Promise<AxiosResponse<any>>;
8
+ /**
9
+ * Create a new project
10
+ * @param data Project creation data
11
+ */
12
+ create(data: {
13
+ name: string;
14
+ description?: string;
15
+ [key: string]: any;
16
+ }): Promise<AxiosResponse<any>>;
17
+ /**
18
+ * Get information about a specific project
19
+ */
20
+ info(): Promise<AxiosResponse<any>>;
21
+ /**
22
+ * Archive a project
23
+ */
24
+ archive(): Promise<AxiosResponse<any>>;
25
+ /**
26
+ * Invite a user to the project
27
+ * @param email Array of emails
28
+ * @param roles Array of role UUIDs
29
+ */
30
+ invite(emails: string[], roles: string[]): Promise<AxiosResponse<any>>;
31
+ /**
32
+ * Get list of project invites
33
+ */
34
+ getInvites(): Promise<AxiosResponse<any>>;
35
+ /**
36
+ * Get a specific invite by UUID
37
+ * @param uuid Invite UUID
38
+ */
39
+ getInvite(uuid: string): Promise<AxiosResponse<any>>;
40
+ /**
41
+ * Accept an invite
42
+ * @param uuid Invite UUID
43
+ */
44
+ acceptInvite(uuid: string): Promise<AxiosResponse<any>>;
45
+ /**
46
+ * Register through an invite
47
+ * @param uuid Invite UUID
48
+ * @param data Registration data
49
+ */
50
+ registerWithInvite(uuid: string, data: any): Promise<AxiosResponse<any>>;
51
+ /**
52
+ * Get list of project users
53
+ */
54
+ getUsers(): Promise<AxiosResponse<any>>;
55
+ /**
56
+ * Get a specific project user
57
+ * @param uuid User UUID
58
+ */
59
+ getUser(uuid: string): Promise<AxiosResponse<any>>;
60
+ /**
61
+ * Update a project user
62
+ * @param uuid User UUID
63
+ * @param data Update data
64
+ */
65
+ updateUser(uuid: string, data: any): Promise<AxiosResponse<any>>;
66
+ /**
67
+ * Delete a user from the project
68
+ * @param uuid User UUID
69
+ */
70
+ deleteUser(uuid: string): Promise<AxiosResponse<any>>;
71
+ /**
72
+ * Update project settings
73
+ * @param settings Settings data
74
+ */
75
+ updateSettings(settings: any): Promise<AxiosResponse<any>>;
76
+ /**
77
+ * Create a new workspace
78
+ * @param data Workspace data
79
+ */
80
+ createWorkspace(data: {
81
+ name: string;
82
+ description?: string;
83
+ [key: string]: any;
84
+ }): Promise<AxiosResponse<any>>;
85
+ /**
86
+ * Update a workspace
87
+ * @param uuid Workspace UUID
88
+ * @param data Update data
89
+ */
90
+ updateWorkspace(uuid: string, data: any): Promise<AxiosResponse<any>>;
91
+ /**
92
+ * Delete a workspace
93
+ * @param uuid Workspace UUID
94
+ */
95
+ deleteWorkspace(uuid: string): Promise<AxiosResponse<any>>;
96
+ /**
97
+ * Get available templates
98
+ */
99
+ getAvailableTemplates(): Promise<AxiosResponse<any>>;
100
+ /**
101
+ * Search for templates
102
+ * @param query Search query
103
+ */
104
+ searchTemplates(query: any): Promise<AxiosResponse<any>>;
105
+ /**
106
+ * Get template by ID
107
+ * @param id Template ID
108
+ */
109
+ getTemplate(id: string): Promise<AxiosResponse<any>>;
110
+ /**
111
+ * Get template by activation code
112
+ * @param code Activation code
113
+ */
114
+ getTemplateByCode(code: string): Promise<AxiosResponse<any>>;
115
+ /**
116
+ * Get templates for a workspace
117
+ */
118
+ getWorkspaceTemplates(): Promise<AxiosResponse<any>>;
119
+ /**
120
+ * Install a template
121
+ * @param data Installation data
122
+ */
123
+ installTemplate(data: {
124
+ template_id: string;
125
+ workspace_uuid: string;
126
+ [key: string]: any;
127
+ }): Promise<AxiosResponse<any>>;
128
+ /**
129
+ * Uninstall a template
130
+ * @param data Uninstallation data
131
+ */
132
+ uninstallTemplate(data: {
133
+ template_id: string;
134
+ workspace_uuid: string;
135
+ [key: string]: any;
136
+ }): Promise<AxiosResponse<any>>;
137
+ /**
138
+ * Upgrade a template
139
+ * @param data Upgrade data
140
+ */
141
+ upgradeTemplate(data: {
142
+ template_id: string;
143
+ workspace_uuid: string;
144
+ [key: string]: any;
145
+ }): Promise<AxiosResponse<any>>;
146
+ }
@@ -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
+ }
@@ -83,6 +83,8 @@ export type DataConversionParams = {
83
83
  footer_as_comment?: boolean;
84
84
  /** Empty rows between sections (default: 1) */
85
85
  separator_rows?: number;
86
+ /** Specify order of fields/columns */
87
+ field_order?: string[];
86
88
  };
87
89
  /**
88
90
  * Parameters for data format validation
@@ -131,5 +133,18 @@ export type DataValidationResult = {
131
133
  */
132
134
  export type ConversionOptions = {
133
135
  /** Excel sheet name for read/write operations (defaults to "Sheet1") */
134
- sheet_name?: string;
136
+ sheet_name?: string; /** Specify order of fields/columns */
137
+ field_order?: string[];
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;
135
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.11",
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
  }