@ptkl/sdk 0.9.10 → 0.9.12

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/index.cjs.js CHANGED
@@ -19890,7 +19890,7 @@ class DMS extends IntegrationsBaseClient {
19890
19890
  * ```
19891
19891
  */
19892
19892
  async convertData(lib, data, params) {
19893
- const { from, to, sheet_name, include_header, include_footer, header_as_comment, footer_as_comment, separator_rows } = params;
19893
+ const { from, to, sheet_name, include_header, include_footer, header_as_comment, footer_as_comment, separator_rows, field_order, } = params;
19894
19894
  const queryParams = { from, to };
19895
19895
  // Add optional parameters if provided
19896
19896
  if (sheet_name)
@@ -19905,6 +19905,9 @@ class DMS extends IntegrationsBaseClient {
19905
19905
  queryParams.footer_as_comment = footer_as_comment;
19906
19906
  if (separator_rows !== undefined)
19907
19907
  queryParams.separator_rows = separator_rows;
19908
+ if (field_order !== undefined)
19909
+ queryParams.field_order = field_order.join(',');
19910
+ console.log('Conversion Query Params:', queryParams);
19908
19911
  // Determine content type based on target format
19909
19912
  let responseType = 'text';
19910
19913
  if (to === 'json') {
@@ -20045,8 +20048,13 @@ class DMS extends IntegrationsBaseClient {
20045
20048
  * // Auto-detects header, items, and footer sections
20046
20049
  * ```
20047
20050
  */
20048
- async jsonToCsv(lib, jsonData) {
20051
+ async jsonToCsv(lib, jsonData, options) {
20052
+ let params = {};
20053
+ if (options === null || options === void 0 ? void 0 : options.field_order) {
20054
+ params.field_order = options.field_order.join(',');
20055
+ }
20049
20056
  return this.request('POST', `media/library/${lib}/convert/json-to-csv`, {
20057
+ params,
20050
20058
  data: jsonData,
20051
20059
  responseType: 'text',
20052
20060
  headers: {
@@ -20104,6 +20112,9 @@ class DMS extends IntegrationsBaseClient {
20104
20112
  if (options === null || options === void 0 ? void 0 : options.sheet_name) {
20105
20113
  params.sheet_name = options.sheet_name;
20106
20114
  }
20115
+ if (options === null || options === void 0 ? void 0 : options.field_order) {
20116
+ params.field_order = options.field_order.join(',');
20117
+ }
20107
20118
  return this.request('POST', `media/library/${lib}/convert/json-to-excel`, {
20108
20119
  data: jsonData,
20109
20120
  params,
@@ -20269,7 +20280,7 @@ class DMS extends IntegrationsBaseClient {
20269
20280
  async request(method, endpoint, params) {
20270
20281
  return await this.client.request({
20271
20282
  method: method,
20272
- url: `/v2/${endpoint}`,
20283
+ url: `/v2/dms/${endpoint}`,
20273
20284
  ...params
20274
20285
  });
20275
20286
  }
package/dist/index.esm.js CHANGED
@@ -921,7 +921,7 @@ class DMS extends IntegrationsBaseClient {
921
921
  * ```
922
922
  */
923
923
  async convertData(lib, data, params) {
924
- const { from, to, sheet_name, include_header, include_footer, header_as_comment, footer_as_comment, separator_rows } = params;
924
+ const { from, to, sheet_name, include_header, include_footer, header_as_comment, footer_as_comment, separator_rows, field_order, } = params;
925
925
  const queryParams = { from, to };
926
926
  // Add optional parameters if provided
927
927
  if (sheet_name)
@@ -936,6 +936,9 @@ class DMS extends IntegrationsBaseClient {
936
936
  queryParams.footer_as_comment = footer_as_comment;
937
937
  if (separator_rows !== undefined)
938
938
  queryParams.separator_rows = separator_rows;
939
+ if (field_order !== undefined)
940
+ queryParams.field_order = field_order.join(',');
941
+ console.log('Conversion Query Params:', queryParams);
939
942
  // Determine content type based on target format
940
943
  let responseType = 'text';
941
944
  if (to === 'json') {
@@ -1076,8 +1079,13 @@ class DMS extends IntegrationsBaseClient {
1076
1079
  * // Auto-detects header, items, and footer sections
1077
1080
  * ```
1078
1081
  */
1079
- async jsonToCsv(lib, jsonData) {
1082
+ async jsonToCsv(lib, jsonData, options) {
1083
+ let params = {};
1084
+ if (options === null || options === void 0 ? void 0 : options.field_order) {
1085
+ params.field_order = options.field_order.join(',');
1086
+ }
1080
1087
  return this.request('POST', `media/library/${lib}/convert/json-to-csv`, {
1088
+ params,
1081
1089
  data: jsonData,
1082
1090
  responseType: 'text',
1083
1091
  headers: {
@@ -1135,6 +1143,9 @@ class DMS extends IntegrationsBaseClient {
1135
1143
  if (options === null || options === void 0 ? void 0 : options.sheet_name) {
1136
1144
  params.sheet_name = options.sheet_name;
1137
1145
  }
1146
+ if (options === null || options === void 0 ? void 0 : options.field_order) {
1147
+ params.field_order = options.field_order.join(',');
1148
+ }
1138
1149
  return this.request('POST', `media/library/${lib}/convert/json-to-excel`, {
1139
1150
  data: jsonData,
1140
1151
  params,
@@ -1300,7 +1311,7 @@ class DMS extends IntegrationsBaseClient {
1300
1311
  async request(method, endpoint, params) {
1301
1312
  return await this.client.request({
1302
1313
  method: method,
1303
- url: `/v2/${endpoint}`,
1314
+ url: `/v2/dms/${endpoint}`,
1304
1315
  ...params
1305
1316
  });
1306
1317
  }
@@ -922,7 +922,7 @@ var ProtokolSDK09 = (function (exports, axios) {
922
922
  * ```
923
923
  */
924
924
  async convertData(lib, data, params) {
925
- const { from, to, sheet_name, include_header, include_footer, header_as_comment, footer_as_comment, separator_rows } = params;
925
+ const { from, to, sheet_name, include_header, include_footer, header_as_comment, footer_as_comment, separator_rows, field_order, } = params;
926
926
  const queryParams = { from, to };
927
927
  // Add optional parameters if provided
928
928
  if (sheet_name)
@@ -937,6 +937,9 @@ var ProtokolSDK09 = (function (exports, axios) {
937
937
  queryParams.footer_as_comment = footer_as_comment;
938
938
  if (separator_rows !== undefined)
939
939
  queryParams.separator_rows = separator_rows;
940
+ if (field_order !== undefined)
941
+ queryParams.field_order = field_order.join(',');
942
+ console.log('Conversion Query Params:', queryParams);
940
943
  // Determine content type based on target format
941
944
  let responseType = 'text';
942
945
  if (to === 'json') {
@@ -1077,8 +1080,13 @@ var ProtokolSDK09 = (function (exports, axios) {
1077
1080
  * // Auto-detects header, items, and footer sections
1078
1081
  * ```
1079
1082
  */
1080
- async jsonToCsv(lib, jsonData) {
1083
+ async jsonToCsv(lib, jsonData, options) {
1084
+ let params = {};
1085
+ if (options === null || options === void 0 ? void 0 : options.field_order) {
1086
+ params.field_order = options.field_order.join(',');
1087
+ }
1081
1088
  return this.request('POST', `media/library/${lib}/convert/json-to-csv`, {
1089
+ params,
1082
1090
  data: jsonData,
1083
1091
  responseType: 'text',
1084
1092
  headers: {
@@ -1136,6 +1144,9 @@ var ProtokolSDK09 = (function (exports, axios) {
1136
1144
  if (options === null || options === void 0 ? void 0 : options.sheet_name) {
1137
1145
  params.sheet_name = options.sheet_name;
1138
1146
  }
1147
+ if (options === null || options === void 0 ? void 0 : options.field_order) {
1148
+ params.field_order = options.field_order.join(',');
1149
+ }
1139
1150
  return this.request('POST', `media/library/${lib}/convert/json-to-excel`, {
1140
1151
  data: jsonData,
1141
1152
  params,
@@ -1301,7 +1312,7 @@ var ProtokolSDK09 = (function (exports, axios) {
1301
1312
  async request(method, endpoint, params) {
1302
1313
  return await this.client.request({
1303
1314
  method: method,
1304
- url: `/v2/${endpoint}`,
1315
+ url: `/v2/dms/${endpoint}`,
1305
1316
  ...params
1306
1317
  });
1307
1318
  }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ptkl/sdk",
3
- "version": "0.9.10",
3
+ "version": "0.9.11",
4
4
  "scripts": {
5
5
  "build": "rollup -c",
6
6
  "build:monaco": "npm run build && node scripts/generate-monaco-types.cjs",
@@ -261,7 +261,7 @@ export default class DMS extends IntegrationsBaseClient {
261
261
  * // Auto-detects header, items, and footer sections
262
262
  * ```
263
263
  */
264
- jsonToCsv(lib: string, jsonData: any): Promise<AxiosResponse<string>>;
264
+ jsonToCsv(lib: string, jsonData: any, options?: ConversionOptions): Promise<AxiosResponse<string>>;
265
265
  /**
266
266
  * Convert JSON data to Excel (.xlsx) format
267
267
  *
@@ -1,3 +1,6 @@
1
+ import Invoicing from "./integrations/invoicing";
2
+ import DMS from "./integrations/dms";
3
+ import VPFR from "./integrations/vpfr";
1
4
  import IntegrationsBaseClient from "./integrationsBaseClient";
2
5
  import Payments from "./integrations/payments";
3
6
  export default class Integrations extends IntegrationsBaseClient {
@@ -8,9 +11,9 @@ export default class Integrations extends IntegrationsBaseClient {
8
11
  host?: string;
9
12
  });
10
13
  getSerbiaUtilities(): any;
11
- getDMS(): any;
12
- getVPFR(): any;
13
- getInvoicing(): any;
14
+ getDMS(): DMS;
15
+ getVPFR(): VPFR;
16
+ getInvoicing(): Invoicing;
14
17
  getPayments(): Payments;
15
18
  isInstalled(id: string): Promise<boolean>;
16
19
  getInterfaceOf(id: string): any;
@@ -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,6 @@ 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[];
135
138
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ptkl/sdk",
3
- "version": "0.9.10",
3
+ "version": "0.9.12",
4
4
  "scripts": {
5
5
  "build": "rollup -c",
6
6
  "build:monaco": "npm run build && node scripts/generate-monaco-types.cjs",