idosell 0.4.32 → 0.4.34

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/changelog.md CHANGED
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.4.34] - 2025-05-27
9
+ ### Fixed
10
+ - Reusing idosell object unintentionally copied some fields
11
+ - Requiremens check failed on falsy (0 or empty string), not only fails when undefined or null
12
+
13
+ ### Changed
14
+ - Fixed missing types
15
+
8
16
  ## [0.4.32] - 2025-05-19
9
17
  ### Changed
10
18
  - Fixed some latest types
package/dist/gates.js CHANGED
@@ -696,6 +696,6 @@ export const gateProxy = {
696
696
  return object;
697
697
  if (!gates[property])
698
698
  throw new Error("Invalid gate: " + property);
699
- return gates[property](object);
699
+ return gates[property]({ ...object, params: {} });
700
700
  }
701
701
  };
package/dist/request.js CHANGED
@@ -117,7 +117,7 @@ const isMissingRequirement = (obj, required) => {
117
117
  return false;
118
118
  }
119
119
  for (const field of required.any) {
120
- if (obj[field])
120
+ if (obj[field] === undefined || obj[field] === null)
121
121
  return false;
122
122
  }
123
123
  return required.any.join(' | ');
@@ -2208,6 +2208,8 @@ export type SearchOrdersResponse = {
2208
2208
  longitude: number;
2209
2209
  /** @description Name. */
2210
2210
  name: string;
2211
+ /** @description Country (2 letter country code). */
2212
+ country: string;
2211
2213
  };
2212
2214
  /** @description Buyer's address data. */
2213
2215
  payerAddress?: {
@@ -2272,7 +2274,11 @@ export type SearchOrdersResponse = {
2272
2274
  /** @description Order status. Allowed values: "finished_ext" - order status: completed in FA application, "finished" - completed, "new" - not handled, "payment_waiting" - awaiting payment, "delivery_waiting" - awaiting delivery, "on_order" - in progress, "packed" - being picked, "packed_fulfillment" - being picked - fulfilment, "packed_ready" - packed, "ready" - ready, "wait_for_dispatch" - awaiting dispatch date, "suspended" - on hold, "joined" - merged, "missing" - missing, "lost" - lost, "false" - false, "canceled" - Customer canceled. */
2273
2275
  orderStatus: string;
2274
2276
  /** @description Order status id. */
2275
- orderStatusId: number;
2277
+ orderStatusId?: number;
2278
+ /** @description Transaction type. */
2279
+ transactionType: null |"national" | "oss" | "export" | "intra";
2280
+ /** @description Split payment MPP marking */
2281
+ splitPayment: boolean;
2276
2282
  /** @example dropshippingOrderStatus */
2277
2283
  dropshippingOrderStatus: string;
2278
2284
  /** @description Type of order confirmation. Confirmations listing: "none" - order unconfirmed , "email" - order confirmed by e-mail, "phone_client" - order confirmed by phone call made by client, "phone_service" - order confirmed by phone call made by staff, "postauction" - order confirmed by auction return page, "willingness" - confirmed by willingness to buy letter, "auctionfod" - confirmed by after-sales form Allegro. */
@@ -4415,7 +4421,7 @@ export type SearchProductsResponse = {
4415
4421
  productSizeQuantity: number;
4416
4422
  }[];
4417
4423
  /** @description Size data */
4418
- productSizesStocksLocations: {
4424
+ productSizesStocksLocations?: {
4419
4425
  /** @description Stock ID */
4420
4426
  stockId: number;
4421
4427
  productSizesLocation: {
@@ -4500,11 +4506,11 @@ export type SearchProductsResponse = {
4500
4506
  /** @description Gross price */
4501
4507
  productRetailPrice: number;
4502
4508
  /** @description Gross price after promotion. The item is returned when the 'showPromotionsPrices' parameter is specified in the request */
4503
- productPromoRetailPrice: number;
4509
+ productPromoRetailPrice?: number;
4504
4510
  /** @description Wholesale price */
4505
4511
  productWholesalePrice: number;
4506
4512
  /** @description Wholesale price after promotion. The item is returned when the 'showPromotionsPrices' parameter is specified in the request */
4507
- productPromoWholesalePrice: number;
4513
+ productPromoWholesalePrice?: number;
4508
4514
  /** @description Minimal price */
4509
4515
  productMinimalPrice: number;
4510
4516
  /** @description Price for automatic calculations */
@@ -4782,7 +4788,7 @@ export type SearchProductsResponse = {
4782
4788
  sizePanelName: string;
4783
4789
  }[];
4784
4790
  /** @description Available sizes of products in a set or collection for marketplaces */
4785
- bundledAvailableSizesInAuctions: {
4791
+ bundledAvailableSizesInAuctions?: {
4786
4792
  /** @description Size identifier */
4787
4793
  sizeId: string;
4788
4794
  /** @description Size name */
@@ -4816,7 +4822,7 @@ export type SearchProductsResponse = {
4816
4822
  }[];
4817
4823
  }[];
4818
4824
  /** @description Parameter values */
4819
- parameterValues?: {
4825
+ parameterValues?: null | {
4820
4826
  /** @description Parameter value ID */
4821
4827
  parameterValueId: number;
4822
4828
  /** @description Language data */
@@ -4976,6 +4982,72 @@ export type SearchProductsResponse = {
4976
4982
  responsiblePersonCode?: string | null;
4977
4983
  /** @description Minimum stock level */
4978
4984
  minStockLevel?: number;
4985
+ productAttachments?: {
4986
+ /** @description Product attachments list. */
4987
+ attachments?: {
4988
+ /** @description Attachment ID. */
4989
+ attachmentId: number;
4990
+ /** @description Attachment name. */
4991
+ attachmentName: string;
4992
+ /** @description Attachment number. */
4993
+ attachmentPriority: number;
4994
+ /** @description Type of customer, attachment should be available for: 'all','ordered','wholesaler','wholesaler_or_ordered','wholesaler_and_ordered'. */
4995
+ attachmentEnable: "all" | "ordered" | "wholesaler" | "wholesaler_or_orderer" | "wholesaler_and_ordered";
4996
+ /** @description File type: audio, video, doc, other. */
4997
+ attachmentFileType: "audio" | "video" | "doc" | "other" | "image";
4998
+ /** @description Attachment file extension. */
4999
+ attachmentFileExtension: string;
5000
+ /** @description Attachment downloads record. */
5001
+ attachmentDownloadLog: "y" | "n";
5002
+ /** @description Language ID */
5003
+ langId: string;
5004
+ /** @description Attachment document types list. */
5005
+ documentTypes?: {
5006
+ /** @description Document type. */
5007
+ documentType: "energy_label" | "instruction_with_safety_information" | "user_manual" | "installation_instructions" | "product_card" | "guide" | "software_data_processing" | "hardware_data_processing" | "others";
5008
+ /** @description Additional description. */
5009
+ documentName: string;
5010
+ /** @description Additional description. */
5011
+ description: string;
5012
+ }[];
5013
+ }[];
5014
+ /** @description List of product's virtual attachments. */
5015
+ virtualAttachments?: {
5016
+ /** @description Attachment ID. */
5017
+ attachmentId: number;
5018
+ /** @description Full version or sample. */
5019
+ attachmentType: "full" | "demo";
5020
+ /** @description Attachment number. */
5021
+ attachmentPriority: number;
5022
+ /** @description Specifies where the attachment content comes from: 'local' for a file uploaded with the request, or 'url' for a remotely hosted file accessible via a URL. */
5023
+ attachmentSourceType: "local" | "url";
5024
+ /** @description File type: audio, video, doc, other. */
5025
+ attachmentFileType: "audio" | "video" | "doc" | "other" | "image";
5026
+ /** @description Attachment file extension. */
5027
+ attachmentFileExtension: string;
5028
+ /** @description Attachment file size in megabytes (MB). */
5029
+ attachmentFileSize: string;
5030
+ /** @description Attachment file hash. */
5031
+ attachmentFileHash: string;
5032
+ /** @description Number of attachment downloads limit. */
5033
+ attachmentLimits: {
5034
+ /** @description Number of downloads limit. */
5035
+ attachmentDownloadsLimit: number;
5036
+ /** @description Number of days file should be available. */
5037
+ attachmentDaysLimit: number;
5038
+ };
5039
+ /** @description Attachment name. */
5040
+ attachmentName: {
5041
+ /** @description List of languages. */
5042
+ attachmentLanguages: {
5043
+ /** @description Language ID */
5044
+ langId: string;
5045
+ /** @description Literal in selected language. */
5046
+ langValue: string;
5047
+ }[];
5048
+ };
5049
+ }[];
5050
+ };
4979
5051
  }[];
4980
5052
  } & PagedResponse;
4981
5053
 
@@ -5964,6 +6036,10 @@ export type PutReturnsSerialNumberResponse = {
5964
6036
  export type GetRmaResponse = {
5965
6037
  /** @description Complaints. */
5966
6038
  rmas: {
6039
+ /** @description Corresponding order serial number */
6040
+ orderSn: number;
6041
+ /** @description Rma currency */
6042
+ currency: string;
5967
6043
  /** @description Complaint id. */
5968
6044
  rmaId: number;
5969
6045
  /** @description Customer's login. */
@@ -6511,6 +6587,8 @@ export type GetSystemConfigResponse = {
6511
6587
  /** @description Configuration of default currency rate for orders */
6512
6588
  currencyRate: "currentDay" | "previousDay" | null;
6513
6589
  };
6590
+ /** @description Whether setting different prices per size is blocked. */
6591
+ sizesDifferentPricesBlocked: boolean;
6514
6592
  };
6515
6593
  panel_literals: {
6516
6594
  /** @description "Reduced price" - name in the panel. */
@@ -6640,7 +6718,7 @@ export type GetSystemConfigResponse = {
6640
6718
  /** @description Name */
6641
6719
  name: string;
6642
6720
  }[];
6643
- product_deliverers: {
6721
+ product_deliverers?: {
6644
6722
  /** @description Id */
6645
6723
  id: number;
6646
6724
  /** @description Name */
@@ -6813,8 +6891,45 @@ export type GetSystemServerTimeResponse = {
6813
6891
  time: number;
6814
6892
  };
6815
6893
 
6816
- export type GetSystemShopsDataResponse = Omit<GetSystemConfigResponse, 'panel_settings'|'shops'> & {
6817
- /** @description Shop contact data */
6894
+ export type GetSystemShopsDataResponse = {
6895
+ /** @description Customer ID. */
6896
+ client_id: number;
6897
+ /** @description Dedicated server. */
6898
+ dedicated_server: boolean;
6899
+ shop_owner_data: {
6900
+ /** @description Full company name. */
6901
+ company_name: string;
6902
+ /** @description Company short name. */
6903
+ company_short_name: string;
6904
+ /** @description NIP [TIN]. */
6905
+ nip: string;
6906
+ /** @description CRN. */
6907
+ regon: string;
6908
+ /** @description no of entry to NCR. */
6909
+ krs: string;
6910
+ /** @example address */
6911
+ address: string;
6912
+ /** @description ZIP / Post code. */
6913
+ zipcode: string;
6914
+ /** @description Town / City. */
6915
+ city: string;
6916
+ /** @description region. */
6917
+ country: string;
6918
+ /** @description VAT registered. */
6919
+ VATRegistered: boolean;
6920
+ };
6921
+ /** @description List of languages configured in the administration panel. */
6922
+ languages: {
6923
+ /** @description Language code. Codes are compliant with ISO-639-3 standard. */
6924
+ lang_id: string;
6925
+ /** @description Language name. */
6926
+ lang_name: string;
6927
+ }[];
6928
+ /** @description Code of default panel language in ISO-639-3 standard. */
6929
+ panel_lang_id_default: string;
6930
+ /** @description Panel base currency ID. */
6931
+ panel_basecurrency_id: string;
6932
+ /** @description Shop contact data */
6818
6933
  shop_contact: {
6819
6934
  /** @description shop ID */
6820
6935
  shop_id: number;
@@ -6830,7 +6945,47 @@ export type GetSystemShopsDataResponse = Omit<GetSystemConfigResponse, 'panel_se
6830
6945
  contact_phone_number: string;
6831
6946
  }[];
6832
6947
  }[];
6833
- panel_settings: ShopsPanelSettings;
6948
+ panel_settings: {
6949
+ /** @description Default panel language. */
6950
+ default_lang_id: string;
6951
+ /** @description Panel base currency. */
6952
+ basecurrency_id: string;
6953
+ /** @description Manual stock quantity modification restriction. */
6954
+ stocks_change_disabled: string;
6955
+ /** */
6956
+ stock_state_config: "uncontrolled" | "bridge" | "outside";
6957
+ /** */
6958
+ main_stock_system: "other" | "iai";
6959
+ /** @description Sales documents in third party application. */
6960
+ salesDocumentsAreCreatedByClient: boolean;
6961
+ search_by_code: {
6962
+ /** @description IAI code. */
6963
+ code_iai: boolean;
6964
+ /** @description External system code. */
6965
+ code_extern: boolean;
6966
+ /** @description Producer code. */
6967
+ code_producer: boolean;
6968
+ };
6969
+ /** @description Whether setting different prices per size is blocked. */
6970
+ sizesDifferentPricesBlocked: boolean;
6971
+ };
6972
+ panel_literals: {
6973
+ /** @description "Reduced price" - name in the panel. */
6974
+ promotion: string;
6975
+ /** @description "Sale" - name in panel. */
6976
+ discount: string;
6977
+ /** @description "Distinguished product" - name in panel. */
6978
+ distinguished: string;
6979
+ /** @description "Warranty" - name in shop. */
6980
+ warranty: string;
6981
+ };
6982
+ /** @description List of warehouses. */
6983
+ stocks: {
6984
+ /** @description Stock ID. */
6985
+ stock_id: number;
6986
+ /** @description Stock name. */
6987
+ stock_name: string;
6988
+ }[];
6834
6989
  /** @description List of stores. */
6835
6990
  shops: {
6836
6991
  /** @description Shop Id. */
@@ -6844,7 +6999,7 @@ export type GetSystemShopsDataResponse = Omit<GetSystemConfigResponse, 'panel_se
6844
6999
  active_price_comparers: {
6845
7000
  /** @example 1 */
6846
7001
  id: number;
6847
- /* @description Default price difference. */
7002
+ /** @description Default price difference. */
6848
7003
  default_price_percent_diff: number;
6849
7004
  }[];
6850
7005
  /** @description Url to default product icon. */
@@ -6895,6 +7050,146 @@ export type GetSystemShopsDataResponse = Omit<GetSystemConfigResponse, 'panel_se
6895
7050
  active: boolean;
6896
7051
  };
6897
7052
  }[];
7053
+ /** @description List of size units. */
7054
+ units: {
7055
+ /** @description Unit of measure ID. */
7056
+ unit_id: number;
7057
+ /** @description Unit of measure name in panel. */
7058
+ unit_name: string;
7059
+ /** @description Accuracy (number of places after comma). */
7060
+ unit_precision: number;
7061
+ /** @description Object determines unit visibility in panel. List of values: "y" - unit visible in panel, "n" - unit invisible in panel. */
7062
+ unit_visible: string;
7063
+ lang_data: {
7064
+ /** @description Language code. Codes are compliant with ISO-639-3 standard. */
7065
+ lang_id: string;
7066
+ /** @description Name (singular). */
7067
+ singular_name: string;
7068
+ /** @description Name (plural). */
7069
+ plural_name: string;
7070
+ /** @description Name (by fractions). */
7071
+ fraction_name: string;
7072
+ }[];
7073
+ }[];
7074
+ /** @description List of warranties. */
7075
+ warranties: {
7076
+ /** @example 1 */
7077
+ id: number;
7078
+ /** @example name */
7079
+ name: string;
7080
+ }[];
7081
+ /** @description List of parcel delivery companies. */
7082
+ deliverers: {
7083
+ /** @example 1 */
7084
+ id: number;
7085
+ /** @example name */
7086
+ name: string;
7087
+ }[];
7088
+ product_deliverers?: {
7089
+ /** @example 1 */
7090
+ id: number;
7091
+ /** @example name */
7092
+ name: string;
7093
+ }[];
7094
+ vat_rates: {
7095
+ /** @example 1 */
7096
+ id: number;
7097
+ /** @description VAT rate value. */
7098
+ value: number;
7099
+ }[];
7100
+ auction_systems?: {
7101
+ /** @description Auction system ID. */
7102
+ auction_id: number;
7103
+ /** @description Auction site ID. */
7104
+ site_id: number;
7105
+ /** @description Auction site currency ID. */
7106
+ currency_id: string;
7107
+ /** @description Auction site description. */
7108
+ description: string;
7109
+ }[];
7110
+ availability_profiles: {
7111
+ /** @example 1 */
7112
+ id: number;
7113
+ /** @example name */
7114
+ name: string;
7115
+ }[];
7116
+ rebate_profiles: {
7117
+ /** @example 1 */
7118
+ id: number;
7119
+ /** @example name */
7120
+ name: string;
7121
+ }[];
7122
+ pictures_settings: {
7123
+ /** @description Object determines if the product icon should be scaled. List of values: "y" - icon is scaled, "n" - icon is unscaled. */
7124
+ icon_resize: string;
7125
+ /** @description Graphic quality in percent (0-100). . "0" - the worst quality, "100" - the best quality (no compression). */
7126
+ icon_quality: number;
7127
+ /** @description Large icon width in pixels. */
7128
+ icon_large_width: number;
7129
+ /** @description Large icon height in pixels. */
7130
+ icon_large_height: number;
7131
+ /** @description Small icon width in pixels. */
7132
+ icon_small_width: number;
7133
+ /** @description Small icon height in pixels. */
7134
+ icon_small_height: number;
7135
+ /** @description Width of an icon on the marketplaces. */
7136
+ auction_icon_height: number;
7137
+ /** @description Hight of an icon on the marketplaces. */
7138
+ auction_icon_width: number;
7139
+ /** @description Group icon width in pixels. */
7140
+ group_icon_height: number;
7141
+ /** @description Group icon height in pixels. */
7142
+ group_icon_width: number;
7143
+ /** @description Photo quality in percents (0-100). "0" - the worst quality, "100" - the best quality (no compression). */
7144
+ picture_quality: number;
7145
+ /** @description Large photo width in pixels. */
7146
+ picture_large_width: number;
7147
+ /** @description Large photo height in pixels. */
7148
+ picture_large_height: number;
7149
+ /** @description Medium photo width in pixels. */
7150
+ picture_medium_width: number;
7151
+ /** @description Medium photo height in pixels. */
7152
+ picture_medium_height: number;
7153
+ /** @description Small photo width in pixels. */
7154
+ picture_small_width: number;
7155
+ /** @description Small photo height in pixels. */
7156
+ picture_small_height: number;
7157
+ };
7158
+ price_comparers: never[] | Record<string, {
7159
+ /** @example 1 */
7160
+ id?: number;
7161
+ /** @example key */
7162
+ key?: string;
7163
+ /** @example name */
7164
+ name?: string;
7165
+ /** @description Information about whether price comparison service is active. */
7166
+ active?: string}>;
7167
+ /** @description Content of the column "Product or service name" on sales documents. */
7168
+ inv_prod_name_templace: string;
7169
+ /** @description List of document printers. */
7170
+ printers: {
7171
+ /** @example 1 */
7172
+ id: number;
7173
+ /** @example name */
7174
+ name: string;
7175
+ /** @example address */
7176
+ address: string;
7177
+ /** @example key */
7178
+ key: string;
7179
+ }[];
7180
+ /** @description List of fiscal printers. */
7181
+ fiscal_printers: {
7182
+ /** @example 1 */
7183
+ id: number;
7184
+ /** @example name */
7185
+ name: string;
7186
+ /** @example address */
7187
+ address: string;
7188
+ /** @example key */
7189
+ key: string;
7190
+ }[];
7191
+ /** @description Monitoring address protocol from the main Printer window. */
7192
+ typeOfPrinterProtocolAdress: string;
6898
7193
  };
6899
7194
 
6900
7195
  export type GetSystemUnitsResponse = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "idosell",
3
- "version": "0.4.32",
3
+ "version": "0.4.34",
4
4
  "description": "Idosell 3 REST connector",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/gateways.d.ts",