idosell 0.1.8 → 0.1.10

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.
Files changed (34) hide show
  1. package/README.md +19 -1
  2. package/dist/gates.def.js +206 -4
  3. package/dist/gates.js +50 -0
  4. package/dist/methods/deleteConfigVariables.js +6 -0
  5. package/dist/methods/deleteCpa.js +6 -0
  6. package/dist/methods/deleteCpaCampaign.js +6 -0
  7. package/dist/methods/deleteSnippets.js +6 -0
  8. package/dist/methods/deleteSnippetsCampaign.js +6 -0
  9. package/dist/methods/deleteSnippetsCookies.js +6 -0
  10. package/dist/methods/getConfigVariables.js +6 -0
  11. package/dist/methods/getCpa.js +6 -0
  12. package/dist/methods/getCpaCampaign.js +6 -0
  13. package/dist/methods/getEntriesSources.js +6 -0
  14. package/dist/methods/getSnippets.js +6 -0
  15. package/dist/methods/getSnippetsCampaign.js +6 -0
  16. package/dist/methods/getSnippetsCookies.js +6 -0
  17. package/dist/methods/postCpa.js +6 -0
  18. package/dist/methods/postCpaCampaign.js +6 -0
  19. package/dist/methods/postOrdersDocumentsCreate.js +6 -0
  20. package/dist/methods/postSnippets.js +6 -0
  21. package/dist/methods/postSnippetsCampaign.js +6 -0
  22. package/dist/methods/postSnippetsCookies.js +6 -0
  23. package/dist/methods/putConfigVariables.js +6 -0
  24. package/dist/methods/putCpa.js +6 -0
  25. package/dist/methods/putCpaCampaign.js +6 -0
  26. package/dist/methods/putSnippets.js +6 -0
  27. package/dist/methods/putSnippetsCampaign.js +6 -0
  28. package/dist/methods/putSnippetsCookies.js +6 -0
  29. package/dist/request.js +1 -1
  30. package/package.json +1 -1
  31. package/tests/getEntriesSources.test.js +7 -0
  32. package/tests/getProductsDeliveryTime.test.js +1 -1
  33. package/tests/postOrdersDocumentsCreate.test.js +7 -0
  34. package/tests/postReturns.test.js +2 -2
package/README.md CHANGED
@@ -306,12 +306,30 @@ This will result in following request body
306
306
  }
307
307
  ```
308
308
 
309
+ ### Params
310
+
311
+ Instead of using helpers, you can generate complex data by yourself and pass it using *params()* method.
312
+
313
+ ```javascript
314
+ const query = {
315
+ orderSource:{
316
+ auctionsParams: {
317
+ auctionsServicesNames: [
318
+ "allegro"
319
+ ]
320
+ }
321
+ }
322
+ }
323
+
324
+ const ordersFromAllegro = await idosellRequest.params(query).exec();
325
+ ```
326
+
309
327
  ## Debugging
310
328
 
311
329
  You can use the *getParams()* function to retrieve request parameters as Javascript Object.
312
330
 
313
331
  ```javascript
314
- const orderRequest = idosellRequest.getOrders.ordersSerialNumbers([123, 456, 789]).getParams();
332
+ const orderRequest = idosellRequest.listOrders.ordersSerialNumbers([123, 456, 789]).getParams();
315
333
  // Will return Object: { ordersSerialNumbers: [ 123, 456, 789 ] }
316
334
  ```
317
335
 
package/dist/gates.def.js CHANGED
@@ -614,6 +614,30 @@
614
614
  * @property {function} exec Excecute request
615
615
  */
616
616
 
617
+ /**
618
+ * @typedef {Object} GetConfigVariablesRequest
619
+ * @property {(type: 'snippets_campaign') => GetConfigVariablesRequest} type Which component is affected by the configuration.
620
+ * @property {(item: Array<Integer>) => GetConfigVariablesRequest} item List of item identifiers for given configuration type. Eg. snippet campaign identifiers.
621
+ * @property {(key: Array<String>) => GetConfigVariablesRequest} key List of configuration keys
622
+ * @property {(resultsPage: Integer) => GetConfigVariablesRequest} resultsPage Page with results number. Numeration starts from 0
623
+ * @property {(resultsLimit: Integer) => GetConfigVariablesRequest} resultsLimit Number of results on page. Value from 1 to 100
624
+ * @property {function} exec Excecute request
625
+ */
626
+
627
+ /**
628
+ * @typedef {Object} PutConfigVariablesRequest
629
+ * @property {(variables: Array<Object>) => PutConfigVariablesRequest} variables
630
+ * @property {function} exec Excecute request
631
+ */
632
+
633
+ /**
634
+ * @typedef {Object} DeleteConfigVariablesRequest
635
+ * @property {(type: 'snippets_campaign') => DeleteConfigVariablesRequest} type Which component is affected by the configuration.
636
+ * @property {(item: Array<Integer>) => DeleteConfigVariablesRequest} item List of item identifiers for given configuration type. Eg. snippet campaign identifiers.
637
+ * @property {(key: Array<String>) => DeleteConfigVariablesRequest} key List of configuration keys
638
+ * @property {function} exec Excecute request
639
+ */
640
+
617
641
  /**
618
642
  * @typedef {Object} GetCouriersAssignedToShippingProfilesRequest
619
643
  * @property {function} exec Excecute request
@@ -657,7 +681,7 @@
657
681
  * @property {(pickupPointExternalId: String) => PostCouriersPickupPointsRequest} pickupPointExternalId external system code.
658
682
  * @property {(courierId: Integer) => PostCouriersPickupPointsRequest} courierId Courier ID.
659
683
  * @property {(descriptions: Array<Object>) => PostCouriersPickupPointsRequest} descriptions collection point details.
660
- * @property {(paymentForms: Array<Object>) => PostCouriersPickupPointsRequest} paymentForms Accepted payment types.
684
+ * @property {(paymentForms: Array<String>) => PostCouriersPickupPointsRequest} paymentForms Accepted payment types.
661
685
  * @property {(serviceStatus: 'out_of_service'|'available') => PostCouriersPickupPointsRequest} serviceStatus Collection point activity. Available values: available, outOfService .
662
686
  * @property {(address: Object) => PostCouriersPickupPointsRequest} address Pickup point address.
663
687
  * @property {(coordinates: Object) => PostCouriersPickupPointsRequest} coordinates Geographic coordinates.
@@ -673,7 +697,7 @@
673
697
  * @property {(pickupPointExternalId: String) => PutCouriersPickupPointsRequest} pickupPointExternalId external system code.
674
698
  * @property {(courierId: Integer) => PutCouriersPickupPointsRequest} courierId Courier ID.
675
699
  * @property {(descriptions: Array<Object>) => PutCouriersPickupPointsRequest} descriptions collection point details.
676
- * @property {(paymentForms: Array<Object>) => PutCouriersPickupPointsRequest} paymentForms Accepted payment types.
700
+ * @property {(paymentForms: Array<String>) => PutCouriersPickupPointsRequest} paymentForms Accepted payment types.
677
701
  * @property {(serviceStatus: 'out_of_service'|'available') => PutCouriersPickupPointsRequest} serviceStatus Collection point activity. Available values: available, outOfService .
678
702
  * @property {(address: Object) => PutCouriersPickupPointsRequest} address Pickup point address.
679
703
  * @property {(coordinates: Object) => PutCouriersPickupPointsRequest} coordinates Geographic coordinates.
@@ -682,6 +706,60 @@
682
706
  * @property {function} exec Excecute request
683
707
  */
684
708
 
709
+ /**
710
+ * @typedef {Object} GetCpaCampaignRequest
711
+ * @property {(shopId: Array<Integer>) => GetCpaCampaignRequest} shopId List of shop identifiers
712
+ * @property {(id: Array<Integer>) => GetCpaCampaignRequest} id List of identifiers
713
+ * @property {(resultsPage: Integer) => GetCpaCampaignRequest} resultsPage Page with results number. Numeration starts from 0
714
+ * @property {(resultsLimit: Integer) => GetCpaCampaignRequest} resultsLimit Number of results on page. Value from 1 to 100
715
+ * @property {function} exec Excecute request
716
+ */
717
+
718
+ /**
719
+ * @typedef {Object} PostCpaCampaignRequest
720
+ * @property {(campaigns: Array<Object>) => PostCpaCampaignRequest} campaigns
721
+ * @property {function} exec Excecute request
722
+ */
723
+
724
+ /**
725
+ * @typedef {Object} PutCpaCampaignRequest
726
+ * @property {(campaigns: Array<Object>) => PutCpaCampaignRequest} campaigns
727
+ * @property {function} exec Excecute request
728
+ */
729
+
730
+ /**
731
+ * @typedef {Object} DeleteCpaCampaignRequest
732
+ * @property {(id: Array<Integer>) => DeleteCpaCampaignRequest} id List of identifiers
733
+ * @property {function} exec Excecute request
734
+ */
735
+
736
+ /**
737
+ * @typedef {Object} GetCpaRequest
738
+ * @property {(campaign: Array<Integer>) => GetCpaRequest} campaign List of campaign identifiers
739
+ * @property {(id: Array<Integer>) => GetCpaRequest} id List of identifiers
740
+ * @property {(resultsPage: Integer) => GetCpaRequest} resultsPage Page with results number. Numeration starts from 0
741
+ * @property {(resultsLimit: Integer) => GetCpaRequest} resultsLimit Number of results on page. Value from 1 to 100
742
+ * @property {function} exec Excecute request
743
+ */
744
+
745
+ /**
746
+ * @typedef {Object} PostCpaRequest
747
+ * @property {(cpa: Array<Object>) => PostCpaRequest} cpa
748
+ * @property {function} exec Excecute request
749
+ */
750
+
751
+ /**
752
+ * @typedef {Object} PutCpaRequest
753
+ * @property {(cpa: Array<Object>) => PutCpaRequest} cpa
754
+ * @property {function} exec Excecute request
755
+ */
756
+
757
+ /**
758
+ * @typedef {Object} DeleteCpaRequest
759
+ * @property {(id: Array<Integer>) => DeleteCpaRequest} id List of identifiers
760
+ * @property {function} exec Excecute request
761
+ */
762
+
685
763
  /**
686
764
  * @typedef {Object} PutDeliveriesDefaultProfilesRequest
687
765
  * @property {(regionId: Integer) => PutDeliveriesDefaultProfilesRequest} regionId Country ID
@@ -868,6 +946,12 @@
868
946
  * @property {function} exec Excecute request
869
947
  */
870
948
 
949
+ /**
950
+ * @typedef {Object} GetEntriesSourcesRequest
951
+ * @property {(type: Array<String>) => GetEntriesSourcesRequest} type The type of source for which we want to get service identifiers
952
+ * @property {function} exec Excecute request
953
+ */
954
+
871
955
  /**
872
956
  * @typedef {Object} GetMenuFilterRequest
873
957
  * @property {(shopId: Integer) => GetMenuFilterRequest} shopId Shop Id
@@ -913,7 +997,7 @@
913
997
  * @property {(lang_id: String) => GetMenuRequest} lang_id Language ID.
914
998
  * @property {(node_id: Integer) => GetMenuRequest} node_id Menu node ID.
915
999
  * @property {(level: Integer) => GetMenuRequest} level Number of levels.
916
- * @property {(settings::textid_separator: String) => GetMenuRequest} settings::textid_separator Default: "\".
1000
+ * @property {(textid_separator: String) => GetMenuRequest} textid_separator Default: "\".
917
1001
  * @property {function} exec Excecute request
918
1002
  */
919
1003
 
@@ -1006,6 +1090,17 @@
1006
1090
  * @property {function} exec Excecute request
1007
1091
  */
1008
1092
 
1093
+ /**
1094
+ * @typedef {Object} PostOrdersDocumentsCreateRequest
1095
+ * @property {(orderSerialNumbers: Array<Integer>) => PostOrdersDocumentsCreateRequest} orderSerialNumbers
1096
+ * @property {(actualize: Boolean) => PostOrdersDocumentsCreateRequest} actualize
1097
+ * @property {(documentType: 'vat_invoice'|'fiscal_invoice'|'corrective_vat_invoice'|'fiscal_receipt'|'sales_confirmation') => PostOrdersDocumentsCreateRequest} documentType Document type
1098
+ * @property {(documentIssuedDate: String) => PostOrdersDocumentsCreateRequest} documentIssuedDate Document issued date
1099
+ * @property {(documentPurchaseDate: String) => PostOrdersDocumentsCreateRequest} documentPurchaseDate Document purchase date
1100
+ * @property {(printerId: Integer) => PostOrdersDocumentsCreateRequest} printerId Printer id
1101
+ * @property {function} exec Excecute request
1102
+ */
1103
+
1009
1104
  /**
1010
1105
  * @typedef {Object} DeleteOrdersDocumentsRequest
1011
1106
  * @property {(documents: Array<Object>) => DeleteOrdersDocumentsRequest} documents List of documents.
@@ -2867,6 +2962,88 @@
2867
2962
  * @property {function} exec Excecute request
2868
2963
  */
2869
2964
 
2965
+ /**
2966
+ * @typedef {Object} GetSnippetsCampaignRequest
2967
+ * @property {(shopId: Array<Integer>) => GetSnippetsCampaignRequest} shopId List of shop identifiers
2968
+ * @property {(id: Array<Integer>) => GetSnippetsCampaignRequest} id List of identifiers
2969
+ * @property {(omitDeleted: 'y'|'n') => GetSnippetsCampaignRequest} omitDeleted Whether to skip the return of deleted campaigns.
2970
+ * @property {(resultsPage: Integer) => GetSnippetsCampaignRequest} resultsPage Page with results number. Numeration starts from 0
2971
+ * @property {(resultsLimit: Integer) => GetSnippetsCampaignRequest} resultsLimit Number of results on page. Value from 1 to 100
2972
+ * @property {function} exec Excecute request
2973
+ */
2974
+
2975
+ /**
2976
+ * @typedef {Object} PostSnippetsCampaignRequest
2977
+ * @property {(campaigns: Array<Object>) => PostSnippetsCampaignRequest} campaigns
2978
+ * @property {function} exec Excecute request
2979
+ */
2980
+
2981
+ /**
2982
+ * @typedef {Object} PutSnippetsCampaignRequest
2983
+ * @property {(campaigns: Array<Object>) => PutSnippetsCampaignRequest} campaigns
2984
+ * @property {function} exec Excecute request
2985
+ */
2986
+
2987
+ /**
2988
+ * @typedef {Object} DeleteSnippetsCampaignRequest
2989
+ * @property {(id: Array<Integer>) => DeleteSnippetsCampaignRequest} id List of identifiers
2990
+ * @property {function} exec Excecute request
2991
+ */
2992
+
2993
+ /**
2994
+ * @typedef {Object} GetSnippetsCookiesRequest
2995
+ * @property {(id: Array<Integer>) => GetSnippetsCookiesRequest} id List of identifiers for specific cookies
2996
+ * @property {(resultsPage: Integer) => GetSnippetsCookiesRequest} resultsPage Page with results number. Numeration starts from 0
2997
+ * @property {(resultsLimit: Integer) => GetSnippetsCookiesRequest} resultsLimit Number of results on page. Value from 1 to 100
2998
+ * @property {function} exec Excecute request
2999
+ */
3000
+
3001
+ /**
3002
+ * @typedef {Object} PostSnippetsCookiesRequest
3003
+ * @property {(cookies: Array<Object>) => PostSnippetsCookiesRequest} cookies
3004
+ * @property {function} exec Excecute request
3005
+ */
3006
+
3007
+ /**
3008
+ * @typedef {Object} PutSnippetsCookiesRequest
3009
+ * @property {(cookies: Array<Object>) => PutSnippetsCookiesRequest} cookies
3010
+ * @property {function} exec Excecute request
3011
+ */
3012
+
3013
+ /**
3014
+ * @typedef {Object} DeleteSnippetsCookiesRequest
3015
+ * @property {(id: Array<Integer>) => DeleteSnippetsCookiesRequest} id List of cookie identifiers
3016
+ * @property {function} exec Excecute request
3017
+ */
3018
+
3019
+ /**
3020
+ * @typedef {Object} GetSnippetsRequest
3021
+ * @property {(campaign: Array<Integer>) => GetSnippetsRequest} campaign List of campaign identifiers
3022
+ * @property {(id: Array<Integer>) => GetSnippetsRequest} id List of identifiers
3023
+ * @property {(omitDeleted: 'y'|'n') => GetSnippetsRequest} omitDeleted Whether to skip the return of deleted campaigns.
3024
+ * @property {(resultsPage: Integer) => GetSnippetsRequest} resultsPage Page with results number. Numeration starts from 0
3025
+ * @property {(resultsLimit: Integer) => GetSnippetsRequest} resultsLimit Number of results on page. Value from 1 to 100
3026
+ * @property {function} exec Excecute request
3027
+ */
3028
+
3029
+ /**
3030
+ * @typedef {Object} PostSnippetsRequest
3031
+ * @property {(snippets: Array<Object>) => PostSnippetsRequest} snippets
3032
+ * @property {function} exec Excecute request
3033
+ */
3034
+
3035
+ /**
3036
+ * @typedef {Object} PutSnippetsRequest
3037
+ * @property {(snippets: Array<Object>) => PutSnippetsRequest} snippets
3038
+ * @property {function} exec Excecute request
3039
+ */
3040
+
3041
+ /**
3042
+ * @typedef {Object} DeleteSnippetsRequest
3043
+ * @property {(id: Array<Integer>) => DeleteSnippetsRequest} id List of identifiers
3044
+ * @property {function} exec Excecute request
3045
+ */
3046
+
2870
3047
  /**
2871
3048
  * @typedef {Object} GetSystemConfigRequest
2872
3049
  * @property {function} exec Excecute request
@@ -3131,7 +3308,7 @@
3131
3308
 
3132
3309
  /**
3133
3310
  * @typedef {Object} GetWmsStocksdocumentsDocumentsRequest
3134
- * @property {(stockDocumentType: 'pz'|'pw'|'px'|'rx'|'rw'|'wz'|'mm'|'wz'|'zw') => GetWmsStocksdocumentsDocumentsRequest} stockDocumentType Document type.
3311
+ * @property {(stockDocumentType: 'pz'|'pw'|'px'|'rx'|'rw'|'wz'|'mm'|'zw') => GetWmsStocksdocumentsDocumentsRequest} stockDocumentType Document type.
3135
3312
  * @property {(stockDocumentStatus: 'open'|'on_the_way'|'close') => GetWmsStocksdocumentsDocumentsRequest} stockDocumentStatus Document status.
3136
3313
  * @property {(stockDocumentsIds: Array<Integer>) => GetWmsStocksdocumentsDocumentsRequest} stockDocumentsIds Document identifier.
3137
3314
  * @property {(stockDocumentsNumbers: Array<String>) => GetWmsStocksdocumentsDocumentsRequest} stockDocumentsNumbers Document number.
@@ -3351,12 +3528,23 @@
3351
3528
  * @property {GetClientsTagsRequest} getClientsTags Use this method to retrieve all tags assigned to a client
3352
3529
  * @property {PostClientsTagsRequest} postClientsTags Use this method to add new tags and their associated values to the client
3353
3530
  * @property {PutClientsTagsRequest} putClientsTags The method is used to update the value of the tags assigned to the client. A tag with value 0 is detached from the client
3531
+ * @property {GetConfigVariablesRequest} getConfigVariables This call returns config variables for given module (type)
3532
+ * @property {PutConfigVariablesRequest} putConfigVariables Use this operation to update snippet campaigns.
3533
+ * @property {DeleteConfigVariablesRequest} deleteConfigVariables This call is used to remove defined configuration variables.
3354
3534
  * @property {GetCouriersAssignedToShippingProfilesRequest} getCouriersAssignedToShippingProfiles Retrieves information about assigned couriers to delivery profiles
3355
3535
  * @property {GetCouriersRequest} getCouriers Method that returns all couriers available for a given country. It also returns information whether the courier service handles personal collections.
3356
3536
  * @property {DeleteCouriersPickupPointsRequest} deleteCouriersPickupPoints The method enables cancelling personal collection points within your own collection points chain. It does not allow for modifying integrated couriers collection points.
3357
3537
  * @property {GetCouriersPickupPointsRequest} getCouriersPickupPoints The method returns personal collection points within its own network of collection points and for integrated couriers.
3358
3538
  * @property {PostCouriersPickupPointsRequest} postCouriersPickupPoints The method enables adding personal collection points within your own collection points chain. It does not allow for modifying integrated couriers collection points.
3359
3539
  * @property {PutCouriersPickupPointsRequest} putCouriersPickupPoints The method enables updating personal collection points within your own collection points chain. It does not allow for modifying integrated couriers collection points.
3540
+ * @property {GetCpaCampaignRequest} getCpaCampaign This call returns all CPA campaigns.
3541
+ * @property {PostCpaCampaignRequest} postCpaCampaign Use this operation to create cpa campaigns.
3542
+ * @property {PutCpaCampaignRequest} putCpaCampaign Use this operation to update CPA campaigns.
3543
+ * @property {DeleteCpaCampaignRequest} deleteCpaCampaign This call is used to remove CPA program campaign.
3544
+ * @property {GetCpaRequest} getCpa This call returns all cpa programs.
3545
+ * @property {PostCpaRequest} postCpa Use this operation to create code snippet.
3546
+ * @property {PutCpaRequest} putCpa Use this operation to update code snippet.
3547
+ * @property {DeleteCpaRequest} deleteCpa This call is used to remove CPA programs.
3360
3548
  * @property {PutDeliveriesDefaultProfilesRequest} putDeliveriesDefaultProfiles The method allows to set the default delivery profile for the given region.
3361
3549
  * @property {GetDeliveriesProfilesRequest} getDeliveriesProfiles Allows to download all of the delivery profiles defined in the administration panel
3362
3550
  * @property {GetDeliveriesRegionsRequest} getDeliveriesRegions The method allows to download a list of regions supporting deliveries.
@@ -3379,6 +3567,7 @@
3379
3567
  * @property {PostEntriesRequest} postEntries Enables adding blog or news entry
3380
3568
  * @property {PutEntriesRequest} putEntries Enables changing blog or news entry in the shop
3381
3569
  * @property {GetEntriesPagesToDisplayRequest} getEntriesPagesToDisplay Allows you to download a list of sites on which a blog entry or a news item can be published.
3570
+ * @property {GetEntriesSourcesRequest} getEntriesSources This call returns all entry sources with options.
3382
3571
  * @property {GetMenuFilterRequest} getMenuFilter The method returns information about filter settings in menu nodes.
3383
3572
  * @property {PutMenuFilterRequest} putMenuFilter The method allows you to manage filter settings in menu nodes.
3384
3573
  * @property {DeleteMenuRequest} deleteMenu Method that enables deleting existing menu elements.
@@ -3392,6 +3581,7 @@
3392
3581
  * @property {PutOrdersCourierRequest} putOrdersCourier Method that enables changing the courier handling the shipment for an order.
3393
3582
  * @property {PutOrdersDeliveryAddressRequest} putOrdersDeliveryAddress Method that enables editing the delivery address details for an order in the administration panel.
3394
3583
  * @property {PutOrdersDevideRequest} putOrdersDevide Method for division order
3584
+ * @property {PostOrdersDocumentsCreateRequest} postOrdersDocumentsCreate The method allows to generate documents to the order in the IdoSell administration panel.
3395
3585
  * @property {DeleteOrdersDocumentsRequest} deleteOrdersDocuments The method allows to delete documents added to the order in the IdoSell administration panel.
3396
3586
  * @property {GetOrdersDocumentsRequest} getOrdersDocuments Method that enables extracting information about documents issued for orders in the administration panel.
3397
3587
  * @property {PostOrdersDocumentsRequest} postOrdersDocuments The method allows to add TIFF, BMP, PNG, JPG, JPEG, GIF or PDF documents to the order in the IdoSell Shop administration panel.
@@ -3537,6 +3727,18 @@
3537
3727
  * @property {PutSizechartsRequest} putSizecharts The method allows the size charts settings to be updated.
3538
3728
  * @property {GetSizesRequest} getSizes Method that returns information about product sizes configured in the administration panel. List of size groups (with sizes that belong to particular group) is returned as a result.
3539
3729
  * @property {PutSizesRequest} putSizes Method that enables creating, deleting and editing product sizes in the administration panel.
3730
+ * @property {GetSnippetsCampaignRequest} getSnippetsCampaign This call returns all snippet campaigns (including deleted ones but to readonly).
3731
+ * @property {PostSnippetsCampaignRequest} postSnippetsCampaign Use this operation to create snippet campaigns.
3732
+ * @property {PutSnippetsCampaignRequest} putSnippetsCampaign Use this operation to update snippet campaigns.
3733
+ * @property {DeleteSnippetsCampaignRequest} deleteSnippetsCampaign This call is used to remove campaign snippets.
3734
+ * @property {GetSnippetsCookiesRequest} getSnippetsCookies This call returns all cookie definitions related to code snippets.
3735
+ * @property {PostSnippetsCookiesRequest} postSnippetsCookies Use this operation to create a cookie definition for a code snippet.
3736
+ * @property {PutSnippetsCookiesRequest} putSnippetsCookies Use this operation to update a cookie definition for a code snippet.
3737
+ * @property {DeleteSnippetsCookiesRequest} deleteSnippetsCookies This call is used to remove campaign cookies.
3738
+ * @property {GetSnippetsRequest} getSnippets This call returns all snippets.
3739
+ * @property {PostSnippetsRequest} postSnippets Use this operation to create code snippet.
3740
+ * @property {PutSnippetsRequest} putSnippets Use this operation to update code snippet.
3741
+ * @property {DeleteSnippetsRequest} deleteSnippets This call is used to remove snippets.
3540
3742
  * @property {GetSystemConfigRequest} getSystemConfig Method is used for extracting information about a shop and its most important configuration settings.
3541
3743
  * @property {PutSystemConfigRequest} putSystemConfig The method is used to manage the most important settings in the store and in the panel. It enables, among others, configuration of tax and billing settings and configuration of warehouse management.
3542
3744
  * @property {GetSystemCurrenciesRequest} getSystemCurrencies This method returns the current exchange rate in relation to the currency set in the administration panel.
package/dist/gates.js CHANGED
@@ -45,12 +45,23 @@ import deleteClientsTags from "./methods/deleteClientsTags.js";
45
45
  import getClientsTags from "./methods/getClientsTags.js";
46
46
  import postClientsTags from "./methods/postClientsTags.js";
47
47
  import putClientsTags from "./methods/putClientsTags.js";
48
+ import getConfigVariables from "./methods/getConfigVariables.js";
49
+ import putConfigVariables from "./methods/putConfigVariables.js";
50
+ import deleteConfigVariables from "./methods/deleteConfigVariables.js";
48
51
  import getCouriersAssignedToShippingProfiles from "./methods/getCouriersAssignedToShippingProfiles.js";
49
52
  import getCouriers from "./methods/getCouriers.js";
50
53
  import deleteCouriersPickupPoints from "./methods/deleteCouriersPickupPoints.js";
51
54
  import getCouriersPickupPoints from "./methods/getCouriersPickupPoints.js";
52
55
  import postCouriersPickupPoints from "./methods/postCouriersPickupPoints.js";
53
56
  import putCouriersPickupPoints from "./methods/putCouriersPickupPoints.js";
57
+ import getCpaCampaign from "./methods/getCpaCampaign.js";
58
+ import postCpaCampaign from "./methods/postCpaCampaign.js";
59
+ import putCpaCampaign from "./methods/putCpaCampaign.js";
60
+ import deleteCpaCampaign from "./methods/deleteCpaCampaign.js";
61
+ import getCpa from "./methods/getCpa.js";
62
+ import postCpa from "./methods/postCpa.js";
63
+ import putCpa from "./methods/putCpa.js";
64
+ import deleteCpa from "./methods/deleteCpa.js";
54
65
  import putDeliveriesDefaultProfiles from "./methods/putDeliveriesDefaultProfiles.js";
55
66
  import getDeliveriesProfiles from "./methods/getDeliveriesProfiles.js";
56
67
  import getDeliveriesRegions from "./methods/getDeliveriesRegions.js";
@@ -73,6 +84,7 @@ import getEntries from "./methods/getEntries.js";
73
84
  import postEntries from "./methods/postEntries.js";
74
85
  import putEntries from "./methods/putEntries.js";
75
86
  import getEntriesPagesToDisplay from "./methods/getEntriesPagesToDisplay.js";
87
+ import getEntriesSources from "./methods/getEntriesSources.js";
76
88
  import getMenuFilter from "./methods/getMenuFilter.js";
77
89
  import putMenuFilter from "./methods/putMenuFilter.js";
78
90
  import deleteMenu from "./methods/deleteMenu.js";
@@ -86,6 +98,7 @@ import putOrdersClient from "./methods/putOrdersClient.js";
86
98
  import putOrdersCourier from "./methods/putOrdersCourier.js";
87
99
  import putOrdersDeliveryAddress from "./methods/putOrdersDeliveryAddress.js";
88
100
  import putOrdersDevide from "./methods/putOrdersDevide.js";
101
+ import postOrdersDocumentsCreate from "./methods/postOrdersDocumentsCreate.js";
89
102
  import deleteOrdersDocuments from "./methods/deleteOrdersDocuments.js";
90
103
  import getOrdersDocuments from "./methods/getOrdersDocuments.js";
91
104
  import postOrdersDocuments from "./methods/postOrdersDocuments.js";
@@ -231,6 +244,18 @@ import getSizecharts from "./methods/getSizecharts.js";
231
244
  import putSizecharts from "./methods/putSizecharts.js";
232
245
  import getSizes from "./methods/getSizes.js";
233
246
  import putSizes from "./methods/putSizes.js";
247
+ import getSnippetsCampaign from "./methods/getSnippetsCampaign.js";
248
+ import postSnippetsCampaign from "./methods/postSnippetsCampaign.js";
249
+ import putSnippetsCampaign from "./methods/putSnippetsCampaign.js";
250
+ import deleteSnippetsCampaign from "./methods/deleteSnippetsCampaign.js";
251
+ import getSnippetsCookies from "./methods/getSnippetsCookies.js";
252
+ import postSnippetsCookies from "./methods/postSnippetsCookies.js";
253
+ import putSnippetsCookies from "./methods/putSnippetsCookies.js";
254
+ import deleteSnippetsCookies from "./methods/deleteSnippetsCookies.js";
255
+ import getSnippets from "./methods/getSnippets.js";
256
+ import postSnippets from "./methods/postSnippets.js";
257
+ import putSnippets from "./methods/putSnippets.js";
258
+ import deleteSnippets from "./methods/deleteSnippets.js";
234
259
  import getSystemConfig from "./methods/getSystemConfig.js";
235
260
  import putSystemConfig from "./methods/putSystemConfig.js";
236
261
  import getSystemCurrencies from "./methods/getSystemCurrencies.js";
@@ -321,12 +346,23 @@ const gates = {
321
346
  getClientsTags,
322
347
  postClientsTags,
323
348
  putClientsTags,
349
+ getConfigVariables,
350
+ putConfigVariables,
351
+ deleteConfigVariables,
324
352
  getCouriersAssignedToShippingProfiles,
325
353
  getCouriers,
326
354
  deleteCouriersPickupPoints,
327
355
  getCouriersPickupPoints,
328
356
  postCouriersPickupPoints,
329
357
  putCouriersPickupPoints,
358
+ getCpaCampaign,
359
+ postCpaCampaign,
360
+ putCpaCampaign,
361
+ deleteCpaCampaign,
362
+ getCpa,
363
+ postCpa,
364
+ putCpa,
365
+ deleteCpa,
330
366
  putDeliveriesDefaultProfiles,
331
367
  getDeliveriesProfiles,
332
368
  getDeliveriesRegions,
@@ -349,6 +385,7 @@ const gates = {
349
385
  postEntries,
350
386
  putEntries,
351
387
  getEntriesPagesToDisplay,
388
+ getEntriesSources,
352
389
  getMenuFilter,
353
390
  putMenuFilter,
354
391
  deleteMenu,
@@ -362,6 +399,7 @@ const gates = {
362
399
  putOrdersCourier,
363
400
  putOrdersDeliveryAddress,
364
401
  putOrdersDevide,
402
+ postOrdersDocumentsCreate,
365
403
  deleteOrdersDocuments,
366
404
  getOrdersDocuments,
367
405
  postOrdersDocuments,
@@ -507,6 +545,18 @@ const gates = {
507
545
  putSizecharts,
508
546
  getSizes,
509
547
  putSizes,
548
+ getSnippetsCampaign,
549
+ postSnippetsCampaign,
550
+ putSnippetsCampaign,
551
+ deleteSnippetsCampaign,
552
+ getSnippetsCookies,
553
+ postSnippetsCookies,
554
+ putSnippetsCookies,
555
+ deleteSnippetsCookies,
556
+ getSnippets,
557
+ postSnippets,
558
+ putSnippets,
559
+ deleteSnippets,
510
560
  getSystemConfig,
511
561
  putSystemConfig,
512
562
  getSystemCurrencies,
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'delete', node: '/config/variables' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'delete', node: '/cpa/cpa' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'delete', node: '/cpa/campaign' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'delete', node: '/snippets/snippets' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'delete', node: '/snippets/campaign' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'delete', node: '/snippets/cookies' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'get', node: '/config/variables' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'get', node: '/cpa/cpa' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'get', node: '/cpa/campaign' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'get', node: '/entries/sources' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'get', node: '/snippets/snippets' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'get', node: '/snippets/campaign' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'get', node: '/snippets/cookies' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'post', node: '/cpa/cpa' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'post', node: '/cpa/campaign' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'post', node: '/orders/documents/create' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'post', node: '/snippets/snippets' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'post', node: '/snippets/campaign' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'post', node: '/snippets/cookies' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'put', node: '/config/variables' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'put', node: '/cpa/cpa' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'put', node: '/cpa/campaign' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'put', node: '/snippets/snippets' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'put', node: '/snippets/campaign' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
@@ -0,0 +1,6 @@
1
+ import { paramsProxy } from "../params.js";
2
+
3
+ export default (object) => {
4
+ object.gate = { method: 'put', node: '/snippets/cookies' };
5
+ return new Proxy(object, paramsProxy);
6
+ }
package/dist/request.js CHANGED
@@ -8,7 +8,7 @@ const DECODE_TABLE = [
8
8
  ]
9
9
 
10
10
  const catchIdosellError = (err) => {
11
- if (err.response.headers['content-type'].indexOf('json') < 0) throw new Error('500: Invalid response from Api gateway');
11
+ if (!err.response.headers['x-error'] &&err.response.headers['content-type'].indexOf('json') < 0) throw new Error('500: Invalid response from Api gateway');
12
12
  let message = err.response.headers['x-error'];
13
13
  for (const [ search, replace ] of DECODE_TABLE) {
14
14
  message = message.replaceAll(search, replace);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "idosell",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "Idosell 3 REST connector",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -0,0 +1,7 @@
1
+ import idosell from "./dist/index.js"
2
+ import { expect, test } from "vitest"
3
+
4
+ test("getEntriesSourcesType", () => {
5
+ const params = idosell().getEntriesSources.type("search").getParams();
6
+ expect(params).toEqual({"type":"search"});
7
+ })
@@ -1,7 +1,7 @@
1
1
  import idosell from "./dist/index.js"
2
2
  import { expect, test } from "vitest"
3
3
 
4
- test("getProductsDeliveryTimeSizeId", () => {
4
+ test("getProductsDeliveryTimeId", () => {
5
5
  const params = idosell().getProductsDeliveryTime.productId(15).sizeId(4).getParams();
6
6
  expect(params).toEqual({"products":[{"productId":15,"sizeId":4}]});
7
7
  })
@@ -0,0 +1,7 @@
1
+ import idosell from "./dist/index.js"
2
+ import { expect, test } from "vitest"
3
+
4
+ test("postOrdersDocumentsCreateActualize", () => {
5
+ const params = idosell().postOrdersDocumentsCreate.orderSerialNumbers([86]).documentType("vat_invoice").actualize(false).getParams();
6
+ expect(params).toEqual({"orderSerialNumbers":[86],"documentType":"vat_invoice","actualize":false});
7
+ })
@@ -1,12 +1,12 @@
1
1
  import idosell from "./dist/index.js"
2
2
  import { expect, test } from "vitest"
3
3
 
4
- test("postReturnsStock_id", () => {
4
+ test("postReturnsFull", () => {
5
5
  const params = idosell().postReturns.order_sn(4).stock_id(1).getParams();
6
6
  expect(params).toEqual({"order_sn":4,"stock_id":1});
7
7
  })
8
8
 
9
- test("postReturnsQuantity", () => {
9
+ test("postReturnsWithProduct", () => {
10
10
  const params = idosell().postReturns.order_sn(4).stock_id(1).id(7).size("U").quantity(1).getParams();
11
11
  expect(params).toEqual({"order_sn":4,"stock_id":1,"products":[{"id":7,"size":"U","quantity":1}]});
12
12
  })