fattureincloud_ruby_sdk 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (741) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +5 -0
  3. data/Gemfile +9 -0
  4. data/LICENSE +21 -0
  5. data/README.md +421 -0
  6. data/Rakefile +10 -0
  7. data/docs/ArchiveApi.md +464 -0
  8. data/docs/ArchiveDocument.md +13 -0
  9. data/docs/CashbookApi.md +388 -0
  10. data/docs/CashbookEntry.md +49 -0
  11. data/docs/CashbookEntryData.md +14 -0
  12. data/docs/CashbookEntryDataDocument.md +10 -0
  13. data/docs/CashbookEntryIn.md +16 -0
  14. data/docs/CashbookEntryInData.md +9 -0
  15. data/docs/CashbookEntryInOut.md +18 -0
  16. data/docs/CashbookEntryKind.md +7 -0
  17. data/docs/CashbookEntryOut.md +16 -0
  18. data/docs/CashbookEntryOutData.md +9 -0
  19. data/docs/CashbookEntryType.md +7 -0
  20. data/docs/City.md +10 -0
  21. data/docs/Client.md +39 -0
  22. data/docs/ClientType.md +7 -0
  23. data/docs/ClientsApi.md +388 -0
  24. data/docs/CompaniesApi.md +77 -0
  25. data/docs/Company.md +14 -0
  26. data/docs/CompanyInfo.md +15 -0
  27. data/docs/CompanyInfoAccessInfo.md +10 -0
  28. data/docs/CompanyInfoPlanInfo.md +10 -0
  29. data/docs/CompanyInfoPlanInfoFunctions.md +25 -0
  30. data/docs/CompanyInfoPlanInfoFunctionsStatus.md +9 -0
  31. data/docs/CompanyInfoPlanInfoLimits.md +11 -0
  32. data/docs/CompanyType.md +7 -0
  33. data/docs/CreateArchiveDocumentRequest.md +8 -0
  34. data/docs/CreateArchiveDocumentResponse.md +8 -0
  35. data/docs/CreateCashbookEntryRequest.md +8 -0
  36. data/docs/CreateCashbookEntryResponse.md +8 -0
  37. data/docs/CreateClientRequest.md +8 -0
  38. data/docs/CreateClientResponse.md +8 -0
  39. data/docs/CreateF24Request.md +8 -0
  40. data/docs/CreateF24Response.md +8 -0
  41. data/docs/CreateIssuedDocumentRequest.md +8 -0
  42. data/docs/CreateIssuedDocumentResponse.md +8 -0
  43. data/docs/CreatePaymentAccountRequest.md +8 -0
  44. data/docs/CreatePaymentAccountResponse.md +8 -0
  45. data/docs/CreatePaymentMethodRequest.md +8 -0
  46. data/docs/CreatePaymentMethodResponse.md +8 -0
  47. data/docs/CreateProductRequest.md +8 -0
  48. data/docs/CreateProductResponse.md +8 -0
  49. data/docs/CreateReceiptRequest.md +9 -0
  50. data/docs/CreateReceiptResponse.md +8 -0
  51. data/docs/CreateReceivedDocumentRequest.md +9 -0
  52. data/docs/CreateReceivedDocumentResponse.md +8 -0
  53. data/docs/CreateSupplierRequest.md +8 -0
  54. data/docs/CreateSupplierResponse.md +8 -0
  55. data/docs/CreateVatTypeRequest.md +8 -0
  56. data/docs/CreateVatTypeResponse.md +8 -0
  57. data/docs/Currency.md +11 -0
  58. data/docs/DefaultPaymentTermsType.md +7 -0
  59. data/docs/DocumentTemplate.md +10 -0
  60. data/docs/EmailData.md +18 -0
  61. data/docs/EmailDataDefaultSenderEmail.md +9 -0
  62. data/docs/EmailDataSenderEmailsList.md +9 -0
  63. data/docs/EmailSchedule.md +15 -0
  64. data/docs/EmailScheduleInclude.md +11 -0
  65. data/docs/Entity.md +49 -0
  66. data/docs/F24.md +15 -0
  67. data/docs/F24Status.md +7 -0
  68. data/docs/FunctionStatus.md +8 -0
  69. data/docs/GetArchiveDocumentResponse.md +8 -0
  70. data/docs/GetCashbookEntryResponse.md +8 -0
  71. data/docs/GetClientResponse.md +8 -0
  72. data/docs/GetCompanyInfoResponse.md +8 -0
  73. data/docs/GetEmailDataResponse.md +8 -0
  74. data/docs/GetExistingIssuedDocumentTotalsRequest.md +8 -0
  75. data/docs/GetExistingIssuedDocumentTotalsResponse.md +8 -0
  76. data/docs/GetExistingReceivedDocumentTotalsRequest.md +8 -0
  77. data/docs/GetExistingReceivedDocumentTotalsResponse.md +8 -0
  78. data/docs/GetF24Response.md +8 -0
  79. data/docs/GetIssuedDocumentPreCreateInfoResponse.md +8 -0
  80. data/docs/GetIssuedDocumentResponse.md +8 -0
  81. data/docs/GetNewIssuedDocumentTotalsRequest.md +8 -0
  82. data/docs/GetNewIssuedDocumentTotalsResponse.md +8 -0
  83. data/docs/GetNewReceivedDocumentTotalsRequest.md +8 -0
  84. data/docs/GetNewReceivedDocumentTotalsResponse.md +8 -0
  85. data/docs/GetPaymentAccountResponse.md +8 -0
  86. data/docs/GetPaymentMethodResponse.md +8 -0
  87. data/docs/GetProductResponse.md +8 -0
  88. data/docs/GetReceiptPreCreateInfoResponse.md +8 -0
  89. data/docs/GetReceiptResponse.md +8 -0
  90. data/docs/GetReceiptsMonthlyTotalsResponse.md +8 -0
  91. data/docs/GetReceivedDocumentPreCreateInfoResponse.md +8 -0
  92. data/docs/GetReceivedDocumentResponse.md +8 -0
  93. data/docs/GetSupplierResponse.md +8 -0
  94. data/docs/GetUserInfoResponse.md +10 -0
  95. data/docs/GetUserInfoResponseEmailConfirmationState.md +8 -0
  96. data/docs/GetUserInfoResponseInfo.md +10 -0
  97. data/docs/GetVatTypeResponse.md +8 -0
  98. data/docs/InfoApi.md +1072 -0
  99. data/docs/IssuedDocument.md +84 -0
  100. data/docs/IssuedDocumentEiData.md +19 -0
  101. data/docs/IssuedDocumentExtraData.md +20 -0
  102. data/docs/IssuedDocumentItemsList.md +23 -0
  103. data/docs/IssuedDocumentPaymentsList.md +13 -0
  104. data/docs/IssuedDocumentPreCreateInfo.md +20 -0
  105. data/docs/IssuedDocumentPreCreateInfoDefaultValues.md +18 -0
  106. data/docs/IssuedDocumentPreCreateInfoExtraDataDefaultValues.md +11 -0
  107. data/docs/IssuedDocumentPreCreateInfoItemsDefaultValues.md +8 -0
  108. data/docs/IssuedDocumentRefersTo.md +12 -0
  109. data/docs/IssuedDocumentStatus.md +7 -0
  110. data/docs/IssuedDocumentTotals.md +24 -0
  111. data/docs/IssuedDocumentTotalsVatList.md +8 -0
  112. data/docs/IssuedDocumentTotalsVatListVatItem.md +9 -0
  113. data/docs/IssuedDocumentType.md +7 -0
  114. data/docs/IssuedDocumentsApi.md +906 -0
  115. data/docs/IssuedEInvoicesApi.md +155 -0
  116. data/docs/Language.md +9 -0
  117. data/docs/ListArchiveCategoriesResponse.md +8 -0
  118. data/docs/ListArchiveDocumentsResponse.md +19 -0
  119. data/docs/ListArchiveDocumentsResponsePage.md +8 -0
  120. data/docs/ListCashbookEntriesResponse.md +8 -0
  121. data/docs/ListCitiesResponse.md +8 -0
  122. data/docs/ListClientsResponse.md +19 -0
  123. data/docs/ListClientsResponsePage.md +8 -0
  124. data/docs/ListCostCentersResponse.md +8 -0
  125. data/docs/ListCountriesResponse.md +8 -0
  126. data/docs/ListCurrenciesResponse.md +8 -0
  127. data/docs/ListDeliveryNotesDefaultCausalsResponse.md +8 -0
  128. data/docs/ListF24Response.md +20 -0
  129. data/docs/ListF24ResponseAggregatedData.md +8 -0
  130. data/docs/ListF24ResponseAggregatedDataAggregatedData.md +8 -0
  131. data/docs/ListF24ResponsePage.md +8 -0
  132. data/docs/ListIssuedDocumentsResponse.md +19 -0
  133. data/docs/ListIssuedDocumentsResponsePage.md +8 -0
  134. data/docs/ListLanguagesResponse.md +8 -0
  135. data/docs/ListPaymentAccountsResponse.md +8 -0
  136. data/docs/ListPaymentMethodsResponse.md +8 -0
  137. data/docs/ListProductCategoriesResponse.md +8 -0
  138. data/docs/ListProductsResponse.md +19 -0
  139. data/docs/ListProductsResponsePage.md +8 -0
  140. data/docs/ListReceiptsResponse.md +19 -0
  141. data/docs/ListReceiptsResponsePage.md +8 -0
  142. data/docs/ListReceivedDocumentCategoriesResponse.md +8 -0
  143. data/docs/ListReceivedDocumentsResponse.md +19 -0
  144. data/docs/ListReceivedDocumentsResponsePage.md +8 -0
  145. data/docs/ListRevenueCentersResponse.md +8 -0
  146. data/docs/ListSuppliersResponse.md +19 -0
  147. data/docs/ListSuppliersResponsePage.md +8 -0
  148. data/docs/ListTemplatesResponse.md +8 -0
  149. data/docs/ListUnitsOfMeasureResponse.md +8 -0
  150. data/docs/ListUserCompaniesResponse.md +8 -0
  151. data/docs/ListUserCompaniesResponseData.md +8 -0
  152. data/docs/ListVatTypesResponse.md +8 -0
  153. data/docs/ModifyArchiveDocumentRequest.md +8 -0
  154. data/docs/ModifyArchiveDocumentResponse.md +8 -0
  155. data/docs/ModifyCashbookEntryRequest.md +8 -0
  156. data/docs/ModifyCashbookEntryResponse.md +8 -0
  157. data/docs/ModifyClientRequest.md +8 -0
  158. data/docs/ModifyClientResponse.md +8 -0
  159. data/docs/ModifyF24Request.md +8 -0
  160. data/docs/ModifyF24Response.md +8 -0
  161. data/docs/ModifyIssuedDocumentRequest.md +8 -0
  162. data/docs/ModifyIssuedDocumentResponse.md +8 -0
  163. data/docs/ModifyPaymentAccountRequest.md +8 -0
  164. data/docs/ModifyPaymentAccountResponse.md +8 -0
  165. data/docs/ModifyPaymentMethodRequest.md +8 -0
  166. data/docs/ModifyPaymentMethodResponse.md +8 -0
  167. data/docs/ModifyProductRequest.md +8 -0
  168. data/docs/ModifyProductResponse.md +8 -0
  169. data/docs/ModifyReceiptRequest.md +8 -0
  170. data/docs/ModifyReceiptResponse.md +8 -0
  171. data/docs/ModifyReceivedDocumentRequest.md +8 -0
  172. data/docs/ModifyReceivedDocumentResponse.md +8 -0
  173. data/docs/ModifySupplierRequest.md +8 -0
  174. data/docs/ModifySupplierResponse.md +8 -0
  175. data/docs/ModifyVatTypeRequest.md +8 -0
  176. data/docs/ModifyVatTypeResponse.md +8 -0
  177. data/docs/MonthlyTotal.md +10 -0
  178. data/docs/OriginalDocumentType.md +7 -0
  179. data/docs/Pagination.md +18 -0
  180. data/docs/PaymentAccount.md +14 -0
  181. data/docs/PaymentAccountType.md +7 -0
  182. data/docs/PaymentMethod.md +17 -0
  183. data/docs/PaymentMethodDetails.md +9 -0
  184. data/docs/PaymentMethodType.md +7 -0
  185. data/docs/PermissionLevel.md +7 -0
  186. data/docs/Permissions.md +32 -0
  187. data/docs/PermissionsFicIssuedDocumentsDetailed.md +17 -0
  188. data/docs/Product.md +26 -0
  189. data/docs/ProductsApi.md +388 -0
  190. data/docs/Receipt.md +22 -0
  191. data/docs/ReceiptItemsListItem.md +12 -0
  192. data/docs/ReceiptPreCreateInfo.md +13 -0
  193. data/docs/ReceiptType.md +7 -0
  194. data/docs/ReceiptsApi.md +532 -0
  195. data/docs/ReceivedDocument.md +33 -0
  196. data/docs/ReceivedDocumentEntity.md +9 -0
  197. data/docs/ReceivedDocumentInfo.md +14 -0
  198. data/docs/ReceivedDocumentInfoDefaultValues.md +8 -0
  199. data/docs/ReceivedDocumentInfoItemsDefaultValues.md +8 -0
  200. data/docs/ReceivedDocumentItemsList.md +17 -0
  201. data/docs/ReceivedDocumentPaymentTerms.md +9 -0
  202. data/docs/ReceivedDocumentPaymentsList.md +14 -0
  203. data/docs/ReceivedDocumentTotals.md +14 -0
  204. data/docs/ReceivedDocumentType.md +7 -0
  205. data/docs/ReceivedDocumentsApi.md +759 -0
  206. data/docs/ScheduleEmailRequest.md +8 -0
  207. data/docs/SendEInvoiceRequest.md +8 -0
  208. data/docs/SendEInvoiceRequestData.md +9 -0
  209. data/docs/SendEInvoiceResponse.md +8 -0
  210. data/docs/SendEInvoiceResponseData.md +9 -0
  211. data/docs/SettingsApi.md +898 -0
  212. data/docs/ShowTotalsMode.md +7 -0
  213. data/docs/Supplier.md +29 -0
  214. data/docs/SupplierType.md +7 -0
  215. data/docs/SuppliersApi.md +388 -0
  216. data/docs/TaxesApi.md +535 -0
  217. data/docs/UploadArchiveAttachmentResponse.md +8 -0
  218. data/docs/UploadF24AttachmentResponse.md +8 -0
  219. data/docs/UploadIssuedDocumentAttachmentResponse.md +8 -0
  220. data/docs/UploadIssuedDocumentAttachmentResponseData.md +8 -0
  221. data/docs/UploadReceivedDocumentAttachmentResponse.md +8 -0
  222. data/docs/UploadReceivedDocumentAttachmentResponseData.md +8 -0
  223. data/docs/User.md +14 -0
  224. data/docs/UserApi.md +141 -0
  225. data/docs/UserCompanyRole.md +7 -0
  226. data/docs/VatKind.md +7 -0
  227. data/docs/VatType.md +16 -0
  228. data/docs/VerifyEInvoiceXmlErrorResponse.md +9 -0
  229. data/docs/VerifyEInvoiceXmlErrorResponseError.md +9 -0
  230. data/docs/VerifyEInvoiceXmlErrorResponseExtra.md +8 -0
  231. data/docs/VerifyEInvoiceXmlResponse.md +8 -0
  232. data/docs/VerifyEInvoiceXmlResponseData.md +8 -0
  233. data/fattureincloud_ruby_sdk.gemspec +38 -0
  234. data/lib/fattureincloud_ruby_sdk/api/archive_api.rb +470 -0
  235. data/lib/fattureincloud_ruby_sdk/api/cashbook_api.rb +404 -0
  236. data/lib/fattureincloud_ruby_sdk/api/clients_api.rb +396 -0
  237. data/lib/fattureincloud_ruby_sdk/api/companies_api.rb +85 -0
  238. data/lib/fattureincloud_ruby_sdk/api/info_api.rb +986 -0
  239. data/lib/fattureincloud_ruby_sdk/api/issued_documents_api.rb +913 -0
  240. data/lib/fattureincloud_ruby_sdk/api/issued_e_invoices_api.rb +167 -0
  241. data/lib/fattureincloud_ruby_sdk/api/products_api.rb +396 -0
  242. data/lib/fattureincloud_ruby_sdk/api/receipts_api.rb +541 -0
  243. data/lib/fattureincloud_ruby_sdk/api/received_documents_api.rb +770 -0
  244. data/lib/fattureincloud_ruby_sdk/api/settings_api.rb +888 -0
  245. data/lib/fattureincloud_ruby_sdk/api/suppliers_api.rb +396 -0
  246. data/lib/fattureincloud_ruby_sdk/api/taxes_api.rb +537 -0
  247. data/lib/fattureincloud_ruby_sdk/api/user_api.rb +136 -0
  248. data/lib/fattureincloud_ruby_sdk/api_client.rb +390 -0
  249. data/lib/fattureincloud_ruby_sdk/api_error.rb +57 -0
  250. data/lib/fattureincloud_ruby_sdk/configuration.rb +278 -0
  251. data/lib/fattureincloud_ruby_sdk/models/archive_document.rb +284 -0
  252. data/lib/fattureincloud_ruby_sdk/models/cashbook_entry.rb +105 -0
  253. data/lib/fattureincloud_ruby_sdk/models/cashbook_entry_data.rb +302 -0
  254. data/lib/fattureincloud_ruby_sdk/models/cashbook_entry_data_document.rb +239 -0
  255. data/lib/fattureincloud_ruby_sdk/models/cashbook_entry_in.rb +330 -0
  256. data/lib/fattureincloud_ruby_sdk/models/cashbook_entry_in_data.rb +229 -0
  257. data/lib/fattureincloud_ruby_sdk/models/cashbook_entry_in_out.rb +350 -0
  258. data/lib/fattureincloud_ruby_sdk/models/cashbook_entry_kind.rb +40 -0
  259. data/lib/fattureincloud_ruby_sdk/models/cashbook_entry_out.rb +330 -0
  260. data/lib/fattureincloud_ruby_sdk/models/cashbook_entry_out_data.rb +229 -0
  261. data/lib/fattureincloud_ruby_sdk/models/cashbook_entry_type.rb +37 -0
  262. data/lib/fattureincloud_ruby_sdk/models/city.rb +254 -0
  263. data/lib/fattureincloud_ruby_sdk/models/client.rb +537 -0
  264. data/lib/fattureincloud_ruby_sdk/models/client_type.rb +39 -0
  265. data/lib/fattureincloud_ruby_sdk/models/company.rb +281 -0
  266. data/lib/fattureincloud_ruby_sdk/models/company_info.rb +288 -0
  267. data/lib/fattureincloud_ruby_sdk/models/company_info_access_info.rb +236 -0
  268. data/lib/fattureincloud_ruby_sdk/models/company_info_plan_info.rb +236 -0
  269. data/lib/fattureincloud_ruby_sdk/models/company_info_plan_info_functions.rb +373 -0
  270. data/lib/fattureincloud_ruby_sdk/models/company_info_plan_info_functions_status.rb +227 -0
  271. data/lib/fattureincloud_ruby_sdk/models/company_info_plan_info_limits.rb +246 -0
  272. data/lib/fattureincloud_ruby_sdk/models/company_type.rb +37 -0
  273. data/lib/fattureincloud_ruby_sdk/models/create_archive_document_request.rb +219 -0
  274. data/lib/fattureincloud_ruby_sdk/models/create_archive_document_response.rb +219 -0
  275. data/lib/fattureincloud_ruby_sdk/models/create_cashbook_entry_request.rb +219 -0
  276. data/lib/fattureincloud_ruby_sdk/models/create_cashbook_entry_response.rb +219 -0
  277. data/lib/fattureincloud_ruby_sdk/models/create_client_request.rb +218 -0
  278. data/lib/fattureincloud_ruby_sdk/models/create_client_response.rb +218 -0
  279. data/lib/fattureincloud_ruby_sdk/models/create_f24_request.rb +219 -0
  280. data/lib/fattureincloud_ruby_sdk/models/create_f24_response.rb +219 -0
  281. data/lib/fattureincloud_ruby_sdk/models/create_issued_document_request.rb +218 -0
  282. data/lib/fattureincloud_ruby_sdk/models/create_issued_document_response.rb +218 -0
  283. data/lib/fattureincloud_ruby_sdk/models/create_payment_account_request.rb +219 -0
  284. data/lib/fattureincloud_ruby_sdk/models/create_payment_account_response.rb +219 -0
  285. data/lib/fattureincloud_ruby_sdk/models/create_payment_method_request.rb +218 -0
  286. data/lib/fattureincloud_ruby_sdk/models/create_payment_method_response.rb +218 -0
  287. data/lib/fattureincloud_ruby_sdk/models/create_product_request.rb +218 -0
  288. data/lib/fattureincloud_ruby_sdk/models/create_product_response.rb +218 -0
  289. data/lib/fattureincloud_ruby_sdk/models/create_receipt_request.rb +229 -0
  290. data/lib/fattureincloud_ruby_sdk/models/create_receipt_response.rb +219 -0
  291. data/lib/fattureincloud_ruby_sdk/models/create_received_document_request.rb +234 -0
  292. data/lib/fattureincloud_ruby_sdk/models/create_received_document_response.rb +219 -0
  293. data/lib/fattureincloud_ruby_sdk/models/create_supplier_request.rb +218 -0
  294. data/lib/fattureincloud_ruby_sdk/models/create_supplier_response.rb +218 -0
  295. data/lib/fattureincloud_ruby_sdk/models/create_vat_type_request.rb +219 -0
  296. data/lib/fattureincloud_ruby_sdk/models/create_vat_type_response.rb +219 -0
  297. data/lib/fattureincloud_ruby_sdk/models/currency.rb +251 -0
  298. data/lib/fattureincloud_ruby_sdk/models/default_payment_terms_type.rb +37 -0
  299. data/lib/fattureincloud_ruby_sdk/models/document_template.rb +239 -0
  300. data/lib/fattureincloud_ruby_sdk/models/email_data.rb +376 -0
  301. data/lib/fattureincloud_ruby_sdk/models/email_data_default_sender_email.rb +240 -0
  302. data/lib/fattureincloud_ruby_sdk/models/email_data_sender_emails_list.rb +239 -0
  303. data/lib/fattureincloud_ruby_sdk/models/email_schedule.rb +318 -0
  304. data/lib/fattureincloud_ruby_sdk/models/email_schedule_include.rb +269 -0
  305. data/lib/fattureincloud_ruby_sdk/models/entity.rb +105 -0
  306. data/lib/fattureincloud_ruby_sdk/models/f24.rb +305 -0
  307. data/lib/fattureincloud_ruby_sdk/models/f24_status.rb +38 -0
  308. data/lib/fattureincloud_ruby_sdk/models/function_status.rb +218 -0
  309. data/lib/fattureincloud_ruby_sdk/models/get_archive_document_response.rb +219 -0
  310. data/lib/fattureincloud_ruby_sdk/models/get_cashbook_entry_response.rb +219 -0
  311. data/lib/fattureincloud_ruby_sdk/models/get_client_response.rb +218 -0
  312. data/lib/fattureincloud_ruby_sdk/models/get_company_info_response.rb +219 -0
  313. data/lib/fattureincloud_ruby_sdk/models/get_email_data_response.rb +218 -0
  314. data/lib/fattureincloud_ruby_sdk/models/get_existing_issued_document_totals_request.rb +218 -0
  315. data/lib/fattureincloud_ruby_sdk/models/get_existing_issued_document_totals_response.rb +219 -0
  316. data/lib/fattureincloud_ruby_sdk/models/get_existing_received_document_totals_request.rb +219 -0
  317. data/lib/fattureincloud_ruby_sdk/models/get_existing_received_document_totals_response.rb +219 -0
  318. data/lib/fattureincloud_ruby_sdk/models/get_f24_response.rb +218 -0
  319. data/lib/fattureincloud_ruby_sdk/models/get_issued_document_pre_create_info_response.rb +218 -0
  320. data/lib/fattureincloud_ruby_sdk/models/get_issued_document_response.rb +218 -0
  321. data/lib/fattureincloud_ruby_sdk/models/get_new_issued_document_totals_request.rb +218 -0
  322. data/lib/fattureincloud_ruby_sdk/models/get_new_issued_document_totals_response.rb +219 -0
  323. data/lib/fattureincloud_ruby_sdk/models/get_new_received_document_totals_request.rb +219 -0
  324. data/lib/fattureincloud_ruby_sdk/models/get_new_received_document_totals_response.rb +219 -0
  325. data/lib/fattureincloud_ruby_sdk/models/get_payment_account_response.rb +219 -0
  326. data/lib/fattureincloud_ruby_sdk/models/get_payment_method_response.rb +218 -0
  327. data/lib/fattureincloud_ruby_sdk/models/get_product_response.rb +218 -0
  328. data/lib/fattureincloud_ruby_sdk/models/get_receipt_pre_create_info_response.rb +219 -0
  329. data/lib/fattureincloud_ruby_sdk/models/get_receipt_response.rb +219 -0
  330. data/lib/fattureincloud_ruby_sdk/models/get_receipts_monthly_totals_response.rb +221 -0
  331. data/lib/fattureincloud_ruby_sdk/models/get_received_document_pre_create_info_response.rb +219 -0
  332. data/lib/fattureincloud_ruby_sdk/models/get_received_document_response.rb +219 -0
  333. data/lib/fattureincloud_ruby_sdk/models/get_supplier_response.rb +218 -0
  334. data/lib/fattureincloud_ruby_sdk/models/get_user_info_response.rb +237 -0
  335. data/lib/fattureincloud_ruby_sdk/models/get_user_info_response_email_confirmation_state.rb +218 -0
  336. data/lib/fattureincloud_ruby_sdk/models/get_user_info_response_info.rb +236 -0
  337. data/lib/fattureincloud_ruby_sdk/models/get_vat_type_response.rb +219 -0
  338. data/lib/fattureincloud_ruby_sdk/models/issued_document.rb +1114 -0
  339. data/lib/fattureincloud_ruby_sdk/models/issued_document_ei_data.rb +342 -0
  340. data/lib/fattureincloud_ruby_sdk/models/issued_document_extra_data.rb +342 -0
  341. data/lib/fattureincloud_ruby_sdk/models/issued_document_items_list.rb +400 -0
  342. data/lib/fattureincloud_ruby_sdk/models/issued_document_payments_list.rb +271 -0
  343. data/lib/fattureincloud_ruby_sdk/models/issued_document_pre_create_info.rb +352 -0
  344. data/lib/fattureincloud_ruby_sdk/models/issued_document_pre_create_info_default_values.rb +316 -0
  345. data/lib/fattureincloud_ruby_sdk/models/issued_document_pre_create_info_extra_data_default_values.rb +245 -0
  346. data/lib/fattureincloud_ruby_sdk/models/issued_document_pre_create_info_items_default_values.rb +220 -0
  347. data/lib/fattureincloud_ruby_sdk/models/issued_document_refers_to.rb +260 -0
  348. data/lib/fattureincloud_ruby_sdk/models/issued_document_status.rb +38 -0
  349. data/lib/fattureincloud_ruby_sdk/models/issued_document_totals.rb +408 -0
  350. data/lib/fattureincloud_ruby_sdk/models/issued_document_totals_vat_list.rb +218 -0
  351. data/lib/fattureincloud_ruby_sdk/models/issued_document_totals_vat_list_vat_item.rb +227 -0
  352. data/lib/fattureincloud_ruby_sdk/models/issued_document_type.rb +44 -0
  353. data/lib/fattureincloud_ruby_sdk/models/language.rb +239 -0
  354. data/lib/fattureincloud_ruby_sdk/models/list_archive_categories_response.rb +220 -0
  355. data/lib/fattureincloud_ruby_sdk/models/list_archive_documents_response.rb +343 -0
  356. data/lib/fattureincloud_ruby_sdk/models/list_archive_documents_response_page.rb +220 -0
  357. data/lib/fattureincloud_ruby_sdk/models/list_cashbook_entries_response.rb +221 -0
  358. data/lib/fattureincloud_ruby_sdk/models/list_cities_response.rb +221 -0
  359. data/lib/fattureincloud_ruby_sdk/models/list_clients_response.rb +342 -0
  360. data/lib/fattureincloud_ruby_sdk/models/list_clients_response_page.rb +220 -0
  361. data/lib/fattureincloud_ruby_sdk/models/list_cost_centers_response.rb +220 -0
  362. data/lib/fattureincloud_ruby_sdk/models/list_countries_response.rb +221 -0
  363. data/lib/fattureincloud_ruby_sdk/models/list_currencies_response.rb +221 -0
  364. data/lib/fattureincloud_ruby_sdk/models/list_delivery_notes_default_causals_response.rb +226 -0
  365. data/lib/fattureincloud_ruby_sdk/models/list_f24_response.rb +353 -0
  366. data/lib/fattureincloud_ruby_sdk/models/list_f24_response_aggregated_data.rb +218 -0
  367. data/lib/fattureincloud_ruby_sdk/models/list_f24_response_aggregated_data_aggregated_data.rb +219 -0
  368. data/lib/fattureincloud_ruby_sdk/models/list_f24_response_page.rb +220 -0
  369. data/lib/fattureincloud_ruby_sdk/models/list_issued_documents_response.rb +342 -0
  370. data/lib/fattureincloud_ruby_sdk/models/list_issued_documents_response_page.rb +220 -0
  371. data/lib/fattureincloud_ruby_sdk/models/list_languages_response.rb +221 -0
  372. data/lib/fattureincloud_ruby_sdk/models/list_payment_accounts_response.rb +221 -0
  373. data/lib/fattureincloud_ruby_sdk/models/list_payment_methods_response.rb +221 -0
  374. data/lib/fattureincloud_ruby_sdk/models/list_product_categories_response.rb +221 -0
  375. data/lib/fattureincloud_ruby_sdk/models/list_products_response.rb +342 -0
  376. data/lib/fattureincloud_ruby_sdk/models/list_products_response_page.rb +220 -0
  377. data/lib/fattureincloud_ruby_sdk/models/list_receipts_response.rb +343 -0
  378. data/lib/fattureincloud_ruby_sdk/models/list_receipts_response_page.rb +220 -0
  379. data/lib/fattureincloud_ruby_sdk/models/list_received_document_categories_response.rb +221 -0
  380. data/lib/fattureincloud_ruby_sdk/models/list_received_documents_response.rb +343 -0
  381. data/lib/fattureincloud_ruby_sdk/models/list_received_documents_response_page.rb +220 -0
  382. data/lib/fattureincloud_ruby_sdk/models/list_revenue_centers_response.rb +221 -0
  383. data/lib/fattureincloud_ruby_sdk/models/list_suppliers_response.rb +342 -0
  384. data/lib/fattureincloud_ruby_sdk/models/list_suppliers_response_page.rb +220 -0
  385. data/lib/fattureincloud_ruby_sdk/models/list_templates_response.rb +221 -0
  386. data/lib/fattureincloud_ruby_sdk/models/list_units_of_measure_response.rb +221 -0
  387. data/lib/fattureincloud_ruby_sdk/models/list_user_companies_response.rb +219 -0
  388. data/lib/fattureincloud_ruby_sdk/models/list_user_companies_response_data.rb +220 -0
  389. data/lib/fattureincloud_ruby_sdk/models/list_vat_types_response.rb +221 -0
  390. data/lib/fattureincloud_ruby_sdk/models/modify_archive_document_request.rb +219 -0
  391. data/lib/fattureincloud_ruby_sdk/models/modify_archive_document_response.rb +219 -0
  392. data/lib/fattureincloud_ruby_sdk/models/modify_cashbook_entry_request.rb +219 -0
  393. data/lib/fattureincloud_ruby_sdk/models/modify_cashbook_entry_response.rb +219 -0
  394. data/lib/fattureincloud_ruby_sdk/models/modify_client_request.rb +219 -0
  395. data/lib/fattureincloud_ruby_sdk/models/modify_client_response.rb +218 -0
  396. data/lib/fattureincloud_ruby_sdk/models/modify_f24_request.rb +219 -0
  397. data/lib/fattureincloud_ruby_sdk/models/modify_f24_response.rb +219 -0
  398. data/lib/fattureincloud_ruby_sdk/models/modify_issued_document_request.rb +219 -0
  399. data/lib/fattureincloud_ruby_sdk/models/modify_issued_document_response.rb +218 -0
  400. data/lib/fattureincloud_ruby_sdk/models/modify_payment_account_request.rb +219 -0
  401. data/lib/fattureincloud_ruby_sdk/models/modify_payment_account_response.rb +219 -0
  402. data/lib/fattureincloud_ruby_sdk/models/modify_payment_method_request.rb +218 -0
  403. data/lib/fattureincloud_ruby_sdk/models/modify_payment_method_response.rb +218 -0
  404. data/lib/fattureincloud_ruby_sdk/models/modify_product_request.rb +218 -0
  405. data/lib/fattureincloud_ruby_sdk/models/modify_product_response.rb +218 -0
  406. data/lib/fattureincloud_ruby_sdk/models/modify_receipt_request.rb +219 -0
  407. data/lib/fattureincloud_ruby_sdk/models/modify_receipt_response.rb +219 -0
  408. data/lib/fattureincloud_ruby_sdk/models/modify_received_document_request.rb +219 -0
  409. data/lib/fattureincloud_ruby_sdk/models/modify_received_document_response.rb +219 -0
  410. data/lib/fattureincloud_ruby_sdk/models/modify_supplier_request.rb +218 -0
  411. data/lib/fattureincloud_ruby_sdk/models/modify_supplier_response.rb +218 -0
  412. data/lib/fattureincloud_ruby_sdk/models/modify_vat_type_request.rb +219 -0
  413. data/lib/fattureincloud_ruby_sdk/models/modify_vat_type_response.rb +219 -0
  414. data/lib/fattureincloud_ruby_sdk/models/monthly_total.rb +255 -0
  415. data/lib/fattureincloud_ruby_sdk/models/original_document_type.rb +38 -0
  416. data/lib/fattureincloud_ruby_sdk/models/pagination.rb +324 -0
  417. data/lib/fattureincloud_ruby_sdk/models/payment_account.rb +288 -0
  418. data/lib/fattureincloud_ruby_sdk/models/payment_account_type.rb +37 -0
  419. data/lib/fattureincloud_ruby_sdk/models/payment_method.rb +337 -0
  420. data/lib/fattureincloud_ruby_sdk/models/payment_method_details.rb +229 -0
  421. data/lib/fattureincloud_ruby_sdk/models/payment_method_type.rb +37 -0
  422. data/lib/fattureincloud_ruby_sdk/models/permission_level.rb +39 -0
  423. data/lib/fattureincloud_ruby_sdk/models/permissions.rb +435 -0
  424. data/lib/fattureincloud_ruby_sdk/models/permissions_fic_issued_documents_detailed.rb +299 -0
  425. data/lib/fattureincloud_ruby_sdk/models/product.rb +411 -0
  426. data/lib/fattureincloud_ruby_sdk/models/receipt.rb +371 -0
  427. data/lib/fattureincloud_ruby_sdk/models/receipt_items_list_item.rb +259 -0
  428. data/lib/fattureincloud_ruby_sdk/models/receipt_pre_create_info.rb +310 -0
  429. data/lib/fattureincloud_ruby_sdk/models/receipt_type.rb +37 -0
  430. data/lib/fattureincloud_ruby_sdk/models/received_document.rb +525 -0
  431. data/lib/fattureincloud_ruby_sdk/models/received_document_entity.rb +230 -0
  432. data/lib/fattureincloud_ruby_sdk/models/received_document_info.rb +283 -0
  433. data/lib/fattureincloud_ruby_sdk/models/received_document_info_default_values.rb +219 -0
  434. data/lib/fattureincloud_ruby_sdk/models/received_document_info_items_default_values.rb +221 -0
  435. data/lib/fattureincloud_ruby_sdk/models/received_document_items_list.rb +308 -0
  436. data/lib/fattureincloud_ruby_sdk/models/received_document_payment_terms.rb +228 -0
  437. data/lib/fattureincloud_ruby_sdk/models/received_document_payments_list.rb +278 -0
  438. data/lib/fattureincloud_ruby_sdk/models/received_document_totals.rb +305 -0
  439. data/lib/fattureincloud_ruby_sdk/models/received_document_type.rb +38 -0
  440. data/lib/fattureincloud_ruby_sdk/models/schedule_email_request.rb +219 -0
  441. data/lib/fattureincloud_ruby_sdk/models/send_e_invoice_request.rb +218 -0
  442. data/lib/fattureincloud_ruby_sdk/models/send_e_invoice_request_data.rb +229 -0
  443. data/lib/fattureincloud_ruby_sdk/models/send_e_invoice_response.rb +218 -0
  444. data/lib/fattureincloud_ruby_sdk/models/send_e_invoice_response_data.rb +229 -0
  445. data/lib/fattureincloud_ruby_sdk/models/show_totals_mode.rb +38 -0
  446. data/lib/fattureincloud_ruby_sdk/models/supplier.rb +436 -0
  447. data/lib/fattureincloud_ruby_sdk/models/supplier_type.rb +40 -0
  448. data/lib/fattureincloud_ruby_sdk/models/upload_archive_attachment_response.rb +218 -0
  449. data/lib/fattureincloud_ruby_sdk/models/upload_f24_attachment_response.rb +219 -0
  450. data/lib/fattureincloud_ruby_sdk/models/upload_issued_document_attachment_response.rb +219 -0
  451. data/lib/fattureincloud_ruby_sdk/models/upload_issued_document_attachment_response_data.rb +219 -0
  452. data/lib/fattureincloud_ruby_sdk/models/upload_received_document_attachment_response.rb +224 -0
  453. data/lib/fattureincloud_ruby_sdk/models/upload_received_document_attachment_response_data.rb +224 -0
  454. data/lib/fattureincloud_ruby_sdk/models/user.rb +284 -0
  455. data/lib/fattureincloud_ruby_sdk/models/user_company_role.rb +38 -0
  456. data/lib/fattureincloud_ruby_sdk/models/vat_kind.rb +39 -0
  457. data/lib/fattureincloud_ruby_sdk/models/vat_type.rb +335 -0
  458. data/lib/fattureincloud_ruby_sdk/models/verify_e_invoice_xml_error_response.rb +227 -0
  459. data/lib/fattureincloud_ruby_sdk/models/verify_e_invoice_xml_error_response_error.rb +227 -0
  460. data/lib/fattureincloud_ruby_sdk/models/verify_e_invoice_xml_error_response_extra.rb +220 -0
  461. data/lib/fattureincloud_ruby_sdk/models/verify_e_invoice_xml_response.rb +218 -0
  462. data/lib/fattureincloud_ruby_sdk/models/verify_e_invoice_xml_response_data.rb +219 -0
  463. data/lib/fattureincloud_ruby_sdk/version.rb +15 -0
  464. data/lib/fattureincloud_ruby_sdk.rb +265 -0
  465. data/scripts/.gitignore +2 -0
  466. data/scripts/node_modules/.bin/js-yaml +1 -0
  467. data/scripts/node_modules/.yarn-integrity +17 -0
  468. data/scripts/node_modules/argparse/CHANGELOG.md +216 -0
  469. data/scripts/node_modules/argparse/LICENSE +254 -0
  470. data/scripts/node_modules/argparse/README.md +84 -0
  471. data/scripts/node_modules/argparse/argparse.js +3707 -0
  472. data/scripts/node_modules/argparse/lib/sub.js +67 -0
  473. data/scripts/node_modules/argparse/lib/textwrap.js +440 -0
  474. data/scripts/node_modules/argparse/package.json +31 -0
  475. data/scripts/node_modules/js-yaml/CHANGELOG.md +616 -0
  476. data/scripts/node_modules/js-yaml/LICENSE +21 -0
  477. data/scripts/node_modules/js-yaml/README.md +246 -0
  478. data/scripts/node_modules/js-yaml/bin/js-yaml.js +126 -0
  479. data/scripts/node_modules/js-yaml/dist/js-yaml.js +3874 -0
  480. data/scripts/node_modules/js-yaml/dist/js-yaml.min.js +2 -0
  481. data/scripts/node_modules/js-yaml/dist/js-yaml.mjs +3851 -0
  482. data/scripts/node_modules/js-yaml/index.js +47 -0
  483. data/scripts/node_modules/js-yaml/lib/common.js +59 -0
  484. data/scripts/node_modules/js-yaml/lib/dumper.js +965 -0
  485. data/scripts/node_modules/js-yaml/lib/exception.js +55 -0
  486. data/scripts/node_modules/js-yaml/lib/loader.js +1727 -0
  487. data/scripts/node_modules/js-yaml/lib/schema/core.js +11 -0
  488. data/scripts/node_modules/js-yaml/lib/schema/default.js +22 -0
  489. data/scripts/node_modules/js-yaml/lib/schema/failsafe.js +17 -0
  490. data/scripts/node_modules/js-yaml/lib/schema/json.js +19 -0
  491. data/scripts/node_modules/js-yaml/lib/schema.js +121 -0
  492. data/scripts/node_modules/js-yaml/lib/snippet.js +101 -0
  493. data/scripts/node_modules/js-yaml/lib/type/binary.js +125 -0
  494. data/scripts/node_modules/js-yaml/lib/type/bool.js +35 -0
  495. data/scripts/node_modules/js-yaml/lib/type/float.js +97 -0
  496. data/scripts/node_modules/js-yaml/lib/type/int.js +156 -0
  497. data/scripts/node_modules/js-yaml/lib/type/map.js +8 -0
  498. data/scripts/node_modules/js-yaml/lib/type/merge.js +12 -0
  499. data/scripts/node_modules/js-yaml/lib/type/null.js +35 -0
  500. data/scripts/node_modules/js-yaml/lib/type/omap.js +44 -0
  501. data/scripts/node_modules/js-yaml/lib/type/pairs.js +53 -0
  502. data/scripts/node_modules/js-yaml/lib/type/seq.js +8 -0
  503. data/scripts/node_modules/js-yaml/lib/type/set.js +29 -0
  504. data/scripts/node_modules/js-yaml/lib/type/str.js +8 -0
  505. data/scripts/node_modules/js-yaml/lib/type/timestamp.js +88 -0
  506. data/scripts/node_modules/js-yaml/lib/type.js +66 -0
  507. data/scripts/node_modules/js-yaml/package.json +66 -0
  508. data/scripts/package.json +5 -0
  509. data/scripts/sdk-version-updater.js +13 -0
  510. data/scripts/yarn.lock +15 -0
  511. data/sdk-version.yaml +2 -0
  512. data/spec/api/archive_api_spec.rb +121 -0
  513. data/spec/api/cashbook_api_spec.rb +107 -0
  514. data/spec/api/clients_api_spec.rb +107 -0
  515. data/spec/api/companies_api_spec.rb +47 -0
  516. data/spec/api/info_api_spec.rb +220 -0
  517. data/spec/api/issued_documents_api_spec.rb +202 -0
  518. data/spec/api/issued_e_invoices_api_spec.rb +62 -0
  519. data/spec/api/products_api_spec.rb +107 -0
  520. data/spec/api/receipts_api_spec.rb +133 -0
  521. data/spec/api/received_documents_api_spec.rb +175 -0
  522. data/spec/api/settings_api_spec.rb +198 -0
  523. data/spec/api/suppliers_api_spec.rb +107 -0
  524. data/spec/api/taxes_api_spec.rb +134 -0
  525. data/spec/api/user_api_spec.rb +57 -0
  526. data/spec/api_client_spec.rb +226 -0
  527. data/spec/configuration_spec.rb +42 -0
  528. data/spec/models/archive_document_spec.rb +64 -0
  529. data/spec/models/cashbook_entry_data_document_spec.rb +46 -0
  530. data/spec/models/cashbook_entry_data_spec.rb +70 -0
  531. data/spec/models/cashbook_entry_in_data_spec.rb +40 -0
  532. data/spec/models/cashbook_entry_in_out_spec.rb +94 -0
  533. data/spec/models/cashbook_entry_in_spec.rb +82 -0
  534. data/spec/models/cashbook_entry_kind_spec.rb +28 -0
  535. data/spec/models/cashbook_entry_out_data_spec.rb +40 -0
  536. data/spec/models/cashbook_entry_out_spec.rb +82 -0
  537. data/spec/models/cashbook_entry_spec.rb +31 -0
  538. data/spec/models/cashbook_entry_type_spec.rb +28 -0
  539. data/spec/models/city_spec.rb +46 -0
  540. data/spec/models/client_spec.rb +220 -0
  541. data/spec/models/client_type_spec.rb +28 -0
  542. data/spec/models/company_info_access_info_spec.rb +46 -0
  543. data/spec/models/company_info_plan_info_functions_spec.rb +136 -0
  544. data/spec/models/company_info_plan_info_functions_status_spec.rb +40 -0
  545. data/spec/models/company_info_plan_info_limits_spec.rb +52 -0
  546. data/spec/models/company_info_plan_info_spec.rb +46 -0
  547. data/spec/models/company_info_spec.rb +76 -0
  548. data/spec/models/company_spec.rb +70 -0
  549. data/spec/models/company_type_spec.rb +28 -0
  550. data/spec/models/create_archive_document_request_spec.rb +34 -0
  551. data/spec/models/create_archive_document_response_spec.rb +34 -0
  552. data/spec/models/create_cashbook_entry_request_spec.rb +34 -0
  553. data/spec/models/create_cashbook_entry_response_spec.rb +34 -0
  554. data/spec/models/create_client_request_spec.rb +34 -0
  555. data/spec/models/create_client_response_spec.rb +34 -0
  556. data/spec/models/create_f24_request_spec.rb +34 -0
  557. data/spec/models/create_f24_response_spec.rb +34 -0
  558. data/spec/models/create_issued_document_request_spec.rb +34 -0
  559. data/spec/models/create_issued_document_response_spec.rb +34 -0
  560. data/spec/models/create_payment_account_request_spec.rb +34 -0
  561. data/spec/models/create_payment_account_response_spec.rb +34 -0
  562. data/spec/models/create_payment_method_request_spec.rb +34 -0
  563. data/spec/models/create_payment_method_response_spec.rb +34 -0
  564. data/spec/models/create_product_request_spec.rb +34 -0
  565. data/spec/models/create_product_response_spec.rb +34 -0
  566. data/spec/models/create_receipt_request_spec.rb +40 -0
  567. data/spec/models/create_receipt_response_spec.rb +34 -0
  568. data/spec/models/create_received_document_request_spec.rb +40 -0
  569. data/spec/models/create_received_document_response_spec.rb +34 -0
  570. data/spec/models/create_supplier_request_spec.rb +34 -0
  571. data/spec/models/create_supplier_response_spec.rb +34 -0
  572. data/spec/models/create_vat_type_request_spec.rb +34 -0
  573. data/spec/models/create_vat_type_response_spec.rb +34 -0
  574. data/spec/models/currency_spec.rb +52 -0
  575. data/spec/models/default_payment_terms_type_spec.rb +28 -0
  576. data/spec/models/document_template_spec.rb +46 -0
  577. data/spec/models/email_data_default_sender_email_spec.rb +40 -0
  578. data/spec/models/email_data_sender_emails_list_spec.rb +40 -0
  579. data/spec/models/email_data_spec.rb +94 -0
  580. data/spec/models/email_schedule_include_spec.rb +52 -0
  581. data/spec/models/email_schedule_spec.rb +76 -0
  582. data/spec/models/entity_spec.rb +31 -0
  583. data/spec/models/f24_spec.rb +76 -0
  584. data/spec/models/f24_status_spec.rb +28 -0
  585. data/spec/models/function_status_spec.rb +34 -0
  586. data/spec/models/get_archive_document_response_spec.rb +34 -0
  587. data/spec/models/get_cashbook_entry_response_spec.rb +34 -0
  588. data/spec/models/get_client_response_spec.rb +34 -0
  589. data/spec/models/get_company_info_response_spec.rb +34 -0
  590. data/spec/models/get_email_data_response_spec.rb +34 -0
  591. data/spec/models/get_existing_issued_document_totals_request_spec.rb +34 -0
  592. data/spec/models/get_existing_issued_document_totals_response_spec.rb +34 -0
  593. data/spec/models/get_existing_received_document_totals_request_spec.rb +34 -0
  594. data/spec/models/get_existing_received_document_totals_response_spec.rb +34 -0
  595. data/spec/models/get_f24_response_spec.rb +34 -0
  596. data/spec/models/get_issued_document_pre_create_info_response_spec.rb +34 -0
  597. data/spec/models/get_issued_document_response_spec.rb +34 -0
  598. data/spec/models/get_new_issued_document_totals_request_spec.rb +34 -0
  599. data/spec/models/get_new_issued_document_totals_response_spec.rb +34 -0
  600. data/spec/models/get_new_received_document_totals_request_spec.rb +34 -0
  601. data/spec/models/get_new_received_document_totals_response_spec.rb +34 -0
  602. data/spec/models/get_payment_account_response_spec.rb +34 -0
  603. data/spec/models/get_payment_method_response_spec.rb +34 -0
  604. data/spec/models/get_product_response_spec.rb +34 -0
  605. data/spec/models/get_receipt_pre_create_info_response_spec.rb +34 -0
  606. data/spec/models/get_receipt_response_spec.rb +34 -0
  607. data/spec/models/get_receipts_monthly_totals_response_spec.rb +34 -0
  608. data/spec/models/get_received_document_pre_create_info_response_spec.rb +34 -0
  609. data/spec/models/get_received_document_response_spec.rb +34 -0
  610. data/spec/models/get_supplier_response_spec.rb +34 -0
  611. data/spec/models/get_user_info_response_email_confirmation_state_spec.rb +34 -0
  612. data/spec/models/get_user_info_response_info_spec.rb +46 -0
  613. data/spec/models/get_user_info_response_spec.rb +46 -0
  614. data/spec/models/get_vat_type_response_spec.rb +34 -0
  615. data/spec/models/issued_document_ei_data_spec.rb +100 -0
  616. data/spec/models/issued_document_extra_data_spec.rb +106 -0
  617. data/spec/models/issued_document_items_list_spec.rb +124 -0
  618. data/spec/models/issued_document_payments_list_spec.rb +64 -0
  619. data/spec/models/issued_document_pre_create_info_default_values_spec.rb +94 -0
  620. data/spec/models/issued_document_pre_create_info_extra_data_default_values_spec.rb +52 -0
  621. data/spec/models/issued_document_pre_create_info_items_default_values_spec.rb +34 -0
  622. data/spec/models/issued_document_pre_create_info_spec.rb +106 -0
  623. data/spec/models/issued_document_refers_to_spec.rb +58 -0
  624. data/spec/models/issued_document_spec.rb +490 -0
  625. data/spec/models/issued_document_status_spec.rb +28 -0
  626. data/spec/models/issued_document_totals_spec.rb +130 -0
  627. data/spec/models/issued_document_totals_vat_list_spec.rb +34 -0
  628. data/spec/models/issued_document_totals_vat_list_vat_item_spec.rb +40 -0
  629. data/spec/models/issued_document_type_spec.rb +28 -0
  630. data/spec/models/language_spec.rb +40 -0
  631. data/spec/models/list_archive_categories_response_spec.rb +34 -0
  632. data/spec/models/list_archive_documents_response_page_spec.rb +34 -0
  633. data/spec/models/list_archive_documents_response_spec.rb +100 -0
  634. data/spec/models/list_cashbook_entries_response_spec.rb +34 -0
  635. data/spec/models/list_cities_response_spec.rb +34 -0
  636. data/spec/models/list_clients_response_page_spec.rb +34 -0
  637. data/spec/models/list_clients_response_spec.rb +100 -0
  638. data/spec/models/list_cost_centers_response_spec.rb +34 -0
  639. data/spec/models/list_countries_response_spec.rb +34 -0
  640. data/spec/models/list_currencies_response_spec.rb +34 -0
  641. data/spec/models/list_delivery_notes_default_causals_response_spec.rb +34 -0
  642. data/spec/models/list_f24_response_aggregated_data_aggregated_data_spec.rb +34 -0
  643. data/spec/models/list_f24_response_aggregated_data_spec.rb +34 -0
  644. data/spec/models/list_f24_response_page_spec.rb +34 -0
  645. data/spec/models/list_f24_response_spec.rb +106 -0
  646. data/spec/models/list_issued_documents_response_page_spec.rb +34 -0
  647. data/spec/models/list_issued_documents_response_spec.rb +100 -0
  648. data/spec/models/list_languages_response_spec.rb +34 -0
  649. data/spec/models/list_payment_accounts_response_spec.rb +34 -0
  650. data/spec/models/list_payment_methods_response_spec.rb +34 -0
  651. data/spec/models/list_product_categories_response_spec.rb +34 -0
  652. data/spec/models/list_products_response_page_spec.rb +34 -0
  653. data/spec/models/list_products_response_spec.rb +100 -0
  654. data/spec/models/list_receipts_response_page_spec.rb +34 -0
  655. data/spec/models/list_receipts_response_spec.rb +100 -0
  656. data/spec/models/list_received_document_categories_response_spec.rb +34 -0
  657. data/spec/models/list_received_documents_response_page_spec.rb +34 -0
  658. data/spec/models/list_received_documents_response_spec.rb +100 -0
  659. data/spec/models/list_revenue_centers_response_spec.rb +34 -0
  660. data/spec/models/list_suppliers_response_page_spec.rb +34 -0
  661. data/spec/models/list_suppliers_response_spec.rb +100 -0
  662. data/spec/models/list_templates_response_spec.rb +34 -0
  663. data/spec/models/list_units_of_measure_response_spec.rb +34 -0
  664. data/spec/models/list_user_companies_response_data_spec.rb +34 -0
  665. data/spec/models/list_user_companies_response_spec.rb +34 -0
  666. data/spec/models/list_vat_types_response_spec.rb +34 -0
  667. data/spec/models/modify_archive_document_request_spec.rb +34 -0
  668. data/spec/models/modify_archive_document_response_spec.rb +34 -0
  669. data/spec/models/modify_cashbook_entry_request_spec.rb +34 -0
  670. data/spec/models/modify_cashbook_entry_response_spec.rb +34 -0
  671. data/spec/models/modify_client_request_spec.rb +34 -0
  672. data/spec/models/modify_client_response_spec.rb +34 -0
  673. data/spec/models/modify_f24_request_spec.rb +34 -0
  674. data/spec/models/modify_f24_response_spec.rb +34 -0
  675. data/spec/models/modify_issued_document_request_spec.rb +34 -0
  676. data/spec/models/modify_issued_document_response_spec.rb +34 -0
  677. data/spec/models/modify_payment_account_request_spec.rb +34 -0
  678. data/spec/models/modify_payment_account_response_spec.rb +34 -0
  679. data/spec/models/modify_payment_method_request_spec.rb +34 -0
  680. data/spec/models/modify_payment_method_response_spec.rb +34 -0
  681. data/spec/models/modify_product_request_spec.rb +34 -0
  682. data/spec/models/modify_product_response_spec.rb +34 -0
  683. data/spec/models/modify_receipt_request_spec.rb +34 -0
  684. data/spec/models/modify_receipt_response_spec.rb +34 -0
  685. data/spec/models/modify_received_document_request_spec.rb +34 -0
  686. data/spec/models/modify_received_document_response_spec.rb +34 -0
  687. data/spec/models/modify_supplier_request_spec.rb +34 -0
  688. data/spec/models/modify_supplier_response_spec.rb +34 -0
  689. data/spec/models/modify_vat_type_request_spec.rb +34 -0
  690. data/spec/models/modify_vat_type_response_spec.rb +34 -0
  691. data/spec/models/monthly_total_spec.rb +46 -0
  692. data/spec/models/original_document_type_spec.rb +28 -0
  693. data/spec/models/pagination_spec.rb +94 -0
  694. data/spec/models/payment_account_spec.rb +70 -0
  695. data/spec/models/payment_account_type_spec.rb +28 -0
  696. data/spec/models/payment_method_details_spec.rb +40 -0
  697. data/spec/models/payment_method_spec.rb +88 -0
  698. data/spec/models/payment_method_type_spec.rb +28 -0
  699. data/spec/models/permission_level_spec.rb +28 -0
  700. data/spec/models/permissions_fic_issued_documents_detailed_spec.rb +88 -0
  701. data/spec/models/permissions_spec.rb +178 -0
  702. data/spec/models/product_spec.rb +142 -0
  703. data/spec/models/receipt_items_list_item_spec.rb +58 -0
  704. data/spec/models/receipt_pre_create_info_spec.rb +64 -0
  705. data/spec/models/receipt_spec.rb +118 -0
  706. data/spec/models/receipt_type_spec.rb +28 -0
  707. data/spec/models/received_document_entity_spec.rb +40 -0
  708. data/spec/models/received_document_info_default_values_spec.rb +34 -0
  709. data/spec/models/received_document_info_items_default_values_spec.rb +34 -0
  710. data/spec/models/received_document_info_spec.rb +70 -0
  711. data/spec/models/received_document_items_list_spec.rb +88 -0
  712. data/spec/models/received_document_payment_terms_spec.rb +40 -0
  713. data/spec/models/received_document_payments_list_spec.rb +70 -0
  714. data/spec/models/received_document_spec.rb +184 -0
  715. data/spec/models/received_document_totals_spec.rb +70 -0
  716. data/spec/models/received_document_type_spec.rb +28 -0
  717. data/spec/models/schedule_email_request_spec.rb +34 -0
  718. data/spec/models/send_e_invoice_request_data_spec.rb +40 -0
  719. data/spec/models/send_e_invoice_request_spec.rb +34 -0
  720. data/spec/models/send_e_invoice_response_data_spec.rb +40 -0
  721. data/spec/models/send_e_invoice_response_spec.rb +34 -0
  722. data/spec/models/show_totals_mode_spec.rb +28 -0
  723. data/spec/models/supplier_spec.rb +160 -0
  724. data/spec/models/supplier_type_spec.rb +28 -0
  725. data/spec/models/upload_archive_attachment_response_spec.rb +34 -0
  726. data/spec/models/upload_f24_attachment_response_spec.rb +34 -0
  727. data/spec/models/upload_issued_document_attachment_response_data_spec.rb +34 -0
  728. data/spec/models/upload_issued_document_attachment_response_spec.rb +34 -0
  729. data/spec/models/upload_received_document_attachment_response_data_spec.rb +34 -0
  730. data/spec/models/upload_received_document_attachment_response_spec.rb +34 -0
  731. data/spec/models/user_company_role_spec.rb +28 -0
  732. data/spec/models/user_spec.rb +70 -0
  733. data/spec/models/vat_kind_spec.rb +28 -0
  734. data/spec/models/vat_type_spec.rb +82 -0
  735. data/spec/models/verify_e_invoice_xml_error_response_error_spec.rb +40 -0
  736. data/spec/models/verify_e_invoice_xml_error_response_extra_spec.rb +34 -0
  737. data/spec/models/verify_e_invoice_xml_error_response_spec.rb +40 -0
  738. data/spec/models/verify_e_invoice_xml_response_data_spec.rb +34 -0
  739. data/spec/models/verify_e_invoice_xml_response_spec.rb +34 -0
  740. data/spec/spec_helper.rb +111 -0
  741. metadata +1051 -0
@@ -0,0 +1,1727 @@
1
+ 'use strict';
2
+
3
+ /*eslint-disable max-len,no-use-before-define*/
4
+
5
+ var common = require('./common');
6
+ var YAMLException = require('./exception');
7
+ var makeSnippet = require('./snippet');
8
+ var DEFAULT_SCHEMA = require('./schema/default');
9
+
10
+
11
+ var _hasOwnProperty = Object.prototype.hasOwnProperty;
12
+
13
+
14
+ var CONTEXT_FLOW_IN = 1;
15
+ var CONTEXT_FLOW_OUT = 2;
16
+ var CONTEXT_BLOCK_IN = 3;
17
+ var CONTEXT_BLOCK_OUT = 4;
18
+
19
+
20
+ var CHOMPING_CLIP = 1;
21
+ var CHOMPING_STRIP = 2;
22
+ var CHOMPING_KEEP = 3;
23
+
24
+
25
+ var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
26
+ var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
27
+ var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
28
+ var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
29
+ var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
30
+
31
+
32
+ function _class(obj) { return Object.prototype.toString.call(obj); }
33
+
34
+ function is_EOL(c) {
35
+ return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);
36
+ }
37
+
38
+ function is_WHITE_SPACE(c) {
39
+ return (c === 0x09/* Tab */) || (c === 0x20/* Space */);
40
+ }
41
+
42
+ function is_WS_OR_EOL(c) {
43
+ return (c === 0x09/* Tab */) ||
44
+ (c === 0x20/* Space */) ||
45
+ (c === 0x0A/* LF */) ||
46
+ (c === 0x0D/* CR */);
47
+ }
48
+
49
+ function is_FLOW_INDICATOR(c) {
50
+ return c === 0x2C/* , */ ||
51
+ c === 0x5B/* [ */ ||
52
+ c === 0x5D/* ] */ ||
53
+ c === 0x7B/* { */ ||
54
+ c === 0x7D/* } */;
55
+ }
56
+
57
+ function fromHexCode(c) {
58
+ var lc;
59
+
60
+ if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
61
+ return c - 0x30;
62
+ }
63
+
64
+ /*eslint-disable no-bitwise*/
65
+ lc = c | 0x20;
66
+
67
+ if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {
68
+ return lc - 0x61 + 10;
69
+ }
70
+
71
+ return -1;
72
+ }
73
+
74
+ function escapedHexLen(c) {
75
+ if (c === 0x78/* x */) { return 2; }
76
+ if (c === 0x75/* u */) { return 4; }
77
+ if (c === 0x55/* U */) { return 8; }
78
+ return 0;
79
+ }
80
+
81
+ function fromDecimalCode(c) {
82
+ if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
83
+ return c - 0x30;
84
+ }
85
+
86
+ return -1;
87
+ }
88
+
89
+ function simpleEscapeSequence(c) {
90
+ /* eslint-disable indent */
91
+ return (c === 0x30/* 0 */) ? '\x00' :
92
+ (c === 0x61/* a */) ? '\x07' :
93
+ (c === 0x62/* b */) ? '\x08' :
94
+ (c === 0x74/* t */) ? '\x09' :
95
+ (c === 0x09/* Tab */) ? '\x09' :
96
+ (c === 0x6E/* n */) ? '\x0A' :
97
+ (c === 0x76/* v */) ? '\x0B' :
98
+ (c === 0x66/* f */) ? '\x0C' :
99
+ (c === 0x72/* r */) ? '\x0D' :
100
+ (c === 0x65/* e */) ? '\x1B' :
101
+ (c === 0x20/* Space */) ? ' ' :
102
+ (c === 0x22/* " */) ? '\x22' :
103
+ (c === 0x2F/* / */) ? '/' :
104
+ (c === 0x5C/* \ */) ? '\x5C' :
105
+ (c === 0x4E/* N */) ? '\x85' :
106
+ (c === 0x5F/* _ */) ? '\xA0' :
107
+ (c === 0x4C/* L */) ? '\u2028' :
108
+ (c === 0x50/* P */) ? '\u2029' : '';
109
+ }
110
+
111
+ function charFromCodepoint(c) {
112
+ if (c <= 0xFFFF) {
113
+ return String.fromCharCode(c);
114
+ }
115
+ // Encode UTF-16 surrogate pair
116
+ // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF
117
+ return String.fromCharCode(
118
+ ((c - 0x010000) >> 10) + 0xD800,
119
+ ((c - 0x010000) & 0x03FF) + 0xDC00
120
+ );
121
+ }
122
+
123
+ var simpleEscapeCheck = new Array(256); // integer, for fast access
124
+ var simpleEscapeMap = new Array(256);
125
+ for (var i = 0; i < 256; i++) {
126
+ simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
127
+ simpleEscapeMap[i] = simpleEscapeSequence(i);
128
+ }
129
+
130
+
131
+ function State(input, options) {
132
+ this.input = input;
133
+
134
+ this.filename = options['filename'] || null;
135
+ this.schema = options['schema'] || DEFAULT_SCHEMA;
136
+ this.onWarning = options['onWarning'] || null;
137
+ // (Hidden) Remove? makes the loader to expect YAML 1.1 documents
138
+ // if such documents have no explicit %YAML directive
139
+ this.legacy = options['legacy'] || false;
140
+
141
+ this.json = options['json'] || false;
142
+ this.listener = options['listener'] || null;
143
+
144
+ this.implicitTypes = this.schema.compiledImplicit;
145
+ this.typeMap = this.schema.compiledTypeMap;
146
+
147
+ this.length = input.length;
148
+ this.position = 0;
149
+ this.line = 0;
150
+ this.lineStart = 0;
151
+ this.lineIndent = 0;
152
+
153
+ // position of first leading tab in the current line,
154
+ // used to make sure there are no tabs in the indentation
155
+ this.firstTabInLine = -1;
156
+
157
+ this.documents = [];
158
+
159
+ /*
160
+ this.version;
161
+ this.checkLineBreaks;
162
+ this.tagMap;
163
+ this.anchorMap;
164
+ this.tag;
165
+ this.anchor;
166
+ this.kind;
167
+ this.result;*/
168
+
169
+ }
170
+
171
+
172
+ function generateError(state, message) {
173
+ var mark = {
174
+ name: state.filename,
175
+ buffer: state.input.slice(0, -1), // omit trailing \0
176
+ position: state.position,
177
+ line: state.line,
178
+ column: state.position - state.lineStart
179
+ };
180
+
181
+ mark.snippet = makeSnippet(mark);
182
+
183
+ return new YAMLException(message, mark);
184
+ }
185
+
186
+ function throwError(state, message) {
187
+ throw generateError(state, message);
188
+ }
189
+
190
+ function throwWarning(state, message) {
191
+ if (state.onWarning) {
192
+ state.onWarning.call(null, generateError(state, message));
193
+ }
194
+ }
195
+
196
+
197
+ var directiveHandlers = {
198
+
199
+ YAML: function handleYamlDirective(state, name, args) {
200
+
201
+ var match, major, minor;
202
+
203
+ if (state.version !== null) {
204
+ throwError(state, 'duplication of %YAML directive');
205
+ }
206
+
207
+ if (args.length !== 1) {
208
+ throwError(state, 'YAML directive accepts exactly one argument');
209
+ }
210
+
211
+ match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
212
+
213
+ if (match === null) {
214
+ throwError(state, 'ill-formed argument of the YAML directive');
215
+ }
216
+
217
+ major = parseInt(match[1], 10);
218
+ minor = parseInt(match[2], 10);
219
+
220
+ if (major !== 1) {
221
+ throwError(state, 'unacceptable YAML version of the document');
222
+ }
223
+
224
+ state.version = args[0];
225
+ state.checkLineBreaks = (minor < 2);
226
+
227
+ if (minor !== 1 && minor !== 2) {
228
+ throwWarning(state, 'unsupported YAML version of the document');
229
+ }
230
+ },
231
+
232
+ TAG: function handleTagDirective(state, name, args) {
233
+
234
+ var handle, prefix;
235
+
236
+ if (args.length !== 2) {
237
+ throwError(state, 'TAG directive accepts exactly two arguments');
238
+ }
239
+
240
+ handle = args[0];
241
+ prefix = args[1];
242
+
243
+ if (!PATTERN_TAG_HANDLE.test(handle)) {
244
+ throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
245
+ }
246
+
247
+ if (_hasOwnProperty.call(state.tagMap, handle)) {
248
+ throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
249
+ }
250
+
251
+ if (!PATTERN_TAG_URI.test(prefix)) {
252
+ throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
253
+ }
254
+
255
+ try {
256
+ prefix = decodeURIComponent(prefix);
257
+ } catch (err) {
258
+ throwError(state, 'tag prefix is malformed: ' + prefix);
259
+ }
260
+
261
+ state.tagMap[handle] = prefix;
262
+ }
263
+ };
264
+
265
+
266
+ function captureSegment(state, start, end, checkJson) {
267
+ var _position, _length, _character, _result;
268
+
269
+ if (start < end) {
270
+ _result = state.input.slice(start, end);
271
+
272
+ if (checkJson) {
273
+ for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
274
+ _character = _result.charCodeAt(_position);
275
+ if (!(_character === 0x09 ||
276
+ (0x20 <= _character && _character <= 0x10FFFF))) {
277
+ throwError(state, 'expected valid JSON character');
278
+ }
279
+ }
280
+ } else if (PATTERN_NON_PRINTABLE.test(_result)) {
281
+ throwError(state, 'the stream contains non-printable characters');
282
+ }
283
+
284
+ state.result += _result;
285
+ }
286
+ }
287
+
288
+ function mergeMappings(state, destination, source, overridableKeys) {
289
+ var sourceKeys, key, index, quantity;
290
+
291
+ if (!common.isObject(source)) {
292
+ throwError(state, 'cannot merge mappings; the provided source object is unacceptable');
293
+ }
294
+
295
+ sourceKeys = Object.keys(source);
296
+
297
+ for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
298
+ key = sourceKeys[index];
299
+
300
+ if (!_hasOwnProperty.call(destination, key)) {
301
+ destination[key] = source[key];
302
+ overridableKeys[key] = true;
303
+ }
304
+ }
305
+ }
306
+
307
+ function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode,
308
+ startLine, startLineStart, startPos) {
309
+
310
+ var index, quantity;
311
+
312
+ // The output is a plain object here, so keys can only be strings.
313
+ // We need to convert keyNode to a string, but doing so can hang the process
314
+ // (deeply nested arrays that explode exponentially using aliases).
315
+ if (Array.isArray(keyNode)) {
316
+ keyNode = Array.prototype.slice.call(keyNode);
317
+
318
+ for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
319
+ if (Array.isArray(keyNode[index])) {
320
+ throwError(state, 'nested arrays are not supported inside keys');
321
+ }
322
+
323
+ if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {
324
+ keyNode[index] = '[object Object]';
325
+ }
326
+ }
327
+ }
328
+
329
+ // Avoid code execution in load() via toString property
330
+ // (still use its own toString for arrays, timestamps,
331
+ // and whatever user schema extensions happen to have @@toStringTag)
332
+ if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {
333
+ keyNode = '[object Object]';
334
+ }
335
+
336
+
337
+ keyNode = String(keyNode);
338
+
339
+ if (_result === null) {
340
+ _result = {};
341
+ }
342
+
343
+ if (keyTag === 'tag:yaml.org,2002:merge') {
344
+ if (Array.isArray(valueNode)) {
345
+ for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
346
+ mergeMappings(state, _result, valueNode[index], overridableKeys);
347
+ }
348
+ } else {
349
+ mergeMappings(state, _result, valueNode, overridableKeys);
350
+ }
351
+ } else {
352
+ if (!state.json &&
353
+ !_hasOwnProperty.call(overridableKeys, keyNode) &&
354
+ _hasOwnProperty.call(_result, keyNode)) {
355
+ state.line = startLine || state.line;
356
+ state.lineStart = startLineStart || state.lineStart;
357
+ state.position = startPos || state.position;
358
+ throwError(state, 'duplicated mapping key');
359
+ }
360
+
361
+ // used for this specific key only because Object.defineProperty is slow
362
+ if (keyNode === '__proto__') {
363
+ Object.defineProperty(_result, keyNode, {
364
+ configurable: true,
365
+ enumerable: true,
366
+ writable: true,
367
+ value: valueNode
368
+ });
369
+ } else {
370
+ _result[keyNode] = valueNode;
371
+ }
372
+ delete overridableKeys[keyNode];
373
+ }
374
+
375
+ return _result;
376
+ }
377
+
378
+ function readLineBreak(state) {
379
+ var ch;
380
+
381
+ ch = state.input.charCodeAt(state.position);
382
+
383
+ if (ch === 0x0A/* LF */) {
384
+ state.position++;
385
+ } else if (ch === 0x0D/* CR */) {
386
+ state.position++;
387
+ if (state.input.charCodeAt(state.position) === 0x0A/* LF */) {
388
+ state.position++;
389
+ }
390
+ } else {
391
+ throwError(state, 'a line break is expected');
392
+ }
393
+
394
+ state.line += 1;
395
+ state.lineStart = state.position;
396
+ state.firstTabInLine = -1;
397
+ }
398
+
399
+ function skipSeparationSpace(state, allowComments, checkIndent) {
400
+ var lineBreaks = 0,
401
+ ch = state.input.charCodeAt(state.position);
402
+
403
+ while (ch !== 0) {
404
+ while (is_WHITE_SPACE(ch)) {
405
+ if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) {
406
+ state.firstTabInLine = state.position;
407
+ }
408
+ ch = state.input.charCodeAt(++state.position);
409
+ }
410
+
411
+ if (allowComments && ch === 0x23/* # */) {
412
+ do {
413
+ ch = state.input.charCodeAt(++state.position);
414
+ } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0);
415
+ }
416
+
417
+ if (is_EOL(ch)) {
418
+ readLineBreak(state);
419
+
420
+ ch = state.input.charCodeAt(state.position);
421
+ lineBreaks++;
422
+ state.lineIndent = 0;
423
+
424
+ while (ch === 0x20/* Space */) {
425
+ state.lineIndent++;
426
+ ch = state.input.charCodeAt(++state.position);
427
+ }
428
+ } else {
429
+ break;
430
+ }
431
+ }
432
+
433
+ if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
434
+ throwWarning(state, 'deficient indentation');
435
+ }
436
+
437
+ return lineBreaks;
438
+ }
439
+
440
+ function testDocumentSeparator(state) {
441
+ var _position = state.position,
442
+ ch;
443
+
444
+ ch = state.input.charCodeAt(_position);
445
+
446
+ // Condition state.position === state.lineStart is tested
447
+ // in parent on each call, for efficiency. No needs to test here again.
448
+ if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&
449
+ ch === state.input.charCodeAt(_position + 1) &&
450
+ ch === state.input.charCodeAt(_position + 2)) {
451
+
452
+ _position += 3;
453
+
454
+ ch = state.input.charCodeAt(_position);
455
+
456
+ if (ch === 0 || is_WS_OR_EOL(ch)) {
457
+ return true;
458
+ }
459
+ }
460
+
461
+ return false;
462
+ }
463
+
464
+ function writeFoldedLines(state, count) {
465
+ if (count === 1) {
466
+ state.result += ' ';
467
+ } else if (count > 1) {
468
+ state.result += common.repeat('\n', count - 1);
469
+ }
470
+ }
471
+
472
+
473
+ function readPlainScalar(state, nodeIndent, withinFlowCollection) {
474
+ var preceding,
475
+ following,
476
+ captureStart,
477
+ captureEnd,
478
+ hasPendingContent,
479
+ _line,
480
+ _lineStart,
481
+ _lineIndent,
482
+ _kind = state.kind,
483
+ _result = state.result,
484
+ ch;
485
+
486
+ ch = state.input.charCodeAt(state.position);
487
+
488
+ if (is_WS_OR_EOL(ch) ||
489
+ is_FLOW_INDICATOR(ch) ||
490
+ ch === 0x23/* # */ ||
491
+ ch === 0x26/* & */ ||
492
+ ch === 0x2A/* * */ ||
493
+ ch === 0x21/* ! */ ||
494
+ ch === 0x7C/* | */ ||
495
+ ch === 0x3E/* > */ ||
496
+ ch === 0x27/* ' */ ||
497
+ ch === 0x22/* " */ ||
498
+ ch === 0x25/* % */ ||
499
+ ch === 0x40/* @ */ ||
500
+ ch === 0x60/* ` */) {
501
+ return false;
502
+ }
503
+
504
+ if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {
505
+ following = state.input.charCodeAt(state.position + 1);
506
+
507
+ if (is_WS_OR_EOL(following) ||
508
+ withinFlowCollection && is_FLOW_INDICATOR(following)) {
509
+ return false;
510
+ }
511
+ }
512
+
513
+ state.kind = 'scalar';
514
+ state.result = '';
515
+ captureStart = captureEnd = state.position;
516
+ hasPendingContent = false;
517
+
518
+ while (ch !== 0) {
519
+ if (ch === 0x3A/* : */) {
520
+ following = state.input.charCodeAt(state.position + 1);
521
+
522
+ if (is_WS_OR_EOL(following) ||
523
+ withinFlowCollection && is_FLOW_INDICATOR(following)) {
524
+ break;
525
+ }
526
+
527
+ } else if (ch === 0x23/* # */) {
528
+ preceding = state.input.charCodeAt(state.position - 1);
529
+
530
+ if (is_WS_OR_EOL(preceding)) {
531
+ break;
532
+ }
533
+
534
+ } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||
535
+ withinFlowCollection && is_FLOW_INDICATOR(ch)) {
536
+ break;
537
+
538
+ } else if (is_EOL(ch)) {
539
+ _line = state.line;
540
+ _lineStart = state.lineStart;
541
+ _lineIndent = state.lineIndent;
542
+ skipSeparationSpace(state, false, -1);
543
+
544
+ if (state.lineIndent >= nodeIndent) {
545
+ hasPendingContent = true;
546
+ ch = state.input.charCodeAt(state.position);
547
+ continue;
548
+ } else {
549
+ state.position = captureEnd;
550
+ state.line = _line;
551
+ state.lineStart = _lineStart;
552
+ state.lineIndent = _lineIndent;
553
+ break;
554
+ }
555
+ }
556
+
557
+ if (hasPendingContent) {
558
+ captureSegment(state, captureStart, captureEnd, false);
559
+ writeFoldedLines(state, state.line - _line);
560
+ captureStart = captureEnd = state.position;
561
+ hasPendingContent = false;
562
+ }
563
+
564
+ if (!is_WHITE_SPACE(ch)) {
565
+ captureEnd = state.position + 1;
566
+ }
567
+
568
+ ch = state.input.charCodeAt(++state.position);
569
+ }
570
+
571
+ captureSegment(state, captureStart, captureEnd, false);
572
+
573
+ if (state.result) {
574
+ return true;
575
+ }
576
+
577
+ state.kind = _kind;
578
+ state.result = _result;
579
+ return false;
580
+ }
581
+
582
+ function readSingleQuotedScalar(state, nodeIndent) {
583
+ var ch,
584
+ captureStart, captureEnd;
585
+
586
+ ch = state.input.charCodeAt(state.position);
587
+
588
+ if (ch !== 0x27/* ' */) {
589
+ return false;
590
+ }
591
+
592
+ state.kind = 'scalar';
593
+ state.result = '';
594
+ state.position++;
595
+ captureStart = captureEnd = state.position;
596
+
597
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
598
+ if (ch === 0x27/* ' */) {
599
+ captureSegment(state, captureStart, state.position, true);
600
+ ch = state.input.charCodeAt(++state.position);
601
+
602
+ if (ch === 0x27/* ' */) {
603
+ captureStart = state.position;
604
+ state.position++;
605
+ captureEnd = state.position;
606
+ } else {
607
+ return true;
608
+ }
609
+
610
+ } else if (is_EOL(ch)) {
611
+ captureSegment(state, captureStart, captureEnd, true);
612
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
613
+ captureStart = captureEnd = state.position;
614
+
615
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
616
+ throwError(state, 'unexpected end of the document within a single quoted scalar');
617
+
618
+ } else {
619
+ state.position++;
620
+ captureEnd = state.position;
621
+ }
622
+ }
623
+
624
+ throwError(state, 'unexpected end of the stream within a single quoted scalar');
625
+ }
626
+
627
+ function readDoubleQuotedScalar(state, nodeIndent) {
628
+ var captureStart,
629
+ captureEnd,
630
+ hexLength,
631
+ hexResult,
632
+ tmp,
633
+ ch;
634
+
635
+ ch = state.input.charCodeAt(state.position);
636
+
637
+ if (ch !== 0x22/* " */) {
638
+ return false;
639
+ }
640
+
641
+ state.kind = 'scalar';
642
+ state.result = '';
643
+ state.position++;
644
+ captureStart = captureEnd = state.position;
645
+
646
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
647
+ if (ch === 0x22/* " */) {
648
+ captureSegment(state, captureStart, state.position, true);
649
+ state.position++;
650
+ return true;
651
+
652
+ } else if (ch === 0x5C/* \ */) {
653
+ captureSegment(state, captureStart, state.position, true);
654
+ ch = state.input.charCodeAt(++state.position);
655
+
656
+ if (is_EOL(ch)) {
657
+ skipSeparationSpace(state, false, nodeIndent);
658
+
659
+ // TODO: rework to inline fn with no type cast?
660
+ } else if (ch < 256 && simpleEscapeCheck[ch]) {
661
+ state.result += simpleEscapeMap[ch];
662
+ state.position++;
663
+
664
+ } else if ((tmp = escapedHexLen(ch)) > 0) {
665
+ hexLength = tmp;
666
+ hexResult = 0;
667
+
668
+ for (; hexLength > 0; hexLength--) {
669
+ ch = state.input.charCodeAt(++state.position);
670
+
671
+ if ((tmp = fromHexCode(ch)) >= 0) {
672
+ hexResult = (hexResult << 4) + tmp;
673
+
674
+ } else {
675
+ throwError(state, 'expected hexadecimal character');
676
+ }
677
+ }
678
+
679
+ state.result += charFromCodepoint(hexResult);
680
+
681
+ state.position++;
682
+
683
+ } else {
684
+ throwError(state, 'unknown escape sequence');
685
+ }
686
+
687
+ captureStart = captureEnd = state.position;
688
+
689
+ } else if (is_EOL(ch)) {
690
+ captureSegment(state, captureStart, captureEnd, true);
691
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
692
+ captureStart = captureEnd = state.position;
693
+
694
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
695
+ throwError(state, 'unexpected end of the document within a double quoted scalar');
696
+
697
+ } else {
698
+ state.position++;
699
+ captureEnd = state.position;
700
+ }
701
+ }
702
+
703
+ throwError(state, 'unexpected end of the stream within a double quoted scalar');
704
+ }
705
+
706
+ function readFlowCollection(state, nodeIndent) {
707
+ var readNext = true,
708
+ _line,
709
+ _lineStart,
710
+ _pos,
711
+ _tag = state.tag,
712
+ _result,
713
+ _anchor = state.anchor,
714
+ following,
715
+ terminator,
716
+ isPair,
717
+ isExplicitPair,
718
+ isMapping,
719
+ overridableKeys = Object.create(null),
720
+ keyNode,
721
+ keyTag,
722
+ valueNode,
723
+ ch;
724
+
725
+ ch = state.input.charCodeAt(state.position);
726
+
727
+ if (ch === 0x5B/* [ */) {
728
+ terminator = 0x5D;/* ] */
729
+ isMapping = false;
730
+ _result = [];
731
+ } else if (ch === 0x7B/* { */) {
732
+ terminator = 0x7D;/* } */
733
+ isMapping = true;
734
+ _result = {};
735
+ } else {
736
+ return false;
737
+ }
738
+
739
+ if (state.anchor !== null) {
740
+ state.anchorMap[state.anchor] = _result;
741
+ }
742
+
743
+ ch = state.input.charCodeAt(++state.position);
744
+
745
+ while (ch !== 0) {
746
+ skipSeparationSpace(state, true, nodeIndent);
747
+
748
+ ch = state.input.charCodeAt(state.position);
749
+
750
+ if (ch === terminator) {
751
+ state.position++;
752
+ state.tag = _tag;
753
+ state.anchor = _anchor;
754
+ state.kind = isMapping ? 'mapping' : 'sequence';
755
+ state.result = _result;
756
+ return true;
757
+ } else if (!readNext) {
758
+ throwError(state, 'missed comma between flow collection entries');
759
+ } else if (ch === 0x2C/* , */) {
760
+ // "flow collection entries can never be completely empty", as per YAML 1.2, section 7.4
761
+ throwError(state, "expected the node content, but found ','");
762
+ }
763
+
764
+ keyTag = keyNode = valueNode = null;
765
+ isPair = isExplicitPair = false;
766
+
767
+ if (ch === 0x3F/* ? */) {
768
+ following = state.input.charCodeAt(state.position + 1);
769
+
770
+ if (is_WS_OR_EOL(following)) {
771
+ isPair = isExplicitPair = true;
772
+ state.position++;
773
+ skipSeparationSpace(state, true, nodeIndent);
774
+ }
775
+ }
776
+
777
+ _line = state.line; // Save the current line.
778
+ _lineStart = state.lineStart;
779
+ _pos = state.position;
780
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
781
+ keyTag = state.tag;
782
+ keyNode = state.result;
783
+ skipSeparationSpace(state, true, nodeIndent);
784
+
785
+ ch = state.input.charCodeAt(state.position);
786
+
787
+ if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) {
788
+ isPair = true;
789
+ ch = state.input.charCodeAt(++state.position);
790
+ skipSeparationSpace(state, true, nodeIndent);
791
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
792
+ valueNode = state.result;
793
+ }
794
+
795
+ if (isMapping) {
796
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
797
+ } else if (isPair) {
798
+ _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
799
+ } else {
800
+ _result.push(keyNode);
801
+ }
802
+
803
+ skipSeparationSpace(state, true, nodeIndent);
804
+
805
+ ch = state.input.charCodeAt(state.position);
806
+
807
+ if (ch === 0x2C/* , */) {
808
+ readNext = true;
809
+ ch = state.input.charCodeAt(++state.position);
810
+ } else {
811
+ readNext = false;
812
+ }
813
+ }
814
+
815
+ throwError(state, 'unexpected end of the stream within a flow collection');
816
+ }
817
+
818
+ function readBlockScalar(state, nodeIndent) {
819
+ var captureStart,
820
+ folding,
821
+ chomping = CHOMPING_CLIP,
822
+ didReadContent = false,
823
+ detectedIndent = false,
824
+ textIndent = nodeIndent,
825
+ emptyLines = 0,
826
+ atMoreIndented = false,
827
+ tmp,
828
+ ch;
829
+
830
+ ch = state.input.charCodeAt(state.position);
831
+
832
+ if (ch === 0x7C/* | */) {
833
+ folding = false;
834
+ } else if (ch === 0x3E/* > */) {
835
+ folding = true;
836
+ } else {
837
+ return false;
838
+ }
839
+
840
+ state.kind = 'scalar';
841
+ state.result = '';
842
+
843
+ while (ch !== 0) {
844
+ ch = state.input.charCodeAt(++state.position);
845
+
846
+ if (ch === 0x2B/* + */ || ch === 0x2D/* - */) {
847
+ if (CHOMPING_CLIP === chomping) {
848
+ chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP;
849
+ } else {
850
+ throwError(state, 'repeat of a chomping mode identifier');
851
+ }
852
+
853
+ } else if ((tmp = fromDecimalCode(ch)) >= 0) {
854
+ if (tmp === 0) {
855
+ throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');
856
+ } else if (!detectedIndent) {
857
+ textIndent = nodeIndent + tmp - 1;
858
+ detectedIndent = true;
859
+ } else {
860
+ throwError(state, 'repeat of an indentation width identifier');
861
+ }
862
+
863
+ } else {
864
+ break;
865
+ }
866
+ }
867
+
868
+ if (is_WHITE_SPACE(ch)) {
869
+ do { ch = state.input.charCodeAt(++state.position); }
870
+ while (is_WHITE_SPACE(ch));
871
+
872
+ if (ch === 0x23/* # */) {
873
+ do { ch = state.input.charCodeAt(++state.position); }
874
+ while (!is_EOL(ch) && (ch !== 0));
875
+ }
876
+ }
877
+
878
+ while (ch !== 0) {
879
+ readLineBreak(state);
880
+ state.lineIndent = 0;
881
+
882
+ ch = state.input.charCodeAt(state.position);
883
+
884
+ while ((!detectedIndent || state.lineIndent < textIndent) &&
885
+ (ch === 0x20/* Space */)) {
886
+ state.lineIndent++;
887
+ ch = state.input.charCodeAt(++state.position);
888
+ }
889
+
890
+ if (!detectedIndent && state.lineIndent > textIndent) {
891
+ textIndent = state.lineIndent;
892
+ }
893
+
894
+ if (is_EOL(ch)) {
895
+ emptyLines++;
896
+ continue;
897
+ }
898
+
899
+ // End of the scalar.
900
+ if (state.lineIndent < textIndent) {
901
+
902
+ // Perform the chomping.
903
+ if (chomping === CHOMPING_KEEP) {
904
+ state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
905
+ } else if (chomping === CHOMPING_CLIP) {
906
+ if (didReadContent) { // i.e. only if the scalar is not empty.
907
+ state.result += '\n';
908
+ }
909
+ }
910
+
911
+ // Break this `while` cycle and go to the funciton's epilogue.
912
+ break;
913
+ }
914
+
915
+ // Folded style: use fancy rules to handle line breaks.
916
+ if (folding) {
917
+
918
+ // Lines starting with white space characters (more-indented lines) are not folded.
919
+ if (is_WHITE_SPACE(ch)) {
920
+ atMoreIndented = true;
921
+ // except for the first content line (cf. Example 8.1)
922
+ state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
923
+
924
+ // End of more-indented block.
925
+ } else if (atMoreIndented) {
926
+ atMoreIndented = false;
927
+ state.result += common.repeat('\n', emptyLines + 1);
928
+
929
+ // Just one line break - perceive as the same line.
930
+ } else if (emptyLines === 0) {
931
+ if (didReadContent) { // i.e. only if we have already read some scalar content.
932
+ state.result += ' ';
933
+ }
934
+
935
+ // Several line breaks - perceive as different lines.
936
+ } else {
937
+ state.result += common.repeat('\n', emptyLines);
938
+ }
939
+
940
+ // Literal style: just add exact number of line breaks between content lines.
941
+ } else {
942
+ // Keep all line breaks except the header line break.
943
+ state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
944
+ }
945
+
946
+ didReadContent = true;
947
+ detectedIndent = true;
948
+ emptyLines = 0;
949
+ captureStart = state.position;
950
+
951
+ while (!is_EOL(ch) && (ch !== 0)) {
952
+ ch = state.input.charCodeAt(++state.position);
953
+ }
954
+
955
+ captureSegment(state, captureStart, state.position, false);
956
+ }
957
+
958
+ return true;
959
+ }
960
+
961
+ function readBlockSequence(state, nodeIndent) {
962
+ var _line,
963
+ _tag = state.tag,
964
+ _anchor = state.anchor,
965
+ _result = [],
966
+ following,
967
+ detected = false,
968
+ ch;
969
+
970
+ // there is a leading tab before this token, so it can't be a block sequence/mapping;
971
+ // it can still be flow sequence/mapping or a scalar
972
+ if (state.firstTabInLine !== -1) return false;
973
+
974
+ if (state.anchor !== null) {
975
+ state.anchorMap[state.anchor] = _result;
976
+ }
977
+
978
+ ch = state.input.charCodeAt(state.position);
979
+
980
+ while (ch !== 0) {
981
+ if (state.firstTabInLine !== -1) {
982
+ state.position = state.firstTabInLine;
983
+ throwError(state, 'tab characters must not be used in indentation');
984
+ }
985
+
986
+ if (ch !== 0x2D/* - */) {
987
+ break;
988
+ }
989
+
990
+ following = state.input.charCodeAt(state.position + 1);
991
+
992
+ if (!is_WS_OR_EOL(following)) {
993
+ break;
994
+ }
995
+
996
+ detected = true;
997
+ state.position++;
998
+
999
+ if (skipSeparationSpace(state, true, -1)) {
1000
+ if (state.lineIndent <= nodeIndent) {
1001
+ _result.push(null);
1002
+ ch = state.input.charCodeAt(state.position);
1003
+ continue;
1004
+ }
1005
+ }
1006
+
1007
+ _line = state.line;
1008
+ composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
1009
+ _result.push(state.result);
1010
+ skipSeparationSpace(state, true, -1);
1011
+
1012
+ ch = state.input.charCodeAt(state.position);
1013
+
1014
+ if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
1015
+ throwError(state, 'bad indentation of a sequence entry');
1016
+ } else if (state.lineIndent < nodeIndent) {
1017
+ break;
1018
+ }
1019
+ }
1020
+
1021
+ if (detected) {
1022
+ state.tag = _tag;
1023
+ state.anchor = _anchor;
1024
+ state.kind = 'sequence';
1025
+ state.result = _result;
1026
+ return true;
1027
+ }
1028
+ return false;
1029
+ }
1030
+
1031
+ function readBlockMapping(state, nodeIndent, flowIndent) {
1032
+ var following,
1033
+ allowCompact,
1034
+ _line,
1035
+ _keyLine,
1036
+ _keyLineStart,
1037
+ _keyPos,
1038
+ _tag = state.tag,
1039
+ _anchor = state.anchor,
1040
+ _result = {},
1041
+ overridableKeys = Object.create(null),
1042
+ keyTag = null,
1043
+ keyNode = null,
1044
+ valueNode = null,
1045
+ atExplicitKey = false,
1046
+ detected = false,
1047
+ ch;
1048
+
1049
+ // there is a leading tab before this token, so it can't be a block sequence/mapping;
1050
+ // it can still be flow sequence/mapping or a scalar
1051
+ if (state.firstTabInLine !== -1) return false;
1052
+
1053
+ if (state.anchor !== null) {
1054
+ state.anchorMap[state.anchor] = _result;
1055
+ }
1056
+
1057
+ ch = state.input.charCodeAt(state.position);
1058
+
1059
+ while (ch !== 0) {
1060
+ if (!atExplicitKey && state.firstTabInLine !== -1) {
1061
+ state.position = state.firstTabInLine;
1062
+ throwError(state, 'tab characters must not be used in indentation');
1063
+ }
1064
+
1065
+ following = state.input.charCodeAt(state.position + 1);
1066
+ _line = state.line; // Save the current line.
1067
+
1068
+ //
1069
+ // Explicit notation case. There are two separate blocks:
1070
+ // first for the key (denoted by "?") and second for the value (denoted by ":")
1071
+ //
1072
+ if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) {
1073
+
1074
+ if (ch === 0x3F/* ? */) {
1075
+ if (atExplicitKey) {
1076
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
1077
+ keyTag = keyNode = valueNode = null;
1078
+ }
1079
+
1080
+ detected = true;
1081
+ atExplicitKey = true;
1082
+ allowCompact = true;
1083
+
1084
+ } else if (atExplicitKey) {
1085
+ // i.e. 0x3A/* : */ === character after the explicit key.
1086
+ atExplicitKey = false;
1087
+ allowCompact = true;
1088
+
1089
+ } else {
1090
+ throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line');
1091
+ }
1092
+
1093
+ state.position += 1;
1094
+ ch = following;
1095
+
1096
+ //
1097
+ // Implicit notation case. Flow-style node as the key first, then ":", and the value.
1098
+ //
1099
+ } else {
1100
+ _keyLine = state.line;
1101
+ _keyLineStart = state.lineStart;
1102
+ _keyPos = state.position;
1103
+
1104
+ if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
1105
+ // Neither implicit nor explicit notation.
1106
+ // Reading is done. Go to the epilogue.
1107
+ break;
1108
+ }
1109
+
1110
+ if (state.line === _line) {
1111
+ ch = state.input.charCodeAt(state.position);
1112
+
1113
+ while (is_WHITE_SPACE(ch)) {
1114
+ ch = state.input.charCodeAt(++state.position);
1115
+ }
1116
+
1117
+ if (ch === 0x3A/* : */) {
1118
+ ch = state.input.charCodeAt(++state.position);
1119
+
1120
+ if (!is_WS_OR_EOL(ch)) {
1121
+ throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');
1122
+ }
1123
+
1124
+ if (atExplicitKey) {
1125
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
1126
+ keyTag = keyNode = valueNode = null;
1127
+ }
1128
+
1129
+ detected = true;
1130
+ atExplicitKey = false;
1131
+ allowCompact = false;
1132
+ keyTag = state.tag;
1133
+ keyNode = state.result;
1134
+
1135
+ } else if (detected) {
1136
+ throwError(state, 'can not read an implicit mapping pair; a colon is missed');
1137
+
1138
+ } else {
1139
+ state.tag = _tag;
1140
+ state.anchor = _anchor;
1141
+ return true; // Keep the result of `composeNode`.
1142
+ }
1143
+
1144
+ } else if (detected) {
1145
+ throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');
1146
+
1147
+ } else {
1148
+ state.tag = _tag;
1149
+ state.anchor = _anchor;
1150
+ return true; // Keep the result of `composeNode`.
1151
+ }
1152
+ }
1153
+
1154
+ //
1155
+ // Common reading code for both explicit and implicit notations.
1156
+ //
1157
+ if (state.line === _line || state.lineIndent > nodeIndent) {
1158
+ if (atExplicitKey) {
1159
+ _keyLine = state.line;
1160
+ _keyLineStart = state.lineStart;
1161
+ _keyPos = state.position;
1162
+ }
1163
+
1164
+ if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
1165
+ if (atExplicitKey) {
1166
+ keyNode = state.result;
1167
+ } else {
1168
+ valueNode = state.result;
1169
+ }
1170
+ }
1171
+
1172
+ if (!atExplicitKey) {
1173
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
1174
+ keyTag = keyNode = valueNode = null;
1175
+ }
1176
+
1177
+ skipSeparationSpace(state, true, -1);
1178
+ ch = state.input.charCodeAt(state.position);
1179
+ }
1180
+
1181
+ if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
1182
+ throwError(state, 'bad indentation of a mapping entry');
1183
+ } else if (state.lineIndent < nodeIndent) {
1184
+ break;
1185
+ }
1186
+ }
1187
+
1188
+ //
1189
+ // Epilogue.
1190
+ //
1191
+
1192
+ // Special case: last mapping's node contains only the key in explicit notation.
1193
+ if (atExplicitKey) {
1194
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
1195
+ }
1196
+
1197
+ // Expose the resulting mapping.
1198
+ if (detected) {
1199
+ state.tag = _tag;
1200
+ state.anchor = _anchor;
1201
+ state.kind = 'mapping';
1202
+ state.result = _result;
1203
+ }
1204
+
1205
+ return detected;
1206
+ }
1207
+
1208
+ function readTagProperty(state) {
1209
+ var _position,
1210
+ isVerbatim = false,
1211
+ isNamed = false,
1212
+ tagHandle,
1213
+ tagName,
1214
+ ch;
1215
+
1216
+ ch = state.input.charCodeAt(state.position);
1217
+
1218
+ if (ch !== 0x21/* ! */) return false;
1219
+
1220
+ if (state.tag !== null) {
1221
+ throwError(state, 'duplication of a tag property');
1222
+ }
1223
+
1224
+ ch = state.input.charCodeAt(++state.position);
1225
+
1226
+ if (ch === 0x3C/* < */) {
1227
+ isVerbatim = true;
1228
+ ch = state.input.charCodeAt(++state.position);
1229
+
1230
+ } else if (ch === 0x21/* ! */) {
1231
+ isNamed = true;
1232
+ tagHandle = '!!';
1233
+ ch = state.input.charCodeAt(++state.position);
1234
+
1235
+ } else {
1236
+ tagHandle = '!';
1237
+ }
1238
+
1239
+ _position = state.position;
1240
+
1241
+ if (isVerbatim) {
1242
+ do { ch = state.input.charCodeAt(++state.position); }
1243
+ while (ch !== 0 && ch !== 0x3E/* > */);
1244
+
1245
+ if (state.position < state.length) {
1246
+ tagName = state.input.slice(_position, state.position);
1247
+ ch = state.input.charCodeAt(++state.position);
1248
+ } else {
1249
+ throwError(state, 'unexpected end of the stream within a verbatim tag');
1250
+ }
1251
+ } else {
1252
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
1253
+
1254
+ if (ch === 0x21/* ! */) {
1255
+ if (!isNamed) {
1256
+ tagHandle = state.input.slice(_position - 1, state.position + 1);
1257
+
1258
+ if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
1259
+ throwError(state, 'named tag handle cannot contain such characters');
1260
+ }
1261
+
1262
+ isNamed = true;
1263
+ _position = state.position + 1;
1264
+ } else {
1265
+ throwError(state, 'tag suffix cannot contain exclamation marks');
1266
+ }
1267
+ }
1268
+
1269
+ ch = state.input.charCodeAt(++state.position);
1270
+ }
1271
+
1272
+ tagName = state.input.slice(_position, state.position);
1273
+
1274
+ if (PATTERN_FLOW_INDICATORS.test(tagName)) {
1275
+ throwError(state, 'tag suffix cannot contain flow indicator characters');
1276
+ }
1277
+ }
1278
+
1279
+ if (tagName && !PATTERN_TAG_URI.test(tagName)) {
1280
+ throwError(state, 'tag name cannot contain such characters: ' + tagName);
1281
+ }
1282
+
1283
+ try {
1284
+ tagName = decodeURIComponent(tagName);
1285
+ } catch (err) {
1286
+ throwError(state, 'tag name is malformed: ' + tagName);
1287
+ }
1288
+
1289
+ if (isVerbatim) {
1290
+ state.tag = tagName;
1291
+
1292
+ } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
1293
+ state.tag = state.tagMap[tagHandle] + tagName;
1294
+
1295
+ } else if (tagHandle === '!') {
1296
+ state.tag = '!' + tagName;
1297
+
1298
+ } else if (tagHandle === '!!') {
1299
+ state.tag = 'tag:yaml.org,2002:' + tagName;
1300
+
1301
+ } else {
1302
+ throwError(state, 'undeclared tag handle "' + tagHandle + '"');
1303
+ }
1304
+
1305
+ return true;
1306
+ }
1307
+
1308
+ function readAnchorProperty(state) {
1309
+ var _position,
1310
+ ch;
1311
+
1312
+ ch = state.input.charCodeAt(state.position);
1313
+
1314
+ if (ch !== 0x26/* & */) return false;
1315
+
1316
+ if (state.anchor !== null) {
1317
+ throwError(state, 'duplication of an anchor property');
1318
+ }
1319
+
1320
+ ch = state.input.charCodeAt(++state.position);
1321
+ _position = state.position;
1322
+
1323
+ while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
1324
+ ch = state.input.charCodeAt(++state.position);
1325
+ }
1326
+
1327
+ if (state.position === _position) {
1328
+ throwError(state, 'name of an anchor node must contain at least one character');
1329
+ }
1330
+
1331
+ state.anchor = state.input.slice(_position, state.position);
1332
+ return true;
1333
+ }
1334
+
1335
+ function readAlias(state) {
1336
+ var _position, alias,
1337
+ ch;
1338
+
1339
+ ch = state.input.charCodeAt(state.position);
1340
+
1341
+ if (ch !== 0x2A/* * */) return false;
1342
+
1343
+ ch = state.input.charCodeAt(++state.position);
1344
+ _position = state.position;
1345
+
1346
+ while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
1347
+ ch = state.input.charCodeAt(++state.position);
1348
+ }
1349
+
1350
+ if (state.position === _position) {
1351
+ throwError(state, 'name of an alias node must contain at least one character');
1352
+ }
1353
+
1354
+ alias = state.input.slice(_position, state.position);
1355
+
1356
+ if (!_hasOwnProperty.call(state.anchorMap, alias)) {
1357
+ throwError(state, 'unidentified alias "' + alias + '"');
1358
+ }
1359
+
1360
+ state.result = state.anchorMap[alias];
1361
+ skipSeparationSpace(state, true, -1);
1362
+ return true;
1363
+ }
1364
+
1365
+ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
1366
+ var allowBlockStyles,
1367
+ allowBlockScalars,
1368
+ allowBlockCollections,
1369
+ indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this<parent
1370
+ atNewLine = false,
1371
+ hasContent = false,
1372
+ typeIndex,
1373
+ typeQuantity,
1374
+ typeList,
1375
+ type,
1376
+ flowIndent,
1377
+ blockIndent;
1378
+
1379
+ if (state.listener !== null) {
1380
+ state.listener('open', state);
1381
+ }
1382
+
1383
+ state.tag = null;
1384
+ state.anchor = null;
1385
+ state.kind = null;
1386
+ state.result = null;
1387
+
1388
+ allowBlockStyles = allowBlockScalars = allowBlockCollections =
1389
+ CONTEXT_BLOCK_OUT === nodeContext ||
1390
+ CONTEXT_BLOCK_IN === nodeContext;
1391
+
1392
+ if (allowToSeek) {
1393
+ if (skipSeparationSpace(state, true, -1)) {
1394
+ atNewLine = true;
1395
+
1396
+ if (state.lineIndent > parentIndent) {
1397
+ indentStatus = 1;
1398
+ } else if (state.lineIndent === parentIndent) {
1399
+ indentStatus = 0;
1400
+ } else if (state.lineIndent < parentIndent) {
1401
+ indentStatus = -1;
1402
+ }
1403
+ }
1404
+ }
1405
+
1406
+ if (indentStatus === 1) {
1407
+ while (readTagProperty(state) || readAnchorProperty(state)) {
1408
+ if (skipSeparationSpace(state, true, -1)) {
1409
+ atNewLine = true;
1410
+ allowBlockCollections = allowBlockStyles;
1411
+
1412
+ if (state.lineIndent > parentIndent) {
1413
+ indentStatus = 1;
1414
+ } else if (state.lineIndent === parentIndent) {
1415
+ indentStatus = 0;
1416
+ } else if (state.lineIndent < parentIndent) {
1417
+ indentStatus = -1;
1418
+ }
1419
+ } else {
1420
+ allowBlockCollections = false;
1421
+ }
1422
+ }
1423
+ }
1424
+
1425
+ if (allowBlockCollections) {
1426
+ allowBlockCollections = atNewLine || allowCompact;
1427
+ }
1428
+
1429
+ if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
1430
+ if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
1431
+ flowIndent = parentIndent;
1432
+ } else {
1433
+ flowIndent = parentIndent + 1;
1434
+ }
1435
+
1436
+ blockIndent = state.position - state.lineStart;
1437
+
1438
+ if (indentStatus === 1) {
1439
+ if (allowBlockCollections &&
1440
+ (readBlockSequence(state, blockIndent) ||
1441
+ readBlockMapping(state, blockIndent, flowIndent)) ||
1442
+ readFlowCollection(state, flowIndent)) {
1443
+ hasContent = true;
1444
+ } else {
1445
+ if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||
1446
+ readSingleQuotedScalar(state, flowIndent) ||
1447
+ readDoubleQuotedScalar(state, flowIndent)) {
1448
+ hasContent = true;
1449
+
1450
+ } else if (readAlias(state)) {
1451
+ hasContent = true;
1452
+
1453
+ if (state.tag !== null || state.anchor !== null) {
1454
+ throwError(state, 'alias node should not have any properties');
1455
+ }
1456
+
1457
+ } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
1458
+ hasContent = true;
1459
+
1460
+ if (state.tag === null) {
1461
+ state.tag = '?';
1462
+ }
1463
+ }
1464
+
1465
+ if (state.anchor !== null) {
1466
+ state.anchorMap[state.anchor] = state.result;
1467
+ }
1468
+ }
1469
+ } else if (indentStatus === 0) {
1470
+ // Special case: block sequences are allowed to have same indentation level as the parent.
1471
+ // http://www.yaml.org/spec/1.2/spec.html#id2799784
1472
+ hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
1473
+ }
1474
+ }
1475
+
1476
+ if (state.tag === null) {
1477
+ if (state.anchor !== null) {
1478
+ state.anchorMap[state.anchor] = state.result;
1479
+ }
1480
+
1481
+ } else if (state.tag === '?') {
1482
+ // Implicit resolving is not allowed for non-scalar types, and '?'
1483
+ // non-specific tag is only automatically assigned to plain scalars.
1484
+ //
1485
+ // We only need to check kind conformity in case user explicitly assigns '?'
1486
+ // tag, for example like this: "!<?> [0]"
1487
+ //
1488
+ if (state.result !== null && state.kind !== 'scalar') {
1489
+ throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
1490
+ }
1491
+
1492
+ for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
1493
+ type = state.implicitTypes[typeIndex];
1494
+
1495
+ if (type.resolve(state.result)) { // `state.result` updated in resolver if matched
1496
+ state.result = type.construct(state.result);
1497
+ state.tag = type.tag;
1498
+ if (state.anchor !== null) {
1499
+ state.anchorMap[state.anchor] = state.result;
1500
+ }
1501
+ break;
1502
+ }
1503
+ }
1504
+ } else if (state.tag !== '!') {
1505
+ if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) {
1506
+ type = state.typeMap[state.kind || 'fallback'][state.tag];
1507
+ } else {
1508
+ // looking for multi type
1509
+ type = null;
1510
+ typeList = state.typeMap.multi[state.kind || 'fallback'];
1511
+
1512
+ for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {
1513
+ if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
1514
+ type = typeList[typeIndex];
1515
+ break;
1516
+ }
1517
+ }
1518
+ }
1519
+
1520
+ if (!type) {
1521
+ throwError(state, 'unknown tag !<' + state.tag + '>');
1522
+ }
1523
+
1524
+ if (state.result !== null && type.kind !== state.kind) {
1525
+ throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
1526
+ }
1527
+
1528
+ if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched
1529
+ throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');
1530
+ } else {
1531
+ state.result = type.construct(state.result, state.tag);
1532
+ if (state.anchor !== null) {
1533
+ state.anchorMap[state.anchor] = state.result;
1534
+ }
1535
+ }
1536
+ }
1537
+
1538
+ if (state.listener !== null) {
1539
+ state.listener('close', state);
1540
+ }
1541
+ return state.tag !== null || state.anchor !== null || hasContent;
1542
+ }
1543
+
1544
+ function readDocument(state) {
1545
+ var documentStart = state.position,
1546
+ _position,
1547
+ directiveName,
1548
+ directiveArgs,
1549
+ hasDirectives = false,
1550
+ ch;
1551
+
1552
+ state.version = null;
1553
+ state.checkLineBreaks = state.legacy;
1554
+ state.tagMap = Object.create(null);
1555
+ state.anchorMap = Object.create(null);
1556
+
1557
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
1558
+ skipSeparationSpace(state, true, -1);
1559
+
1560
+ ch = state.input.charCodeAt(state.position);
1561
+
1562
+ if (state.lineIndent > 0 || ch !== 0x25/* % */) {
1563
+ break;
1564
+ }
1565
+
1566
+ hasDirectives = true;
1567
+ ch = state.input.charCodeAt(++state.position);
1568
+ _position = state.position;
1569
+
1570
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
1571
+ ch = state.input.charCodeAt(++state.position);
1572
+ }
1573
+
1574
+ directiveName = state.input.slice(_position, state.position);
1575
+ directiveArgs = [];
1576
+
1577
+ if (directiveName.length < 1) {
1578
+ throwError(state, 'directive name must not be less than one character in length');
1579
+ }
1580
+
1581
+ while (ch !== 0) {
1582
+ while (is_WHITE_SPACE(ch)) {
1583
+ ch = state.input.charCodeAt(++state.position);
1584
+ }
1585
+
1586
+ if (ch === 0x23/* # */) {
1587
+ do { ch = state.input.charCodeAt(++state.position); }
1588
+ while (ch !== 0 && !is_EOL(ch));
1589
+ break;
1590
+ }
1591
+
1592
+ if (is_EOL(ch)) break;
1593
+
1594
+ _position = state.position;
1595
+
1596
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
1597
+ ch = state.input.charCodeAt(++state.position);
1598
+ }
1599
+
1600
+ directiveArgs.push(state.input.slice(_position, state.position));
1601
+ }
1602
+
1603
+ if (ch !== 0) readLineBreak(state);
1604
+
1605
+ if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
1606
+ directiveHandlers[directiveName](state, directiveName, directiveArgs);
1607
+ } else {
1608
+ throwWarning(state, 'unknown document directive "' + directiveName + '"');
1609
+ }
1610
+ }
1611
+
1612
+ skipSeparationSpace(state, true, -1);
1613
+
1614
+ if (state.lineIndent === 0 &&
1615
+ state.input.charCodeAt(state.position) === 0x2D/* - */ &&
1616
+ state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&
1617
+ state.input.charCodeAt(state.position + 2) === 0x2D/* - */) {
1618
+ state.position += 3;
1619
+ skipSeparationSpace(state, true, -1);
1620
+
1621
+ } else if (hasDirectives) {
1622
+ throwError(state, 'directives end mark is expected');
1623
+ }
1624
+
1625
+ composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
1626
+ skipSeparationSpace(state, true, -1);
1627
+
1628
+ if (state.checkLineBreaks &&
1629
+ PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
1630
+ throwWarning(state, 'non-ASCII line breaks are interpreted as content');
1631
+ }
1632
+
1633
+ state.documents.push(state.result);
1634
+
1635
+ if (state.position === state.lineStart && testDocumentSeparator(state)) {
1636
+
1637
+ if (state.input.charCodeAt(state.position) === 0x2E/* . */) {
1638
+ state.position += 3;
1639
+ skipSeparationSpace(state, true, -1);
1640
+ }
1641
+ return;
1642
+ }
1643
+
1644
+ if (state.position < (state.length - 1)) {
1645
+ throwError(state, 'end of the stream or a document separator is expected');
1646
+ } else {
1647
+ return;
1648
+ }
1649
+ }
1650
+
1651
+
1652
+ function loadDocuments(input, options) {
1653
+ input = String(input);
1654
+ options = options || {};
1655
+
1656
+ if (input.length !== 0) {
1657
+
1658
+ // Add tailing `\n` if not exists
1659
+ if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&
1660
+ input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {
1661
+ input += '\n';
1662
+ }
1663
+
1664
+ // Strip BOM
1665
+ if (input.charCodeAt(0) === 0xFEFF) {
1666
+ input = input.slice(1);
1667
+ }
1668
+ }
1669
+
1670
+ var state = new State(input, options);
1671
+
1672
+ var nullpos = input.indexOf('\0');
1673
+
1674
+ if (nullpos !== -1) {
1675
+ state.position = nullpos;
1676
+ throwError(state, 'null byte is not allowed in input');
1677
+ }
1678
+
1679
+ // Use 0 as string terminator. That significantly simplifies bounds check.
1680
+ state.input += '\0';
1681
+
1682
+ while (state.input.charCodeAt(state.position) === 0x20/* Space */) {
1683
+ state.lineIndent += 1;
1684
+ state.position += 1;
1685
+ }
1686
+
1687
+ while (state.position < (state.length - 1)) {
1688
+ readDocument(state);
1689
+ }
1690
+
1691
+ return state.documents;
1692
+ }
1693
+
1694
+
1695
+ function loadAll(input, iterator, options) {
1696
+ if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {
1697
+ options = iterator;
1698
+ iterator = null;
1699
+ }
1700
+
1701
+ var documents = loadDocuments(input, options);
1702
+
1703
+ if (typeof iterator !== 'function') {
1704
+ return documents;
1705
+ }
1706
+
1707
+ for (var index = 0, length = documents.length; index < length; index += 1) {
1708
+ iterator(documents[index]);
1709
+ }
1710
+ }
1711
+
1712
+
1713
+ function load(input, options) {
1714
+ var documents = loadDocuments(input, options);
1715
+
1716
+ if (documents.length === 0) {
1717
+ /*eslint-disable no-undefined*/
1718
+ return undefined;
1719
+ } else if (documents.length === 1) {
1720
+ return documents[0];
1721
+ }
1722
+ throw new YAMLException('expected a single document in the stream, but found more');
1723
+ }
1724
+
1725
+
1726
+ module.exports.loadAll = loadAll;
1727
+ module.exports.load = load;