@ptkl/sdk 0.9.12 → 0.10.0

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/dist/monaco.d.ts CHANGED
@@ -8,7 +8,6 @@ export { default as System } from './api/system';
8
8
  export { default as User } from './api/users';
9
9
  export { default as Functions } from './api/functions';
10
10
  export { default as APIUser } from './api/apiUser';
11
- export { default as Roles } from './api/roles';
12
11
  export { default as Apps } from './api/apps';
13
12
  export { default as Workflow } from './api/workflow';
14
13
  export { default as ComponentUtils } from './api/componentUtils';
@@ -20,9 +19,13 @@ export { default as Invoicing } from './api/integrations/invoicing';
20
19
  export { default as DMS } from './api/integrations/dms';
21
20
  export { default as SerbiaUtil } from './api/integrations/serbiaUtil';
22
21
  export { default as VPFR } from './api/integrations/vpfr';
22
+ export { default as Project } from './api/project';
23
+ export { default as Config } from './api/config';
23
24
  export type * from './types/component';
24
25
  export type * from './types/integrations';
25
26
  export type * from './types/users';
27
+ export type * from './types/project';
28
+ export type * from './types/config';
26
29
  export default Platform;
27
30
 
28
31
  }
@@ -85,6 +88,19 @@ declare type ModifyOptions = {
85
88
  upsert: boolean;
86
89
  };
87
90
 
91
+ declare interface UserConfig {
92
+ uuid?: string;
93
+ user_uuid: string;
94
+ data: Record<string, any>;
95
+ created_at?: string;
96
+ updated_at?: string;
97
+ }
98
+
99
+ declare interface ConfigUpdateRequest {
100
+ data: Record<string, any>;
101
+ path: string;
102
+ }
103
+
88
104
  declare type PaymentProvider = 'monri';
89
105
 
90
106
  declare type GetPaymentLinkOptions = {
@@ -183,6 +199,8 @@ declare type DataConversionParams = {
183
199
  footer_as_comment?: boolean;
184
200
  /** Empty rows between sections (default: 1) */
185
201
  separator_rows?: number;
202
+ /** Specify order of fields/columns */
203
+ field_order?: string[];
186
204
  };
187
205
 
188
206
  /**
@@ -236,9 +254,213 @@ declare type DataValidationResult = {
236
254
  */
237
255
  declare type ConversionOptions = {
238
256
  /** Excel sheet name for read/write operations (defaults to "Sheet1") */
239
- sheet_name?: string;
257
+ sheet_name?: string; /** Specify order of fields/columns */
258
+ field_order?: string[];
259
+ };
260
+
261
+ declare type NbsIpsQrCode = {
262
+ TransactionType: string;
263
+ Version: string;
264
+ CharacterSet: string;
265
+ RecipientAccountNumber: string;
266
+ RecipientName: string;
267
+ AmountInLocalCurrency: string;
268
+ PayerInformation: string;
269
+ PaymentPurposeCode: string;
270
+ PurposeOfPayment: string;
271
+ PaymentOrderNumber: string;
240
272
  };
241
273
 
274
+ declare interface MediaLibrary {
275
+ uuid: string;
276
+ ref: string;
277
+ name: string;
278
+ description?: string;
279
+ type?: string;
280
+ project_uuid: string;
281
+ workspace_uuid?: string;
282
+ created_at: string;
283
+ updated_at: string;
284
+ settings?: MediaLibrarySettings;
285
+ }
286
+
287
+ declare interface MediaLibrarySettings {
288
+ max_file_size?: number;
289
+ allowed_types?: string[];
290
+ public?: boolean;
291
+ [key: string]: any;
292
+ }
293
+
294
+ declare interface MediaFile {
295
+ uuid: string;
296
+ key: string;
297
+ name: string;
298
+ path: string;
299
+ size: number;
300
+ mime_type: string;
301
+ library_uuid: string;
302
+ created_at: string;
303
+ updated_at: string;
304
+ metadata?: MediaFileMetadata;
305
+ is_directory?: boolean;
306
+ }
307
+
308
+ declare interface MediaFileMetadata {
309
+ width?: number;
310
+ height?: number;
311
+ duration?: number;
312
+ [key: string]: any;
313
+ }
314
+
315
+ declare interface MediaListRequest {
316
+ library_uuid?: string;
317
+ library_ref?: string;
318
+ path?: string;
319
+ page?: number;
320
+ limit?: number;
321
+ search?: string;
322
+ mime_type?: string;
323
+ }
324
+
325
+ declare interface MediaListResponse {
326
+ files: MediaFile[];
327
+ total: number;
328
+ page: number;
329
+ limit: number;
330
+ }
331
+
332
+ declare interface MediaUploadRequest {
333
+ library_uuid?: string;
334
+ library_ref?: string;
335
+ path?: string;
336
+ file: File | Blob;
337
+ name?: string;
338
+ metadata?: Record<string, any>;
339
+ }
340
+
341
+ declare interface MediaDownloadRequest {
342
+ keys: string[];
343
+ zip?: boolean;
344
+ }
345
+
346
+ declare interface MediaShareRequest {
347
+ keys: string[];
348
+ expires_in?: number;
349
+ password?: string;
350
+ }
351
+
352
+ declare interface MediaShareResponse {
353
+ url: string;
354
+ expires_at?: string;
355
+ token?: string;
356
+ }
357
+
358
+ declare interface MediaDirectory {
359
+ name: string;
360
+ path: string;
361
+ }
362
+
363
+ declare interface MediaMoveRequest {
364
+ keys: string[];
365
+ destination: string;
366
+ }
367
+
368
+ declare interface MediaDeleteRequest {
369
+ keys: string[];
370
+ }
371
+
372
+ declare interface ExifData {
373
+ [key: string]: any;
374
+ }
375
+
376
+ declare interface Html2PdfRequest {
377
+ html: string;
378
+ options?: {
379
+ format?: "A4" | "Letter" | string;
380
+ orientation?: "portrait" | "landscape";
381
+ margin?: {
382
+ top?: string;
383
+ right?: string;
384
+ bottom?: string;
385
+ left?: string;
386
+ };
387
+ [key: string]: any;
388
+ };
389
+ output_path?: string;
390
+ }
391
+
392
+ declare interface ProjectModel {
393
+ uuid: string;
394
+ name: string;
395
+ description?: string;
396
+ created_at: string;
397
+ updated_at: string;
398
+ deleted_at?: string | null;
399
+ owner_uuid: string;
400
+ archived: boolean;
401
+ settings?: ProjectSettings;
402
+ }
403
+
404
+ declare interface ProjectSettings {
405
+ [key: string]: any;
406
+ }
407
+
408
+ declare interface ProjectUser {
409
+ uuid: string;
410
+ name: string;
411
+ email: string;
412
+ roles: string[];
413
+ created_at: string;
414
+ }
415
+
416
+ declare interface ProjectInvite {
417
+ uuid: string;
418
+ email: string;
419
+ roles: string[];
420
+ status: string;
421
+ created_at: string;
422
+ expires_at: string;
423
+ project_uuid: string;
424
+ }
425
+
426
+ declare interface Workspace {
427
+ uuid: string;
428
+ name: string;
429
+ description?: string;
430
+ project_uuid: string;
431
+ created_at: string;
432
+ updated_at: string;
433
+ deleted_at?: string | null;
434
+ }
435
+
436
+ declare interface Template {
437
+ id: string;
438
+ name: string;
439
+ description?: string;
440
+ version: string;
441
+ category?: string;
442
+ tags?: string[];
443
+ author?: string;
444
+ created_at?: string;
445
+ updated_at?: string;
446
+ }
447
+
448
+ declare interface TemplateInstallation {
449
+ template_id: string;
450
+ workspace_uuid: string;
451
+ version?: string;
452
+ config?: Record<string, any>;
453
+ }
454
+
455
+ declare interface Transaction {
456
+ uuid: string;
457
+ type: string;
458
+ amount: number;
459
+ status: string;
460
+ created_at: string;
461
+ metadata?: Record<string, any>;
462
+ }
463
+
242
464
  declare interface UserModel {
243
465
  uuid: string;
244
466
  name: string;
@@ -275,6 +497,43 @@ declare interface UserClaims {
275
497
  exp: number;
276
498
  }
277
499
 
500
+ declare interface Role {
501
+ uuid: string;
502
+ CreatedAt: string;
503
+ UpdatedAt: string;
504
+ DeletedAt: string | null;
505
+ name: string;
506
+ level: number;
507
+ project_uuid: string;
508
+ is_admin: boolean;
509
+ }
510
+
511
+ declare interface EditRoleRequest {
512
+ permissions: string[];
513
+ workspaces: string[];
514
+ level: number;
515
+ }
516
+
517
+ declare interface CreateRoleRequest extends EditRoleRequest {
518
+ name: string;
519
+ }
520
+
521
+ declare interface RoleModel {
522
+ name: string;
523
+ permissions: string[];
524
+ workspaces: string[];
525
+ level: number;
526
+ }
527
+
528
+ declare interface Permission {
529
+ uuid: string;
530
+ CreatedAt: string;
531
+ UpdatedAt: string;
532
+ DeletedAt: string | null;
533
+ action: string;
534
+ role_uuid: string;
535
+ }
536
+
278
537
  declare class APIUserConstructor extends PlatformBaseClientConstructor {
279
538
  constructor();
280
539
  auth(username: string, password: string, project: string): Promise<any>;
@@ -314,6 +573,7 @@ declare class ComponentConstructor extends PlatformBaseClientConstructor {
314
573
  saveTemplatesDist(version: string, sdkVersion: string, engine: string, dist: Record<string, string>): Promise<any>;
315
574
  workflow(event: string, input: any): Promise<any>;
316
575
  function(name: string, input: any): Promise<any>;
576
+ revisions(uuid: string): Promise<any>;
317
577
  }
318
578
 
319
579
  declare class ComponentUtilsConstructor extends PlatformBaseClientConstructor {
@@ -322,6 +582,12 @@ declare class ComponentUtilsConstructor extends PlatformBaseClientConstructor {
322
582
  create(data: any): Promise<any>;
323
583
  }
324
584
 
585
+ declare class ConfigConstructor extends PlatformBaseClientConstructor {
586
+ constructor();
587
+ getUserConfig(): Promise<any>;
588
+ updateUserConfig(config: ConfigUpdateRequest): Promise<any>;
589
+ }
590
+
325
591
  declare class DMSConstructor extends IntegrationsBaseClientConstructor {
326
592
  constructor();
327
593
  list(data: any): Promise<any>;
@@ -340,7 +606,7 @@ declare class DMSConstructor extends IntegrationsBaseClientConstructor {
340
606
  convertData(lib: string, data: any, params: DataConversionParams): Promise<any>;
341
607
  getDataInfo(lib: string, data: any, params: DataInfoParams): Promise<any>;
342
608
  validateData(lib: string, data: any, params: DataValidationParams): Promise<any>;
343
- jsonToCsv(lib: string, jsonData: any): Promise<any>;
609
+ jsonToCsv(lib: string, jsonData: any, options?: ConversionOptions): Promise<any>;
344
610
  jsonToExcel(lib: string, jsonData: any, options?: ConversionOptions): Promise<any>;
345
611
  csvToJson(lib: string, csvData: string): Promise<any>;
346
612
  csvToExcel(lib: string, csvData: string, options?: ConversionOptions): Promise<any>;
@@ -378,9 +644,9 @@ declare class IntegrationsConstructor extends IntegrationsBaseClientConstructor
378
644
  host?: string;
379
645
  });
380
646
  getSerbiaUtilities(): any;
381
- getDMS(): any;
382
- getVPFR(): any;
383
- getInvoicing(): any;
647
+ getDMS(): DMS;
648
+ getVPFR(): VPFR;
649
+ getInvoicing(): Invoicing;
384
650
  getPayments(): Payments;
385
651
  isInstalled(id: string): Promise<boolean>;
386
652
  getInterfaceOf(id: string): any;
@@ -432,7 +698,6 @@ declare class PlatformConstructor extends PlatformBaseClientConstructor {
432
698
  getPlatformBaseURL(): string;
433
699
  apiUser(): APIUser;
434
700
  function(): Functions;
435
- role(): Roles;
436
701
  user(): Users;
437
702
  app(appType: string): Apps;
438
703
  forge(): Forge;
@@ -443,6 +708,8 @@ declare class PlatformConstructor extends PlatformBaseClientConstructor {
443
708
  system(): System;
444
709
  workflow(): Workflow;
445
710
  thunder(): Thunder;
711
+ project(): Project;
712
+ config(): Config;
446
713
  }
447
714
 
448
715
  declare class PlatformBaseClientConstructor extends BaseClientConstructor {
@@ -453,6 +720,55 @@ declare class PlatformBaseClientConstructor extends BaseClientConstructor {
453
720
  });
454
721
  }
455
722
 
723
+ declare class ProjectConstructor extends PlatformBaseClientConstructor {
724
+ constructor();
725
+ list(): Promise<any>;
726
+ create(data: {
727
+ name: string;
728
+ description?: string;
729
+ [key: string]: any;
730
+ }): Promise<any>;
731
+ info(): Promise<any>;
732
+ archive(): Promise<any>;
733
+ invite(emails: string[], roles: string[]): Promise<any>;
734
+ getInvites(): Promise<any>;
735
+ getInvite(uuid: string): Promise<any>;
736
+ acceptInvite(uuid: string): Promise<any>;
737
+ registerWithInvite(uuid: string, data: any): Promise<any>;
738
+ getUsers(): Promise<any>;
739
+ getUser(uuid: string): Promise<any>;
740
+ updateUser(uuid: string, data: any): Promise<any>;
741
+ deleteUser(uuid: string): Promise<any>;
742
+ updateSettings(settings: any): Promise<any>;
743
+ createWorkspace(data: {
744
+ name: string;
745
+ description?: string;
746
+ [key: string]: any;
747
+ }): Promise<any>;
748
+ updateWorkspace(uuid: string, data: any): Promise<any>;
749
+ deleteWorkspace(uuid: string): Promise<any>;
750
+ getAvailableTemplates(): Promise<any>;
751
+ searchTemplates(query: any): Promise<any>;
752
+ getTemplate(id: string): Promise<any>;
753
+ getTemplateByCode(code: string): Promise<any>;
754
+ getWorkspaceTemplates(): Promise<any>;
755
+ installTemplate(data: {
756
+ template_id: string;
757
+ workspace_uuid: string;
758
+ [key: string]: any;
759
+ }): Promise<any>;
760
+ uninstallTemplate(data: {
761
+ template_id: string;
762
+ workspace_uuid: string;
763
+ [key: string]: any;
764
+ }): Promise<any>;
765
+ upgradeTemplate(data: {
766
+ template_id: string;
767
+ workspace_uuid: string;
768
+ [key: string]: any;
769
+ }): Promise<any>;
770
+ }
771
+
456
772
  declare class RatchetConstructor extends PlatformBaseClientConstructor {
457
773
  constructor();
458
774
  query(name: string, params: any): Promise<any>;
@@ -475,7 +791,8 @@ declare class SandboxConstructor extends PlatformBaseClientConstructor {
475
791
 
476
792
  declare class SerbiaUtilConstructor extends IntegrationsBaseClientConstructor {
477
793
  constructor();
478
- nsbSearch(params: any): Promise<any>;
794
+ nbsSearch(params: any): Promise<any>;
795
+ generateNbsIpsQrCode(params: NbsIpsQrCode): any;
479
796
  getReceiptFromUrl(url: string, source: string): Promise<any>;
480
797
  getContoList(): Promise<any>;
481
798
  services(method: string, endpoint: string, params?: any): Promise<any>;
@@ -503,12 +820,22 @@ declare class ThunderConstructor extends PlatformBaseClientConstructor {
503
820
 
504
821
  declare class UsersConstructor extends PlatformBaseClientConstructor {
505
822
  constructor();
506
- invite(email: string, roles: string[]): Promise<any>;
507
- getClaims(): Promise<any>;
823
+ auth(username: string, password: string, project: string): Promise<any>;
824
+ resendConfirmationEmail(email: string): Promise<any>;
825
+ requestPasswordReset(email: string): Promise<any>;
508
826
  getUser(): Promise<any>;
509
- delete(uuid: string): Promise<any>;
827
+ getClaims(): Promise<any>;
828
+ editProfile(data: any): Promise<any>;
829
+ getPermissions(): Promise<any>;
830
+ listPermissions(): Promise<any>;
831
+ createRole(role: CreateRoleRequest): Promise<any>;
832
+ deleteRole(uuid: string): Promise<AxiosResponse<{
833
+ status: boolean;
834
+ }>>;
835
+ listRoles(): Promise<any>;
836
+ getRoleModel(uuid: string): Promise<any>;
837
+ editRole(uuid: string, data: EditRoleRequest): Promise<any>;
510
838
  permissions(): Promise<any>;
511
- auth(username: string, password: string, project: string): Promise<any>;
512
839
  }
513
840
 
514
841
  declare class VPFRConstructor extends IntegrationsBaseClientConstructor {
@@ -529,7 +856,6 @@ interface ProtokolSDK {
529
856
  System: typeof SystemConstructor;
530
857
  Functions: typeof FunctionsConstructor;
531
858
  APIUser: typeof APIUserConstructor;
532
- Roles: typeof RolesConstructor;
533
859
  Apps: typeof AppsConstructor;
534
860
  Workflow: typeof WorkflowConstructor;
535
861
  ComponentUtils: typeof ComponentUtilsConstructor;
@@ -541,6 +867,8 @@ interface ProtokolSDK {
541
867
  DMS: typeof DMSConstructor;
542
868
  SerbiaUtil: typeof SerbiaUtilConstructor;
543
869
  VPFR: typeof VPFRConstructor;
870
+ Project: typeof ProjectConstructor;
871
+ Config: typeof ConfigConstructor;
544
872
  }
545
873
 
546
874
  declare const $sdk: {
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ptkl/sdk",
3
- "version": "0.9.11",
3
+ "version": "0.10.0",
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
  }
@@ -88,5 +88,6 @@ export default class Component extends PlatformBaseClient {
88
88
  saveTemplatesDist(version: string, sdkVersion: string, engine: string, dist: Record<string, string>): Promise<any>;
89
89
  workflow(event: string, input: any): Promise<AxiosResponse<any, any>>;
90
90
  function(name: string, input: any): Promise<AxiosResponse<any, any>>;
91
+ revisions(uuid: string): Promise<AxiosResponse<any, any>>;
91
92
  }
92
93
  export { FindParams, FindOptions, FindResponse, FindAdvancedParams, FindAggregateParams, Model, UpdateOptions, };
@@ -0,0 +1,14 @@
1
+ import PlatformBaseClient from "./platformBaseClient";
2
+ import { AxiosResponse } from "axios";
3
+ import { ConfigUpdateRequest, UserConfig } from '../types/config';
4
+ export default class Config extends PlatformBaseClient {
5
+ /**
6
+ * Get user configuration
7
+ */
8
+ getUserConfig(): Promise<AxiosResponse<UserConfig>>;
9
+ /**
10
+ * Update user configuration
11
+ * @param config Configuration data
12
+ */
13
+ updateUserConfig(config: ConfigUpdateRequest): Promise<AxiosResponse<any>>;
14
+ }
@@ -88,11 +88,11 @@ export default class DMS extends IntegrationsBaseClient {
88
88
  uploadBase64(data: any): Promise<AxiosResponse<any, any>>;
89
89
  getMedia(lib: string, key: string, encoding: string): Promise<AxiosResponse<any, any>>;
90
90
  download(lib: string, key: string): Promise<AxiosResponse<any, any>>;
91
- getExifData(lib: string, key: string): Promise<AxiosResponse<any, any>>;
92
- html2pdf(lib: string, data: HTML2PDFOptions): Promise<AxiosResponse<any, any>>;
93
- createDir(lib: string, path: string): Promise<AxiosResponse<any, any>>;
94
- deleteDir(lib: string, path: string): Promise<AxiosResponse<any, any>>;
95
- dirs(lib: string, data: string): Promise<AxiosResponse<any, any>>;
91
+ getExifData(key: string): Promise<AxiosResponse<any, any>>;
92
+ html2pdf(data: HTML2PDFOptions): Promise<AxiosResponse<any, any>>;
93
+ createDir(path: string): Promise<AxiosResponse<any, any>>;
94
+ deleteDir(path: string): Promise<AxiosResponse<any, any>>;
95
+ dirs(data: string): Promise<AxiosResponse<any, any>>;
96
96
  fillPdf(lib: string, data: PDFFillOptions): Promise<AxiosResponse<any, any>>;
97
97
  /**
98
98
  * Convert data between different formats (JSON, CSV, Excel)
@@ -1,6 +1,8 @@
1
1
  import IntegrationsBaseClient from "../integrationsBaseClient";
2
+ import { NbsIpsQrCode } from "../../types/integrations";
2
3
  export default class SerbiaUtil extends IntegrationsBaseClient {
3
- nsbSearch(params: any): Promise<import("axios").AxiosResponse<any, any>>;
4
+ nbsSearch(params: any): Promise<import("axios").AxiosResponse<any, any>>;
5
+ generateNbsIpsQrCode(params: NbsIpsQrCode): any;
4
6
  getReceiptFromUrl(url: string, source: string): Promise<import("axios").AxiosResponse<any, any>>;
5
7
  getContoList(): Promise<import("axios").AxiosResponse<any, any>>;
6
8
  services(method: string, endpoint: string, params?: any): Promise<import("axios").AxiosResponse<any, any>>;
@@ -1,6 +1,5 @@
1
1
  import { AxiosInstance } from "axios";
2
2
  import Functions from "./functions";
3
- import Roles from "./roles";
4
3
  import APIUser from "./apiUser";
5
4
  import Users from "./users";
6
5
  import Apps from "./apps";
@@ -12,13 +11,14 @@ import Sandbox from "./sandbox";
12
11
  import System from "./system";
13
12
  import Workflow from "./workflow";
14
13
  import Forge from "./forge";
14
+ import Project from "./project";
15
+ import Config from "./config";
15
16
  import PlatformBaseClient from "./platformBaseClient";
16
17
  export default class Platform extends PlatformBaseClient {
17
18
  getPlatformClient(): AxiosInstance;
18
19
  getPlatformBaseURL(): string;
19
20
  apiUser(): APIUser;
20
21
  function(): Functions;
21
- role(): Roles;
22
22
  user(): Users;
23
23
  app(appType: string): Apps;
24
24
  forge(): Forge;
@@ -29,4 +29,6 @@ export default class Platform extends PlatformBaseClient {
29
29
  system(): System;
30
30
  workflow(): Workflow;
31
31
  thunder(): Thunder;
32
+ project(): Project;
33
+ config(): Config;
32
34
  }