@inventreedb/ui 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +5 -5
- package/dist/enums/ApiEndpoints.d.ts +4 -0
- package/dist/enums/ApiEndpoints.js +4 -0
- package/dist/enums/ApiEndpoints.js.map +1 -1
- package/dist/enums/Roles.d.ts +1 -0
- package/dist/enums/Roles.js.map +1 -1
- package/dist/functions/Navigation.d.ts +6 -1
- package/dist/functions/Navigation.js.map +1 -1
- package/dist/functions/Plugins.d.ts +4 -0
- package/dist/functions/Plugins.js +20 -4
- package/dist/functions/Plugins.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -1
- package/dist/node_modules/@lingui/core/dist/index.js +1 -1
- package/dist/node_modules/@lingui/{message-utils → core/node_modules/@lingui/message-utils}/dist/compileMessage.js +1 -1
- package/dist/node_modules/@lingui/core/node_modules/@lingui/message-utils/dist/compileMessage.js.map +1 -0
- package/dist/node_modules/@messageformat/parser/lib/lexer.js +1 -1
- package/dist/node_modules/@messageformat/parser/lib/lexer.js.map +1 -1
- package/dist/node_modules/@messageformat/parser/lib/parser.js +17 -10
- package/dist/node_modules/@messageformat/parser/lib/parser.js.map +1 -1
- package/dist/types/Auth.d.ts +2 -1
- package/dist/types/Forms.d.ts +7 -5
- package/dist/types/Plugins.d.ts +10 -1
- package/dist/types/Plugins.js +11 -2
- package/dist/types/Plugins.js.map +1 -1
- package/dist/types/Settings.d.ts +1 -0
- package/lib/enums/ApiEndpoints.tsx +4 -0
- package/lib/enums/Roles.tsx +29 -0
- package/lib/functions/Navigation.tsx +24 -1
- package/lib/functions/Plugins.tsx +30 -5
- package/lib/index.ts +6 -1
- package/lib/types/Auth.tsx +2 -1
- package/lib/types/Forms.tsx +7 -5
- package/lib/types/Plugins.tsx +16 -1
- package/lib/types/Settings.tsx +1 -0
- package/package.json +4 -4
- package/dist/node_modules/@lingui/message-utils/dist/compileMessage.js.map +0 -1
package/dist/.vite/manifest.json
CHANGED
|
@@ -117,13 +117,13 @@
|
|
|
117
117
|
"src": "node_modules/@lingui/core/dist/index.mjs",
|
|
118
118
|
"imports": [
|
|
119
119
|
"/home/inventree/src/frontend/node_modules/unraw/dist/index.js?commonjs-es-import",
|
|
120
|
-
"node_modules/@lingui/message-utils/dist/compileMessage.mjs"
|
|
120
|
+
"node_modules/@lingui/core/node_modules/@lingui/message-utils/dist/compileMessage.mjs"
|
|
121
121
|
]
|
|
122
122
|
},
|
|
123
|
-
"node_modules/@lingui/message-utils/dist/compileMessage.mjs": {
|
|
124
|
-
"file": "node_modules/@lingui/message-utils/dist/compileMessage.js",
|
|
125
|
-
"name": "node_modules/@lingui/message-utils/dist/compileMessage",
|
|
126
|
-
"src": "node_modules/@lingui/message-utils/dist/compileMessage.mjs",
|
|
123
|
+
"node_modules/@lingui/core/node_modules/@lingui/message-utils/dist/compileMessage.mjs": {
|
|
124
|
+
"file": "node_modules/@lingui/core/node_modules/@lingui/message-utils/dist/compileMessage.js",
|
|
125
|
+
"name": "node_modules/@lingui/core/node_modules/@lingui/message-utils/dist/compileMessage",
|
|
126
|
+
"src": "node_modules/@lingui/core/node_modules/@lingui/message-utils/dist/compileMessage.mjs",
|
|
127
127
|
"imports": [
|
|
128
128
|
"/home/inventree/src/frontend/node_modules/@messageformat/parser/lib/parser.js?commonjs-es-import"
|
|
129
129
|
]
|
|
@@ -18,6 +18,7 @@ export declare enum ApiEndpoints {
|
|
|
18
18
|
auth_recovery = "auth/v1/account/authenticators/recovery-codes",
|
|
19
19
|
auth_mfa_reauthenticate = "auth/v1/auth/2fa/reauthenticate",
|
|
20
20
|
auth_totp = "auth/v1/account/authenticators/totp",
|
|
21
|
+
auth_trust = "auth/v1/auth/2fa/trust",
|
|
21
22
|
auth_reauthenticate = "auth/v1/auth/reauthenticate",
|
|
22
23
|
auth_email = "auth/v1/account/email",
|
|
23
24
|
auth_email_verify = "auth/v1/auth/email/verify",
|
|
@@ -41,6 +42,7 @@ export declare enum ApiEndpoints {
|
|
|
41
42
|
license = "license/",
|
|
42
43
|
group_list = "user/group/",
|
|
43
44
|
owner_list = "user/owner/",
|
|
45
|
+
ruleset_list = "user/ruleset/",
|
|
44
46
|
content_type_list = "contenttype/",
|
|
45
47
|
icons = "icons/",
|
|
46
48
|
selectionlist_list = "selection/",
|
|
@@ -75,6 +77,7 @@ export declare enum ApiEndpoints {
|
|
|
75
77
|
bom_list = "bom/",
|
|
76
78
|
bom_item_validate = "bom/:id/validate/",
|
|
77
79
|
bom_validate = "part/:id/bom-validate/",
|
|
80
|
+
bom_substitute_list = "bom/substitute/",
|
|
78
81
|
part_list = "part/",
|
|
79
82
|
part_parameter_list = "part/parameter/",
|
|
80
83
|
part_parameter_template_list = "part/parameter/template/",
|
|
@@ -117,6 +120,7 @@ export declare enum ApiEndpoints {
|
|
|
117
120
|
stock_uninstall = "stock/:id/uninstall/",
|
|
118
121
|
stock_serialize = "stock/:id/serialize/",
|
|
119
122
|
stock_return = "stock/:id/return/",
|
|
123
|
+
stock_serial_info = "stock/:id/serial-numbers/",
|
|
120
124
|
generate_batch_code = "generate/batch-code/",
|
|
121
125
|
generate_serial_number = "generate/serial-number/",
|
|
122
126
|
purchase_order_list = "order/po/",
|
|
@@ -18,6 +18,7 @@ var ApiEndpoints = /* @__PURE__ */ ((ApiEndpoints2) => {
|
|
|
18
18
|
ApiEndpoints2["auth_recovery"] = "auth/v1/account/authenticators/recovery-codes";
|
|
19
19
|
ApiEndpoints2["auth_mfa_reauthenticate"] = "auth/v1/auth/2fa/reauthenticate";
|
|
20
20
|
ApiEndpoints2["auth_totp"] = "auth/v1/account/authenticators/totp";
|
|
21
|
+
ApiEndpoints2["auth_trust"] = "auth/v1/auth/2fa/trust";
|
|
21
22
|
ApiEndpoints2["auth_reauthenticate"] = "auth/v1/auth/reauthenticate";
|
|
22
23
|
ApiEndpoints2["auth_email"] = "auth/v1/account/email";
|
|
23
24
|
ApiEndpoints2["auth_email_verify"] = "auth/v1/auth/email/verify";
|
|
@@ -41,6 +42,7 @@ var ApiEndpoints = /* @__PURE__ */ ((ApiEndpoints2) => {
|
|
|
41
42
|
ApiEndpoints2["license"] = "license/";
|
|
42
43
|
ApiEndpoints2["group_list"] = "user/group/";
|
|
43
44
|
ApiEndpoints2["owner_list"] = "user/owner/";
|
|
45
|
+
ApiEndpoints2["ruleset_list"] = "user/ruleset/";
|
|
44
46
|
ApiEndpoints2["content_type_list"] = "contenttype/";
|
|
45
47
|
ApiEndpoints2["icons"] = "icons/";
|
|
46
48
|
ApiEndpoints2["selectionlist_list"] = "selection/";
|
|
@@ -75,6 +77,7 @@ var ApiEndpoints = /* @__PURE__ */ ((ApiEndpoints2) => {
|
|
|
75
77
|
ApiEndpoints2["bom_list"] = "bom/";
|
|
76
78
|
ApiEndpoints2["bom_item_validate"] = "bom/:id/validate/";
|
|
77
79
|
ApiEndpoints2["bom_validate"] = "part/:id/bom-validate/";
|
|
80
|
+
ApiEndpoints2["bom_substitute_list"] = "bom/substitute/";
|
|
78
81
|
ApiEndpoints2["part_list"] = "part/";
|
|
79
82
|
ApiEndpoints2["part_parameter_list"] = "part/parameter/";
|
|
80
83
|
ApiEndpoints2["part_parameter_template_list"] = "part/parameter/template/";
|
|
@@ -117,6 +120,7 @@ var ApiEndpoints = /* @__PURE__ */ ((ApiEndpoints2) => {
|
|
|
117
120
|
ApiEndpoints2["stock_uninstall"] = "stock/:id/uninstall/";
|
|
118
121
|
ApiEndpoints2["stock_serialize"] = "stock/:id/serialize/";
|
|
119
122
|
ApiEndpoints2["stock_return"] = "stock/:id/return/";
|
|
123
|
+
ApiEndpoints2["stock_serial_info"] = "stock/:id/serial-numbers/";
|
|
120
124
|
ApiEndpoints2["generate_batch_code"] = "generate/batch-code/";
|
|
121
125
|
ApiEndpoints2["generate_serial_number"] = "generate/serial-number/";
|
|
122
126
|
ApiEndpoints2["purchase_order_list"] = "order/po/";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiEndpoints.js","sources":["../../lib/enums/ApiEndpoints.tsx"],"sourcesContent":["/*\n * Enumeration of available API endpoints.\n *\n * In the cases where endpoints can be accessed with a primary key,\n * the primary key should be appended to the endpoint.\n * The exception to this is when the endpoint provides an :id parameter.\n */\n\nexport enum ApiEndpoints {\n api_server_info = '',\n\n // User API endpoints\n user_list = 'user/',\n user_me = 'user/me/',\n user_profile = 'user/profile/',\n user_roles = 'user/roles/',\n user_token = 'user/token/',\n user_tokens = 'user/tokens/',\n user_simple_login = 'email/generate/',\n\n // User auth endpoints\n user_reset = 'auth/v1/auth/password/request',\n user_reset_set = 'auth/v1/auth/password/reset',\n auth_pwd_change = 'auth/v1/account/password/change',\n auth_login = 'auth/v1/auth/login',\n auth_login_2fa = 'auth/v1/auth/2fa/authenticate',\n auth_session = 'auth/v1/auth/session',\n auth_signup = 'auth/v1/auth/signup',\n auth_authenticators = 'auth/v1/account/authenticators',\n auth_recovery = 'auth/v1/account/authenticators/recovery-codes',\n auth_mfa_reauthenticate = 'auth/v1/auth/2fa/reauthenticate',\n auth_totp = 'auth/v1/account/authenticators/totp',\n auth_reauthenticate = 'auth/v1/auth/reauthenticate',\n auth_email = 'auth/v1/account/email',\n auth_email_verify = 'auth/v1/auth/email/verify',\n auth_providers = 'auth/v1/account/providers',\n auth_provider_redirect = 'auth/v1/auth/provider/redirect',\n auth_config = 'auth/v1/config',\n\n // Generic API endpoints\n currency_list = 'currency/exchange/',\n currency_refresh = 'currency/refresh/',\n all_units = 'units/all/',\n task_overview = 'background-task/',\n task_pending_list = 'background-task/pending/',\n task_scheduled_list = 'background-task/scheduled/',\n task_failed_list = 'background-task/failed/',\n api_search = 'search/',\n settings_global_list = 'settings/global/',\n settings_user_list = 'settings/user/',\n news = 'news/',\n global_status = 'generic/status/',\n custom_state_list = 'generic/status/custom/',\n version = 'version/',\n license = 'license/',\n group_list = 'user/group/',\n owner_list = 'user/owner/',\n content_type_list = 'contenttype/',\n icons = 'icons/',\n selectionlist_list = 'selection/',\n selectionlist_detail = 'selection/:id/',\n\n // Barcode API endpoints\n barcode = 'barcode/',\n barcode_history = 'barcode/history/',\n barcode_link = 'barcode/link/',\n barcode_unlink = 'barcode/unlink/',\n barcode_generate = 'barcode/generate/',\n\n // Data output endpoints\n data_output = 'data-output/',\n\n // Data import endpoints\n import_session_list = 'importer/session/',\n import_session_accept_fields = 'importer/session/:id/accept_fields/',\n import_session_accept_rows = 'importer/session/:id/accept_rows/',\n import_session_column_mapping_list = 'importer/column-mapping/',\n import_session_row_list = 'importer/row/',\n\n // Notification endpoints\n notifications_list = 'notifications/',\n notifications_readall = 'notifications/readall/',\n\n // Build API endpoints\n build_order_list = 'build/',\n build_order_issue = 'build/:id/issue/',\n build_order_cancel = 'build/:id/cancel/',\n build_order_hold = 'build/:id/hold/',\n build_order_complete = 'build/:id/finish/',\n build_output_complete = 'build/:id/complete/',\n build_output_create = 'build/:id/create-output/',\n build_output_scrap = 'build/:id/scrap-outputs/',\n build_output_delete = 'build/:id/delete-outputs/',\n build_order_auto_allocate = 'build/:id/auto-allocate/',\n build_order_allocate = 'build/:id/allocate/',\n build_order_deallocate = 'build/:id/unallocate/',\n\n build_line_list = 'build/line/',\n build_item_list = 'build/item/',\n\n bom_list = 'bom/',\n bom_item_validate = 'bom/:id/validate/',\n bom_validate = 'part/:id/bom-validate/',\n\n // Part API endpoints\n part_list = 'part/',\n part_parameter_list = 'part/parameter/',\n part_parameter_template_list = 'part/parameter/template/',\n part_thumbs_list = 'part/thumbs/',\n part_pricing = 'part/:id/pricing/',\n part_serial_numbers = 'part/:id/serial-numbers/',\n part_scheduling = 'part/:id/scheduling/',\n part_pricing_internal = 'part/internal-price/',\n part_pricing_sale = 'part/sale-price/',\n part_stocktake_list = 'part/stocktake/',\n part_stocktake_report_list = 'part/stocktake/report/',\n part_stocktake_report_generate = 'part/stocktake/report/generate/',\n category_list = 'part/category/',\n category_tree = 'part/category/tree/',\n category_parameter_list = 'part/category/parameters/',\n related_part_list = 'part/related/',\n part_test_template_list = 'part/test-template/',\n\n // Company API endpoints\n company_list = 'company/',\n contact_list = 'company/contact/',\n address_list = 'company/address/',\n supplier_part_list = 'company/part/',\n supplier_part_pricing_list = 'company/price-break/',\n manufacturer_part_list = 'company/part/manufacturer/',\n manufacturer_part_parameter_list = 'company/part/manufacturer/parameter/',\n\n // Stock location endpoints\n stock_location_list = 'stock/location/',\n stock_location_type_list = 'stock/location-type/',\n stock_location_tree = 'stock/location/tree/',\n\n // Stock item API endpoints\n stock_item_list = 'stock/',\n stock_tracking_list = 'stock/track/',\n stock_test_result_list = 'stock/test/',\n stock_transfer = 'stock/transfer/',\n stock_remove = 'stock/remove/',\n stock_add = 'stock/add/',\n stock_count = 'stock/count/',\n stock_change_status = 'stock/change_status/',\n stock_merge = 'stock/merge/',\n stock_assign = 'stock/assign/',\n stock_status = 'stock/status/',\n stock_install = 'stock/:id/install/',\n stock_uninstall = 'stock/:id/uninstall/',\n stock_serialize = 'stock/:id/serialize/',\n stock_return = 'stock/:id/return/',\n\n // Generator API endpoints\n generate_batch_code = 'generate/batch-code/',\n generate_serial_number = 'generate/serial-number/',\n\n // Order API endpoints\n purchase_order_list = 'order/po/',\n purchase_order_issue = 'order/po/:id/issue/',\n purchase_order_hold = 'order/po/:id/hold/',\n purchase_order_cancel = 'order/po/:id/cancel/',\n purchase_order_complete = 'order/po/:id/complete/',\n purchase_order_line_list = 'order/po-line/',\n purchase_order_extra_line_list = 'order/po-extra-line/',\n purchase_order_receive = 'order/po/:id/receive/',\n\n sales_order_list = 'order/so/',\n sales_order_issue = 'order/so/:id/issue/',\n sales_order_hold = 'order/so/:id/hold/',\n sales_order_cancel = 'order/so/:id/cancel/',\n sales_order_ship = 'order/so/:id/ship/',\n sales_order_complete = 'order/so/:id/complete/',\n sales_order_allocate = 'order/so/:id/allocate/',\n sales_order_allocate_serials = 'order/so/:id/allocate-serials/',\n\n sales_order_line_list = 'order/so-line/',\n sales_order_extra_line_list = 'order/so-extra-line/',\n sales_order_allocation_list = 'order/so-allocation/',\n\n sales_order_shipment_list = 'order/so/shipment/',\n sales_order_shipment_complete = 'order/so/shipment/:id/ship/',\n\n return_order_list = 'order/ro/',\n return_order_issue = 'order/ro/:id/issue/',\n return_order_hold = 'order/ro/:id/hold/',\n return_order_cancel = 'order/ro/:id/cancel/',\n return_order_complete = 'order/ro/:id/complete/',\n return_order_receive = 'order/ro/:id/receive/',\n return_order_line_list = 'order/ro-line/',\n return_order_extra_line_list = 'order/ro-extra-line/',\n\n // Template API endpoints\n label_list = 'label/template/',\n label_print = 'label/print/',\n report_list = 'report/template/',\n report_print = 'report/print/',\n report_snippet = 'report/snippet/',\n report_asset = 'report/asset/',\n\n // Plugin API endpoints\n plugin_list = 'plugins/',\n plugin_setting_list = 'plugins/:plugin/settings/',\n plugin_registry_status = 'plugins/status/',\n plugin_install = 'plugins/install/',\n plugin_reload = 'plugins/reload/',\n plugin_activate = 'plugins/:key/activate/',\n plugin_uninstall = 'plugins/:key/uninstall/',\n plugin_admin = 'plugins/:key/admin/',\n\n // User interface plugin endpoints\n plugin_ui_features_list = 'plugins/ui/features/:feature_type/',\n\n // Special plugin endpoints\n plugin_locate_item = 'locate/',\n\n // Machine API endpoints\n machine_types_list = 'machine/types/',\n machine_driver_list = 'machine/drivers/',\n machine_registry_status = 'machine/status/',\n machine_list = 'machine/',\n machine_restart = 'machine/:machine/restart/',\n machine_setting_list = 'machine/:machine/settings/',\n machine_setting_detail = 'machine/:machine/settings/:config_type/',\n\n // Miscellaneous API endpoints\n attachment_list = 'attachment/',\n error_report_list = 'error-report/',\n project_code_list = 'project-code/',\n custom_unit_list = 'units/',\n notes_image_upload = 'notes-image-upload/'\n}\n"],"names":["ApiEndpoints","api_server_info","user_list","user_me","user_profile","user_roles","user_token","user_tokens","user_simple_login","user_reset","user_reset_set","auth_pwd_change","auth_login","auth_login_2fa","auth_session","auth_signup","auth_authenticators","auth_recovery","auth_mfa_reauthenticate","auth_totp","auth_reauthenticate","auth_email","auth_email_verify","auth_providers","auth_provider_redirect","auth_config","currency_list","currency_refresh","all_units","task_overview","task_pending_list","task_scheduled_list","task_failed_list","api_search","settings_global_list","settings_user_list","news","global_status","custom_state_list","version","license","group_list","owner_list","content_type_list","icons","selectionlist_list","selectionlist_detail","barcode","barcode_history","barcode_link","barcode_unlink","barcode_generate","data_output","import_session_list","import_session_accept_fields","import_session_accept_rows","import_session_column_mapping_list","import_session_row_list","notifications_list","notifications_readall","build_order_list","build_order_issue","build_order_cancel","build_order_hold","build_order_complete","build_output_complete","build_output_create","build_output_scrap","build_output_delete","build_order_auto_allocate","build_order_allocate","build_order_deallocate","build_line_list","build_item_list","bom_list","bom_item_validate","bom_validate","part_list","part_parameter_list","part_parameter_template_list","part_thumbs_list","part_pricing","part_serial_numbers","part_scheduling","part_pricing_internal","part_pricing_sale","part_stocktake_list","part_stocktake_report_list","part_stocktake_report_generate","category_list","category_tree","category_parameter_list","related_part_list","part_test_template_list","company_list","contact_list","address_list","supplier_part_list","supplier_part_pricing_list","manufacturer_part_list","manufacturer_part_parameter_list","stock_location_list","stock_location_type_list","stock_location_tree","stock_item_list","stock_tracking_list","stock_test_result_list","stock_transfer","stock_remove","stock_add","stock_count","stock_change_status","stock_merge","stock_assign","stock_status","stock_install","stock_uninstall","stock_serialize","stock_return","generate_batch_code","generate_serial_number","purchase_order_list","purchase_order_issue","purchase_order_hold","purchase_order_cancel","purchase_order_complete","purchase_order_line_list","purchase_order_extra_line_list","purchase_order_receive","sales_order_list","sales_order_issue","sales_order_hold","sales_order_cancel","sales_order_ship","sales_order_complete","sales_order_allocate","sales_order_allocate_serials","sales_order_line_list","sales_order_extra_line_list","sales_order_allocation_list","sales_order_shipment_list","sales_order_shipment_complete","return_order_list","return_order_issue","return_order_hold","return_order_cancel","return_order_complete","return_order_receive","return_order_line_list","return_order_extra_line_list","label_list","label_print","report_list","report_print","report_snippet","report_asset","plugin_list","plugin_setting_list","plugin_registry_status","plugin_install","plugin_reload","plugin_activate","plugin_uninstall","plugin_admin","plugin_ui_features_list","plugin_locate_item","machine_types_list","machine_driver_list","machine_registry_status","machine_list","machine_restart","machine_setting_list","machine_setting_detail","attachment_list","error_report_list","project_code_list","custom_unit_list","notes_image_upload"],"mappings":"AAQYA,IAAAA,iCAAAA,kBAAL;AACLC,gBAAAA,iBAAkB,IAAA;AAGlBC,gBAAAA,WAAY,IAAA;AACZC,gBAAAA,SAAU,IAAA;AACVC,gBAAAA,cAAe,IAAA;AACfC,gBAAAA,YAAa,IAAA;AACbC,gBAAAA,YAAa,IAAA;AACbC,gBAAAA,aAAc,IAAA;AACdC,gBAAAA,mBAAoB,IAAA;AAGpBC,gBAAAA,YAAa,IAAA;AACbC,gBAAAA,gBAAiB,IAAA;AACjBC,gBAAAA,iBAAkB,IAAA;AAClBC,gBAAAA,YAAa,IAAA;AACbC,gBAAAA,gBAAiB,IAAA;AACjBC,gBAAAA,cAAe,IAAA;AACfC,gBAAAA,aAAc,IAAA;AACdC,gBAAAA,qBAAsB,IAAA;AACtBC,gBAAAA,eAAgB,IAAA;AAChBC,gBAAAA,yBAA0B,IAAA;AAC1BC,gBAAAA,WAAY,IAAA;AACZC,gBAAAA,qBAAsB,IAAA;AACtBC,gBAAAA,YAAa,IAAA;AACbC,gBAAAA,mBAAoB,IAAA;AACpBC,gBAAAA,gBAAiB,IAAA;AACjBC,gBAAAA,wBAAyB,IAAA;AACzBC,gBAAAA,aAAc,IAAA;AAGdC,gBAAAA,eAAgB,IAAA;AAChBC,gBAAAA,kBAAmB,IAAA;AACnBC,gBAAAA,WAAY,IAAA;AACZC,gBAAAA,eAAgB,IAAA;AAChBC,gBAAAA,mBAAoB,IAAA;AACpBC,gBAAAA,qBAAsB,IAAA;AACtBC,gBAAAA,kBAAmB,IAAA;AACnBC,gBAAAA,YAAa,IAAA;AACbC,gBAAAA,sBAAuB,IAAA;AACvBC,gBAAAA,oBAAqB,IAAA;AACrBC,gBAAAA,MAAO,IAAA;AACPC,gBAAAA,e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,IAAA;AACnBC,gBAAAA,cAAe,IAAA;AAGfC,gBAAAA,yBAA0B,IAAA;AAG1BC,gBAAAA,oBAAqB,IAAA;AAGrBC,gBAAAA,oBAAqB,IAAA;AACrBC,gBAAAA,qBAAsB,IAAA;AACtBC,gBAAAA,yBAA0B,IAAA;AAC1BC,gBAAAA,cAAe,IAAA;AACfC,gBAAAA,iBAAkB,IAAA;AAClBC,gBAAAA,sBAAuB,IAAA;AACvBC,gBAAAA,wBAAyB,IAAA;AAGzBC,gBAAAA,iBAAkB,IAAA;AAClBC,gBAAAA,mBAAoB,IAAA;AACpBC,gBAAAA,mBAAoB,IAAA;AACpBC,gBAAAA,kBAAmB,IAAA;AACnBC,gBAAAA,oBAAqB,IAAA;AA/NXjL,SAAAA;AAAAA,GAAAA,gBAAAA,CAAAA,CAAAA;"}
|
|
1
|
+
{"version":3,"file":"ApiEndpoints.js","sources":["../../lib/enums/ApiEndpoints.tsx"],"sourcesContent":["/*\n * Enumeration of available API endpoints.\n *\n * In the cases where endpoints can be accessed with a primary key,\n * the primary key should be appended to the endpoint.\n * The exception to this is when the endpoint provides an :id parameter.\n */\n\nexport enum ApiEndpoints {\n api_server_info = '',\n\n // User API endpoints\n user_list = 'user/',\n user_me = 'user/me/',\n user_profile = 'user/profile/',\n user_roles = 'user/roles/',\n user_token = 'user/token/',\n user_tokens = 'user/tokens/',\n user_simple_login = 'email/generate/',\n\n // User auth endpoints\n user_reset = 'auth/v1/auth/password/request',\n user_reset_set = 'auth/v1/auth/password/reset',\n auth_pwd_change = 'auth/v1/account/password/change',\n auth_login = 'auth/v1/auth/login',\n auth_login_2fa = 'auth/v1/auth/2fa/authenticate',\n auth_session = 'auth/v1/auth/session',\n auth_signup = 'auth/v1/auth/signup',\n auth_authenticators = 'auth/v1/account/authenticators',\n auth_recovery = 'auth/v1/account/authenticators/recovery-codes',\n auth_mfa_reauthenticate = 'auth/v1/auth/2fa/reauthenticate',\n auth_totp = 'auth/v1/account/authenticators/totp',\n auth_trust = 'auth/v1/auth/2fa/trust',\n auth_reauthenticate = 'auth/v1/auth/reauthenticate',\n auth_email = 'auth/v1/account/email',\n auth_email_verify = 'auth/v1/auth/email/verify',\n auth_providers = 'auth/v1/account/providers',\n auth_provider_redirect = 'auth/v1/auth/provider/redirect',\n auth_config = 'auth/v1/config',\n\n // Generic API endpoints\n currency_list = 'currency/exchange/',\n currency_refresh = 'currency/refresh/',\n all_units = 'units/all/',\n task_overview = 'background-task/',\n task_pending_list = 'background-task/pending/',\n task_scheduled_list = 'background-task/scheduled/',\n task_failed_list = 'background-task/failed/',\n api_search = 'search/',\n settings_global_list = 'settings/global/',\n settings_user_list = 'settings/user/',\n news = 'news/',\n global_status = 'generic/status/',\n custom_state_list = 'generic/status/custom/',\n version = 'version/',\n license = 'license/',\n group_list = 'user/group/',\n owner_list = 'user/owner/',\n ruleset_list = 'user/ruleset/',\n content_type_list = 'contenttype/',\n icons = 'icons/',\n selectionlist_list = 'selection/',\n selectionlist_detail = 'selection/:id/',\n\n // Barcode API endpoints\n barcode = 'barcode/',\n barcode_history = 'barcode/history/',\n barcode_link = 'barcode/link/',\n barcode_unlink = 'barcode/unlink/',\n barcode_generate = 'barcode/generate/',\n\n // Data output endpoints\n data_output = 'data-output/',\n\n // Data import endpoints\n import_session_list = 'importer/session/',\n import_session_accept_fields = 'importer/session/:id/accept_fields/',\n import_session_accept_rows = 'importer/session/:id/accept_rows/',\n import_session_column_mapping_list = 'importer/column-mapping/',\n import_session_row_list = 'importer/row/',\n\n // Notification endpoints\n notifications_list = 'notifications/',\n notifications_readall = 'notifications/readall/',\n\n // Build API endpoints\n build_order_list = 'build/',\n build_order_issue = 'build/:id/issue/',\n build_order_cancel = 'build/:id/cancel/',\n build_order_hold = 'build/:id/hold/',\n build_order_complete = 'build/:id/finish/',\n build_output_complete = 'build/:id/complete/',\n build_output_create = 'build/:id/create-output/',\n build_output_scrap = 'build/:id/scrap-outputs/',\n build_output_delete = 'build/:id/delete-outputs/',\n build_order_auto_allocate = 'build/:id/auto-allocate/',\n build_order_allocate = 'build/:id/allocate/',\n build_order_deallocate = 'build/:id/unallocate/',\n\n build_line_list = 'build/line/',\n build_item_list = 'build/item/',\n\n bom_list = 'bom/',\n bom_item_validate = 'bom/:id/validate/',\n bom_validate = 'part/:id/bom-validate/',\n bom_substitute_list = 'bom/substitute/',\n\n // Part API endpoints\n part_list = 'part/',\n part_parameter_list = 'part/parameter/',\n part_parameter_template_list = 'part/parameter/template/',\n part_thumbs_list = 'part/thumbs/',\n part_pricing = 'part/:id/pricing/',\n part_serial_numbers = 'part/:id/serial-numbers/',\n part_scheduling = 'part/:id/scheduling/',\n part_pricing_internal = 'part/internal-price/',\n part_pricing_sale = 'part/sale-price/',\n part_stocktake_list = 'part/stocktake/',\n part_stocktake_report_list = 'part/stocktake/report/',\n part_stocktake_report_generate = 'part/stocktake/report/generate/',\n category_list = 'part/category/',\n category_tree = 'part/category/tree/',\n category_parameter_list = 'part/category/parameters/',\n related_part_list = 'part/related/',\n part_test_template_list = 'part/test-template/',\n\n // Company API endpoints\n company_list = 'company/',\n contact_list = 'company/contact/',\n address_list = 'company/address/',\n supplier_part_list = 'company/part/',\n supplier_part_pricing_list = 'company/price-break/',\n manufacturer_part_list = 'company/part/manufacturer/',\n manufacturer_part_parameter_list = 'company/part/manufacturer/parameter/',\n\n // Stock location endpoints\n stock_location_list = 'stock/location/',\n stock_location_type_list = 'stock/location-type/',\n stock_location_tree = 'stock/location/tree/',\n\n // Stock item API endpoints\n stock_item_list = 'stock/',\n stock_tracking_list = 'stock/track/',\n stock_test_result_list = 'stock/test/',\n stock_transfer = 'stock/transfer/',\n stock_remove = 'stock/remove/',\n stock_add = 'stock/add/',\n stock_count = 'stock/count/',\n stock_change_status = 'stock/change_status/',\n stock_merge = 'stock/merge/',\n stock_assign = 'stock/assign/',\n stock_status = 'stock/status/',\n stock_install = 'stock/:id/install/',\n stock_uninstall = 'stock/:id/uninstall/',\n stock_serialize = 'stock/:id/serialize/',\n stock_return = 'stock/:id/return/',\n stock_serial_info = 'stock/:id/serial-numbers/',\n\n // Generator API endpoints\n generate_batch_code = 'generate/batch-code/',\n generate_serial_number = 'generate/serial-number/',\n\n // Order API endpoints\n purchase_order_list = 'order/po/',\n purchase_order_issue = 'order/po/:id/issue/',\n purchase_order_hold = 'order/po/:id/hold/',\n purchase_order_cancel = 'order/po/:id/cancel/',\n purchase_order_complete = 'order/po/:id/complete/',\n purchase_order_line_list = 'order/po-line/',\n purchase_order_extra_line_list = 'order/po-extra-line/',\n purchase_order_receive = 'order/po/:id/receive/',\n\n sales_order_list = 'order/so/',\n sales_order_issue = 'order/so/:id/issue/',\n sales_order_hold = 'order/so/:id/hold/',\n sales_order_cancel = 'order/so/:id/cancel/',\n sales_order_ship = 'order/so/:id/ship/',\n sales_order_complete = 'order/so/:id/complete/',\n sales_order_allocate = 'order/so/:id/allocate/',\n sales_order_allocate_serials = 'order/so/:id/allocate-serials/',\n\n sales_order_line_list = 'order/so-line/',\n sales_order_extra_line_list = 'order/so-extra-line/',\n sales_order_allocation_list = 'order/so-allocation/',\n\n sales_order_shipment_list = 'order/so/shipment/',\n sales_order_shipment_complete = 'order/so/shipment/:id/ship/',\n\n return_order_list = 'order/ro/',\n return_order_issue = 'order/ro/:id/issue/',\n return_order_hold = 'order/ro/:id/hold/',\n return_order_cancel = 'order/ro/:id/cancel/',\n return_order_complete = 'order/ro/:id/complete/',\n return_order_receive = 'order/ro/:id/receive/',\n return_order_line_list = 'order/ro-line/',\n return_order_extra_line_list = 'order/ro-extra-line/',\n\n // Template API endpoints\n label_list = 'label/template/',\n label_print = 'label/print/',\n report_list = 'report/template/',\n report_print = 'report/print/',\n report_snippet = 'report/snippet/',\n report_asset = 'report/asset/',\n\n // Plugin API endpoints\n plugin_list = 'plugins/',\n plugin_setting_list = 'plugins/:plugin/settings/',\n plugin_registry_status = 'plugins/status/',\n plugin_install = 'plugins/install/',\n plugin_reload = 'plugins/reload/',\n plugin_activate = 'plugins/:key/activate/',\n plugin_uninstall = 'plugins/:key/uninstall/',\n plugin_admin = 'plugins/:key/admin/',\n\n // User interface plugin endpoints\n plugin_ui_features_list = 'plugins/ui/features/:feature_type/',\n\n // Special plugin endpoints\n plugin_locate_item = 'locate/',\n\n // Machine API endpoints\n machine_types_list = 'machine/types/',\n machine_driver_list = 'machine/drivers/',\n machine_registry_status = 'machine/status/',\n machine_list = 'machine/',\n machine_restart = 'machine/:machine/restart/',\n machine_setting_list = 'machine/:machine/settings/',\n machine_setting_detail = 'machine/:machine/settings/:config_type/',\n\n // Miscellaneous API endpoints\n attachment_list = 'attachment/',\n error_report_list = 'error-report/',\n project_code_list = 'project-code/',\n custom_unit_list = 'units/',\n notes_image_upload = 'notes-image-upload/'\n}\n"],"names":["ApiEndpoints","api_server_info","user_list","user_me","user_profile","user_roles","user_token","user_tokens","user_simple_login","user_reset","user_reset_set","auth_pwd_change","auth_login","auth_login_2fa","auth_session","auth_signup","auth_authenticators","auth_recovery","auth_mfa_reauthenticate","auth_totp","auth_trust","auth_reauthenticate","auth_email","auth_email_verify","auth_providers","auth_provider_redirect","auth_config","currency_list","currency_refresh","all_units","task_overview","task_pending_list","task_scheduled_list","task_failed_list","api_search","settings_global_list","settings_user_list","news","global_status","custom_state_list","version","license","group_list","owner_list","ruleset_list","content_type_list","icons","selectionlist_list","selectionlist_detail","barcode","barcode_history","barcode_link","barcode_unlink","barcode_generate","data_output","import_session_list","import_session_accept_fields","import_session_accept_rows","import_session_column_mapping_list","import_session_row_list","notifications_list","notifications_readall","build_order_list","build_order_issue","build_order_cancel","build_order_hold","build_order_complete","build_output_complete","build_output_create","build_output_scrap","build_output_delete","build_order_auto_allocate","build_order_allocate","build_order_deallocate","build_line_list","build_item_list","bom_list","bom_item_validate","bom_validate","bom_substitute_list","part_list","part_parameter_list","part_parameter_template_list","part_thumbs_list","part_pricing","part_serial_numbers","part_scheduling","part_pricing_internal","part_pricing_sale","part_stocktake_list","part_stocktake_report_list","part_stocktake_report_generate","category_list","category_tree","category_parameter_list","related_part_list","part_test_template_list","company_list","contact_list","address_list","supplier_part_list","supplier_part_pricing_list","manufacturer_part_list","manufacturer_part_parameter_list","stock_location_list","stock_location_type_list","stock_location_tree","stock_item_list","stock_tracking_list","stock_test_result_list","stock_transfer","stock_remove","stock_add","stock_count","stock_change_status","stock_merge","stock_assign","stock_status","stock_install","stock_uninstall","stock_serialize","stock_return","stock_serial_info","generate_batch_code","generate_serial_number","purchase_order_list","purchase_order_issue","purchase_order_hold","purchase_order_cancel","purchase_order_complete","purchase_order_line_list","purchase_order_extra_line_list","purchase_order_receive","sales_order_list","sales_order_issue","sales_order_hold","sales_order_cancel","sales_order_ship","sales_order_complete","sales_order_allocate","sales_order_allocate_serials","sales_order_line_list","sales_order_extra_line_list","sales_order_allocation_list","sales_order_shipment_list","sales_order_shipment_complete","return_order_list","return_order_issue","return_order_hold","return_order_cancel","return_order_complete","return_order_receive","return_order_line_list","return_order_extra_line_list","label_list","label_print","report_list","report_print","report_snippet","report_asset","plugin_list","plugin_setting_list","plugin_registry_status","plugin_install","plugin_reload","plugin_activate","plugin_uninstall","plugin_admin","plugin_ui_features_list","plugin_locate_item","machine_types_list","machine_driver_list","machine_registry_status","machine_list","machine_restart","machine_setting_list","machine_setting_detail","attachment_list","error_report_list","project_code_list","custom_unit_list","notes_image_upload"],"mappings":"AAQYA,IAAAA,iCAAAA,kBAAL;AACLC,gBAAAA,iBAAkB,IAAA;AAGlBC,gBAAAA,WAAY,IAAA;AACZC,gBAAAA,SAAU,IAAA;AACVC,gBAAAA,cAAe,IAAA;AACfC,gBAAAA,YAAa,IAAA;AACbC,gBAAAA,YAAa,IAAA;AACbC,gBAAAA,aAAc,IAAA;AACdC,gBAAAA,mBAAoB,IAAA;AAGpBC,gBAAAA,YAAa,IAAA;AACbC,gBAAAA,gBAAiB,IAAA;AACjBC,gBAAAA,iBAAkB,IAAA;AAClBC,gBAAAA,YAAa,IAAA;AACbC,gBAAAA,gBAAiB,IAAA;AACjBC,gBA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IAAA;AAnOXrL,SAAAA;AAAAA,GAAAA,gBAAAA,CAAAA,CAAAA;"}
|
package/dist/enums/Roles.d.ts
CHANGED
package/dist/enums/Roles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Roles.js","sources":["../../lib/enums/Roles.tsx"],"sourcesContent":["/*\n * Enumeration of available user role groups\n */\nexport enum UserRoles {\n admin = 'admin',\n build = 'build',\n part = 'part',\n part_category = 'part_category',\n purchase_order = 'purchase_order',\n return_order = 'return_order',\n sales_order = 'sales_order',\n stock = 'stock',\n stock_location = 'stock_location',\n stocktake = 'stocktake'\n}\n\n/*\n * Enumeration of available user permissions within each role group\n */\nexport enum UserPermissions {\n view = 'view',\n add = 'add',\n change = 'change',\n delete = 'delete'\n}\n"],"names":["UserRoles","admin","build","part","part_category","purchase_order","return_order","sales_order","stock","stock_location","stocktake","UserPermissions","view","add","change","delete"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Roles.js","sources":["../../lib/enums/Roles.tsx"],"sourcesContent":["import { t } from '@lingui/core/macro';\n\n/*\n * Enumeration of available user role groups\n */\nexport enum UserRoles {\n admin = 'admin',\n build = 'build',\n part = 'part',\n part_category = 'part_category',\n purchase_order = 'purchase_order',\n return_order = 'return_order',\n sales_order = 'sales_order',\n stock = 'stock',\n stock_location = 'stock_location',\n stocktake = 'stocktake'\n}\n\n/*\n * Enumeration of available user permissions within each role group\n */\nexport enum UserPermissions {\n view = 'view',\n add = 'add',\n change = 'change',\n delete = 'delete'\n}\n\nexport function userRoleLabel(role: UserRoles): string {\n switch (role) {\n case UserRoles.admin:\n return t`Admin`;\n case UserRoles.build:\n return t`Build Orders`;\n case UserRoles.part:\n return t`Parts`;\n case UserRoles.part_category:\n return t`Part Categories`;\n case UserRoles.purchase_order:\n return t`Purchase Orders`;\n case UserRoles.return_order:\n return t`Return Orders`;\n case UserRoles.sales_order:\n return t`Sales Orders`;\n case UserRoles.stock:\n return t`Stock Items`;\n case UserRoles.stock_location:\n return t`Stock Location`;\n case UserRoles.stocktake:\n return t`Stocktake`;\n default:\n return role as string;\n }\n}\n"],"names":["UserRoles","admin","build","part","part_category","purchase_order","return_order","sales_order","stock","stock_location","stocktake","UserPermissions","view","add","change","delete"],"mappings":"AAKYA,IAAAA,8BAAAA,eAAL;AACLC,aAAAA,OAAQ,IAAA;AACRC,aAAAA,OAAQ,IAAA;AACRC,aAAAA,MAAO,IAAA;AACPC,aAAAA,eAAgB,IAAA;AAChBC,aAAAA,gBAAiB,IAAA;AACjBC,aAAAA,cAAe,IAAA;AACfC,aAAAA,aAAc,IAAA;AACdC,aAAAA,OAAQ,IAAA;AACRC,aAAAA,gBAAiB,IAAA;AACjBC,aAAAA,WAAY,IAAA;AAVFV,SAAAA;AAAAA,GAAAA,aAAAA,CAAAA,CAAAA;AAgBAW,IAAAA,oCAAAA,qBAAL;AACLC,mBAAAA,MAAO,IAAA;AACPC,mBAAAA,KAAM,IAAA;AACNC,mBAAAA,QAAS,IAAA;AACTC,mBAAAA,QAAS,IAAA;AAJCJ,SAAAA;AAAAA,GAAAA,mBAAAA,CAAAA,CAAAA;"}
|
|
@@ -2,7 +2,12 @@ import { NavigateFunction } from 'react-router-dom';
|
|
|
2
2
|
import { ModelType } from '../enums/ModelType';
|
|
3
3
|
export declare const getBaseUrl: () => string;
|
|
4
4
|
/**
|
|
5
|
-
* Returns the detail view URL for a given model type
|
|
5
|
+
* Returns the detail view URL for a given model type.
|
|
6
|
+
* This is the UI URL, not the API URL.
|
|
6
7
|
*/
|
|
7
8
|
export declare function getDetailUrl(model: ModelType, pk: number | string, absolute?: boolean): string;
|
|
9
|
+
/**
|
|
10
|
+
* Returns the API detail URL for a given model type.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getApiUrl(model: ModelType, pk: number | string): string | undefined;
|
|
8
13
|
export declare const navigateToLink: (link: string, navigate: NavigateFunction, event: any) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Navigation.js","sources":["../../lib/functions/Navigation.tsx"],"sourcesContent":["import type { NavigateFunction } from 'react-router-dom';\nimport { ModelInformationDict } from '../enums/ModelInformation';\nimport type { ModelType } from '../enums/ModelType';\nimport { cancelEvent } from './Events';\n\nexport const getBaseUrl = (): string =>\n (window as any).INVENTREE_SETTINGS?.base_url || 'web';\n\n/**\n * Returns the detail view URL for a given model type
|
|
1
|
+
{"version":3,"file":"Navigation.js","sources":["../../lib/functions/Navigation.tsx"],"sourcesContent":["import type { NavigateFunction } from 'react-router-dom';\nimport { ModelInformationDict } from '../enums/ModelInformation';\nimport type { ModelType } from '../enums/ModelType';\nimport { apiUrl } from './Api';\nimport { cancelEvent } from './Events';\n\nexport const getBaseUrl = (): string =>\n (window as any).INVENTREE_SETTINGS?.base_url || 'web';\n\n/**\n * Returns the detail view URL for a given model type.\n * This is the UI URL, not the API URL.\n */\nexport function getDetailUrl(\n model: ModelType,\n pk: number | string,\n absolute?: boolean\n): string {\n const modelInfo = ModelInformationDict[model];\n\n if (pk === undefined || pk === null) {\n return '';\n }\n\n if (!!pk && modelInfo && modelInfo.url_detail) {\n const url = modelInfo.url_detail.replace(':pk', pk.toString());\n const base = getBaseUrl();\n\n if (absolute && base) {\n return `/${base}${url}`;\n } else {\n return url;\n }\n }\n\n console.error(`No detail URL found for model ${model} <${pk}>`);\n return '';\n}\n\n/**\n * Returns the API detail URL for a given model type.\n */\nexport function getApiUrl(\n model: ModelType,\n pk: number | string\n): string | undefined {\n const modelInfo = ModelInformationDict[model];\n\n if (pk === undefined || pk === null) {\n return '';\n }\n\n if (!!pk && modelInfo && modelInfo.api_endpoint) {\n return apiUrl(modelInfo.api_endpoint, pk);\n }\n\n console.error(`No API detail URL found for model ${model} <${pk}>`);\n return undefined;\n}\n\n/*\n * Navigate to a provided link.\n * - If the link is to be opened externally, open it in a new tab.\n * - Otherwise, navigate using the provided navigate function.\n */\nexport const navigateToLink = (\n link: string,\n navigate: NavigateFunction,\n event: any\n) => {\n cancelEvent(event);\n\n const base = `/${getBaseUrl()}`;\n\n if (event?.ctrlKey || event?.shiftKey) {\n // Open the link in a new tab\n let url = link;\n if (link.startsWith('/') && !link.startsWith(base)) {\n url = `${base}${link}`;\n }\n window.open(url, '_blank');\n } else {\n // Navigate internally\n let url = link;\n\n if (link.startsWith(base)) {\n // Strip the base URL from the link\n url = link.replace(base, '');\n }\n\n navigate(url);\n }\n};\n"],"names":["getBaseUrl","window","INVENTREE_SETTINGS","base_url","getDetailUrl","model","pk","absolute","modelInfo","ModelInformationDict","undefined","url_detail","url","replace","toString","base","console","error","navigateToLink","link","navigate","event","cancelEvent","ctrlKey","shiftKey","startsWith","open"],"mappings":";;AAMO,MAAMA,aAAaA,MACvBC;;AAAAA,uBAAeC,uBAAfD,mBAAmCE,aAAY;AAAA;AAMlCC,SAAAA,aACdC,OACAC,IACAC,UACQ;AACFC,QAAAA,YAAYC,qBAAqBJ,KAAK;AAExCC,MAAAA,OAAOI,UAAaJ,OAAO,MAAM;AAC5B,WAAA;AAAA,EAAA;AAGT,MAAI,CAAC,CAACA,MAAME,aAAaA,UAAUG,YAAY;AAC7C,UAAMC,MAAMJ,UAAUG,WAAWE,QAAQ,OAAOP,GAAGQ,UAAU;AAC7D,UAAMC,OAAOf,WAAW;AAExB,QAAIO,YAAYQ,MAAM;AACb,aAAA,IAAIA,IAAI,GAAGH,GAAG;AAAA,IAAA,OAChB;AACEA,aAAAA;AAAAA,IAAAA;AAAAA,EACT;AAGFI,UAAQC,MAAM,iCAAiCZ,KAAK,KAAKC,EAAE,GAAG;AACvD,SAAA;AACT;AA4BO,MAAMY,iBAAiBA,CAC5BC,MACAC,UACAC,UACG;AACHC,cAAYD,KAAK;AAEXN,QAAAA,OAAO,IAAIf,WAAY,CAAA;AAEzBqB,OAAAA,+BAAOE,aAAWF,+BAAOG,WAAU;AAErC,QAAIZ,MAAMO;AACNA,QAAAA,KAAKM,WAAW,GAAG,KAAK,CAACN,KAAKM,WAAWV,IAAI,GAAG;AAC5C,YAAA,GAAGA,IAAI,GAAGI,IAAI;AAAA,IAAA;AAEfO,WAAAA,KAAKd,KAAK,QAAQ;AAAA,EAAA,OACpB;AAEL,QAAIA,MAAMO;AAENA,QAAAA,KAAKM,WAAWV,IAAI,GAAG;AAEnBI,YAAAA,KAAKN,QAAQE,MAAM,EAAE;AAAA,IAAA;AAG7BK,aAASR,GAAG;AAAA,EAAA;AAEhB;"}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import { InvenTreePluginContext } from '../types/Plugins';
|
|
2
|
+
/**
|
|
3
|
+
* Check that the plugin version matches the expected version.
|
|
4
|
+
* This is a helper function which only generates a warning if there is a mismatch.
|
|
5
|
+
*/
|
|
2
6
|
export declare function checkPluginVersion(context: InvenTreePluginContext): void;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { INVENTREE_PLUGIN_VERSION } from "../types/Plugins.js";
|
|
2
2
|
function extractVersion(version) {
|
|
3
|
+
if (!version) {
|
|
4
|
+
return null;
|
|
5
|
+
}
|
|
6
|
+
version = version.toString().trim();
|
|
7
|
+
if (!version.includes(".")) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
3
10
|
const [major, minor, patch] = version.split(".").map((v) => Number.parseInt(v, 10));
|
|
4
11
|
return {
|
|
5
12
|
major,
|
|
@@ -8,12 +15,21 @@ function extractVersion(version) {
|
|
|
8
15
|
};
|
|
9
16
|
}
|
|
10
17
|
function checkPluginVersion(context) {
|
|
11
|
-
|
|
12
|
-
|
|
18
|
+
let pluginVersion = null;
|
|
19
|
+
let systemVersion = null;
|
|
20
|
+
try {
|
|
21
|
+
pluginVersion = extractVersion(INVENTREE_PLUGIN_VERSION);
|
|
22
|
+
systemVersion = extractVersion(context.version.inventree);
|
|
23
|
+
} catch {
|
|
24
|
+
console.warn("Failed to extract plugin version information");
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
13
27
|
const mismatch = `Plugin version mismatch! Expected version ${INVENTREE_PLUGIN_VERSION}, got ${context.version}`;
|
|
14
|
-
if (pluginVersion
|
|
28
|
+
if (!pluginVersion || !systemVersion) {
|
|
29
|
+
console.warn("Could not extract plugin version information");
|
|
30
|
+
} else if (pluginVersion.major !== systemVersion.major) {
|
|
15
31
|
console.warn(mismatch);
|
|
16
|
-
} else if (INVENTREE_PLUGIN_VERSION != context.version) {
|
|
32
|
+
} else if (INVENTREE_PLUGIN_VERSION != context.version.inventree) {
|
|
17
33
|
console.info(mismatch);
|
|
18
34
|
}
|
|
19
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plugins.js","sources":["../../lib/functions/Plugins.tsx"],"sourcesContent":["import {\n INVENTREE_PLUGIN_VERSION,\n type InvenTreePluginContext\n} from '../types/Plugins';\n\nfunction extractVersion(version: string) {\n // Extract the version number from the string\n const [major, minor, patch] = version\n .split('.')\n .map((v) => Number.parseInt(v, 10));\n\n return { major, minor, patch };\n}\n\nexport function checkPluginVersion(context: InvenTreePluginContext) {\n
|
|
1
|
+
{"version":3,"file":"Plugins.js","sources":["../../lib/functions/Plugins.tsx"],"sourcesContent":["import {\n INVENTREE_PLUGIN_VERSION,\n type InvenTreePluginContext\n} from '../types/Plugins';\n\nfunction extractVersion(version: string) {\n // Extract the version number from the string\n\n if (!version) {\n return null;\n }\n\n version = version.toString().trim();\n\n if (!version.includes('.')) {\n return null;\n }\n\n const [major, minor, patch] = version\n .split('.')\n .map((v) => Number.parseInt(v, 10));\n\n return { major, minor, patch };\n}\n\n/**\n * Check that the plugin version matches the expected version.\n * This is a helper function which only generates a warning if there is a mismatch.\n */\nexport function checkPluginVersion(context: InvenTreePluginContext) {\n let pluginVersion: any = null;\n let systemVersion: any = null;\n \n try {\n pluginVersion = extractVersion(INVENTREE_PLUGIN_VERSION);\n systemVersion = extractVersion(context.version.inventree);\n } catch {\n console.warn(\"Failed to extract plugin version information\");\n return;\n }\n\n const mismatch = `Plugin version mismatch! Expected version ${INVENTREE_PLUGIN_VERSION}, got ${context.version}`;\n\n if (!pluginVersion || !systemVersion) {\n console.warn(\"Could not extract plugin version information\");\n } else if (pluginVersion.major !== systemVersion.major) {\n // A major version mismatch indicates a potentially breaking change\n console.warn(mismatch);\n } else if (INVENTREE_PLUGIN_VERSION != context.version.inventree) {\n console.info(mismatch);\n }\n}\n"],"names":["extractVersion","version","toString","trim","includes","major","minor","patch","split","map","v","Number","parseInt","checkPluginVersion","context","pluginVersion","systemVersion","INVENTREE_PLUGIN_VERSION","inventree","console","warn","mismatch","info"],"mappings":";AAKA,SAASA,eAAeC,SAAiB;AAGvC,MAAI,CAACA,SAAS;AACL,WAAA;AAAA,EAAA;AAGCA,YAAAA,QAAQC,SAAS,EAAEC,KAAK;AAElC,MAAI,CAACF,QAAQG,SAAS,GAAG,GAAG;AACnB,WAAA;AAAA,EAAA;AAGT,QAAM,CAACC,OAAOC,OAAOC,KAAK,IAAIN,QAC3BO,MAAM,GAAG,EACTC,IAAKC,CAAMC,MAAAA,OAAOC,SAASF,GAAG,EAAE,CAAC;AAE7B,SAAA;AAAA,IAAEL;AAAAA,IAAOC;AAAAA,IAAOC;AAAAA,EAAM;AAC/B;AAMO,SAASM,mBAAmBC,SAAiC;AAClE,MAAIC,gBAAqB;AACzB,MAAIC,gBAAqB;AAErB,MAAA;AACFD,oBAAgBf,eAAeiB,wBAAwB;AACvCjB,oBAAAA,eAAec,QAAQb,QAAQiB,SAAS;AAAA,EAAA,QAClD;AACNC,YAAQC,KAAK,8CAA8C;AAC3D;AAAA,EAAA;AAGF,QAAMC,WAAW,6CAA6CJ,wBAAwB,SAASH,QAAQb,OAAO;AAE1G,MAAA,CAACc,iBAAiB,CAACC,eAAe;AACpCG,YAAQC,KAAK,8CAA8C;AAAA,EAClDL,WAAAA,cAAcV,UAAUW,cAAcX,OAAO;AAEtDc,YAAQC,KAAKC,QAAQ;AAAA,EACZJ,WAAAA,4BAA4BH,QAAQb,QAAQiB,WAAW;AAChEC,YAAQG,KAAKD,QAAQ;AAAA,EAAA;AAEzB;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { INVENTREE_PLUGIN_VERSION } from './types/Plugins';
|
|
1
|
+
export { INVENTREE_PLUGIN_VERSION, INVENTREE_REACT_VERSION, INVENTREE_REACT_DOM_VERSION, INVENTREE_MANTINE_VERSION } from './types/Plugins';
|
|
2
2
|
export { ApiEndpoints } from './enums/ApiEndpoints';
|
|
3
3
|
export { ModelType } from './enums/ModelType';
|
|
4
4
|
export { UserRoles, UserPermissions } from './enums/Roles';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { INVENTREE_PLUGIN_VERSION } from "./types/Plugins.js";
|
|
1
|
+
import { INVENTREE_MANTINE_VERSION, INVENTREE_PLUGIN_VERSION, INVENTREE_REACT_DOM_VERSION, INVENTREE_REACT_VERSION } from "./types/Plugins.js";
|
|
2
2
|
import { ApiEndpoints } from "./enums/ApiEndpoints.js";
|
|
3
3
|
import { ModelType } from "./enums/ModelType.js";
|
|
4
4
|
import { UserPermissions, UserRoles } from "./enums/Roles.js";
|
|
@@ -7,7 +7,10 @@ import { getBaseUrl, getDetailUrl, navigateToLink } from "./functions/Navigation
|
|
|
7
7
|
import { checkPluginVersion } from "./functions/Plugins.js";
|
|
8
8
|
export {
|
|
9
9
|
ApiEndpoints,
|
|
10
|
+
INVENTREE_MANTINE_VERSION,
|
|
10
11
|
INVENTREE_PLUGIN_VERSION,
|
|
12
|
+
INVENTREE_REACT_DOM_VERSION,
|
|
13
|
+
INVENTREE_REACT_VERSION,
|
|
11
14
|
ModelType,
|
|
12
15
|
UserPermissions,
|
|
13
16
|
UserRoles,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as distExports } from "../../../../_virtual/index.js";
|
|
2
|
-
import { compileMessage } from "
|
|
2
|
+
import { compileMessage } from "../node_modules/@lingui/message-utils/dist/compileMessage.js";
|
|
3
3
|
const isString = (s) => typeof s === "string";
|
|
4
4
|
const isFunction = (f) => typeof f === "function";
|
|
5
5
|
const cache = /* @__PURE__ */ new Map();
|
package/dist/node_modules/@lingui/core/node_modules/@lingui/message-utils/dist/compileMessage.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compileMessage.js","sources":["../../../../../../../../node_modules/@lingui/core/node_modules/@lingui/message-utils/dist/compileMessage.mjs"],"sourcesContent":["import { parse } from '@messageformat/parser';\n\n/**\n * Parent class for errors.\n *\n * @remarks\n * Errors with `type: \"warning\"` do not necessarily indicate that the parser\n * encountered an error. In addition to a human-friendly `message`, may also\n * includes the `token` at which the error was encountered.\n *\n * @public\n */\nclass DateFormatError extends Error {\n /** @internal */\n constructor(msg, token, type) {\n super(msg);\n this.token = token;\n this.type = type || 'error';\n }\n}\nconst alpha = (width) => width < 4 ? 'short' : width === 4 ? 'long' : 'narrow';\nconst numeric = (width) => (width % 2 === 0 ? '2-digit' : 'numeric');\nfunction yearOptions(token, onError) {\n switch (token.char) {\n case 'y':\n return { year: numeric(token.width) };\n case 'r':\n return { calendar: 'gregory', year: 'numeric' };\n case 'u':\n case 'U':\n case 'Y':\n default:\n onError(`${token.desc} is not supported; falling back to year:numeric`, DateFormatError.WARNING);\n return { year: 'numeric' };\n }\n}\nfunction monthStyle(token, onError) {\n switch (token.width) {\n case 1:\n return 'numeric';\n case 2:\n return '2-digit';\n case 3:\n return 'short';\n case 4:\n return 'long';\n case 5:\n return 'narrow';\n default:\n onError(`${token.desc} is not supported with width ${token.width}`);\n return undefined;\n }\n}\nfunction dayStyle(token, onError) {\n const { char, desc, width } = token;\n if (char === 'd') {\n return numeric(width);\n }\n else {\n onError(`${desc} is not supported`);\n return undefined;\n }\n}\nfunction weekdayStyle(token, onError) {\n const { char, desc, width } = token;\n if ((char === 'c' || char === 'e') && width < 3) {\n // ignoring stand-alone-ness\n const msg = `Numeric value is not supported for ${desc}; falling back to weekday:short`;\n onError(msg, DateFormatError.WARNING);\n }\n // merging narrow styles\n return alpha(width);\n}\nfunction hourOptions(token) {\n const hour = numeric(token.width);\n let hourCycle;\n switch (token.char) {\n case 'h':\n hourCycle = 'h12';\n break;\n case 'H':\n hourCycle = 'h23';\n break;\n case 'k':\n hourCycle = 'h24';\n break;\n case 'K':\n hourCycle = 'h11';\n break;\n }\n return hourCycle ? { hour, hourCycle } : { hour };\n}\nfunction timeZoneNameStyle(token, onError) {\n // so much fallback behaviour here\n const { char, desc, width } = token;\n switch (char) {\n case 'v':\n case 'z':\n return width === 4 ? 'long' : 'short';\n case 'V':\n if (width === 4)\n return 'long';\n onError(`${desc} is not supported with width ${width}`);\n return undefined;\n case 'X':\n onError(`${desc} is not supported`);\n return undefined;\n }\n return 'short';\n}\nfunction compileOptions(token, onError) {\n switch (token.field) {\n case 'era':\n return { era: alpha(token.width) };\n case 'year':\n return yearOptions(token, onError);\n case 'month':\n return { month: monthStyle(token, onError) };\n case 'day':\n return { day: dayStyle(token, onError) };\n case 'weekday':\n return { weekday: weekdayStyle(token, onError) };\n case 'period':\n return undefined;\n case 'hour':\n return hourOptions(token);\n case 'min':\n return { minute: numeric(token.width) };\n case 'sec':\n return { second: numeric(token.width) };\n case 'tz':\n return { timeZoneName: timeZoneNameStyle(token, onError) };\n case 'quarter':\n case 'week':\n case 'sec-frac':\n case 'ms':\n onError(`${token.desc} is not supported`);\n }\n return undefined;\n}\nfunction getDateFormatOptions(tokens, timeZone, onError = error => {\n throw error;\n}) {\n const options = {\n timeZone\n };\n const fields = [];\n for (const token of tokens) {\n const { error, field, str } = token;\n if (error) {\n const dte = new DateFormatError(error.message, token);\n dte.stack = error.stack;\n onError(dte);\n }\n if (str) {\n const msg = `Ignoring string part: ${str}`;\n onError(new DateFormatError(msg, token, DateFormatError.WARNING));\n }\n if (field) {\n if (fields.indexOf(field) === -1)\n fields.push(field);\n else\n onError(new DateFormatError(`Duplicate ${field} token`, token));\n }\n const opt = compileOptions(token, (msg, isWarning) => onError(new DateFormatError(msg, token, isWarning)));\n if (opt)\n Object.assign(options, opt);\n }\n return options;\n}\n\nconst fields = {\n G: { field: 'era', desc: 'Era' },\n y: { field: 'year', desc: 'Year' },\n Y: { field: 'year', desc: 'Year of \"Week of Year\"' },\n u: { field: 'year', desc: 'Extended year' },\n U: { field: 'year', desc: 'Cyclic year name' },\n r: { field: 'year', desc: 'Related Gregorian year' },\n Q: { field: 'quarter', desc: 'Quarter' },\n q: { field: 'quarter', desc: 'Stand-alone quarter' },\n M: { field: 'month', desc: 'Month in year' },\n L: { field: 'month', desc: 'Stand-alone month in year' },\n w: { field: 'week', desc: 'Week of year' },\n W: { field: 'week', desc: 'Week of month' },\n d: { field: 'day', desc: 'Day in month' },\n D: { field: 'day', desc: 'Day of year' },\n F: { field: 'day', desc: 'Day of week in month' },\n g: { field: 'day', desc: 'Modified julian day' },\n E: { field: 'weekday', desc: 'Day of week' },\n e: { field: 'weekday', desc: 'Local day of week' },\n c: { field: 'weekday', desc: 'Stand-alone local day of week' },\n a: { field: 'period', desc: 'AM/PM marker' },\n b: { field: 'period', desc: 'AM/PM/noon/midnight marker' },\n B: { field: 'period', desc: 'Flexible day period' },\n h: { field: 'hour', desc: 'Hour in AM/PM (1~12)' },\n H: { field: 'hour', desc: 'Hour in day (0~23)' },\n k: { field: 'hour', desc: 'Hour in day (1~24)' },\n K: { field: 'hour', desc: 'Hour in AM/PM (0~11)' },\n j: { field: 'hour', desc: 'Hour in preferred cycle' },\n J: { field: 'hour', desc: 'Hour in preferred cycle without marker' },\n C: { field: 'hour', desc: 'Hour in preferred cycle with flexible marker' },\n m: { field: 'min', desc: 'Minute in hour' },\n s: { field: 'sec', desc: 'Second in minute' },\n S: { field: 'sec-frac', desc: 'Fractional second' },\n A: { field: 'ms', desc: 'Milliseconds in day' },\n z: { field: 'tz', desc: 'Time Zone: specific non-location' },\n Z: { field: 'tz', desc: 'Time Zone' },\n O: { field: 'tz', desc: 'Time Zone: localized' },\n v: { field: 'tz', desc: 'Time Zone: generic non-location' },\n V: { field: 'tz', desc: 'Time Zone: ID' },\n X: { field: 'tz', desc: 'Time Zone: ISO8601 with Z' },\n x: { field: 'tz', desc: 'Time Zone: ISO8601' }\n};\nconst isLetter = (char) => (char >= 'A' && char <= 'Z') || (char >= 'a' && char <= 'z');\nfunction readFieldToken(src, pos) {\n const char = src[pos];\n let width = 1;\n while (src[++pos] === char)\n ++width;\n const field = fields[char];\n if (!field) {\n const msg = `The letter ${char} is not a valid field identifier`;\n return { char, error: new Error(msg), width };\n }\n return { char, field: field.field, desc: field.desc, width };\n}\nfunction readQuotedToken(src, pos) {\n let str = src[++pos];\n let width = 2;\n if (str === \"'\")\n return { char: \"'\", str, width };\n while (true) {\n const next = src[++pos];\n ++width;\n if (next === undefined) {\n const msg = `Unterminated quoted literal in pattern: ${str || src}`;\n return { char: \"'\", error: new Error(msg), str, width };\n }\n else if (next === \"'\") {\n if (src[++pos] !== \"'\")\n return { char: \"'\", str, width };\n else\n ++width;\n }\n str += next;\n }\n}\nfunction readToken(src, pos) {\n const char = src[pos];\n if (!char)\n return null;\n if (isLetter(char))\n return readFieldToken(src, pos);\n if (char === \"'\")\n return readQuotedToken(src, pos);\n let str = char;\n let width = 1;\n while (true) {\n const next = src[++pos];\n if (!next || isLetter(next) || next === \"'\")\n return { char, str, width };\n str += next;\n width += 1;\n }\n}\n/**\n * Parse an {@link http://userguide.icu-project.org/formatparse/datetime | ICU\n * DateFormat skeleton} string into a {@link DateToken} array.\n *\n * @remarks\n * Errors will not be thrown, but if encountered are included as the relevant\n * token's `error` value.\n *\n * @public\n * @param src - The skeleton string\n *\n * @example\n * ```js\n * import { parseDateTokens } from '@messageformat/date-skeleton'\n *\n * parseDateTokens('GrMMMdd', console.error)\n * // [\n * // { char: 'G', field: 'era', desc: 'Era', width: 1 },\n * // { char: 'r', field: 'year', desc: 'Related Gregorian year', width: 1 },\n * // { char: 'M', field: 'month', desc: 'Month in year', width: 3 },\n * // { char: 'd', field: 'day', desc: 'Day in month', width: 2 }\n * // ]\n * ```\n */\nfunction parseDateTokens(src) {\n const tokens = [];\n let pos = 0;\n while (true) {\n const token = readToken(src, pos);\n if (!token)\n return tokens;\n tokens.push(token);\n pos += token.width;\n }\n}\n\nfunction processTokens(tokens, mapText) {\n if (!tokens.filter((token) => token.type !== \"content\").length) {\n return tokens.map((token) => mapText(token.value));\n }\n return tokens.map((token) => {\n if (token.type === \"content\") {\n return mapText(token.value);\n } else if (token.type === \"octothorpe\") {\n return \"#\";\n } else if (token.type === \"argument\") {\n return [token.arg];\n } else if (token.type === \"function\") {\n const _param = token?.param?.[0];\n if (token.key === \"date\" && _param) {\n const opts = compileDateExpression(_param.value.trim(), (e) => {\n throw new Error(`Unable to compile date expression: ${e.message}`);\n });\n return [token.arg, token.key, opts];\n }\n if (_param) {\n return [token.arg, token.key, _param.value.trim()];\n } else {\n return [token.arg, token.key];\n }\n }\n const offset = token.pluralOffset;\n const formatProps = {};\n token.cases.forEach(({ key, tokens: tokens2 }) => {\n const prop = key[0] === \"=\" ? key.slice(1) : key;\n formatProps[prop] = processTokens(tokens2, mapText);\n });\n return [\n token.arg,\n token.type,\n {\n offset,\n ...formatProps\n }\n ];\n });\n}\nfunction compileDateExpression(format, onError) {\n if (/^::/.test(format)) {\n const tokens = parseDateTokens(format.substring(2));\n return getDateFormatOptions(tokens, void 0, onError);\n }\n return format;\n}\nfunction compileMessageOrThrow(message, mapText = (v) => v) {\n return processTokens(parse(message), mapText);\n}\nfunction compileMessage(message, mapText = (v) => v) {\n try {\n return compileMessageOrThrow(message, mapText);\n } catch (e) {\n console.error(`${e.message} \n\nMessage: ${message}`);\n return [message];\n }\n}\n\nexport { compileMessage, compileMessageOrThrow };\n"],"names":["fields","parse"],"mappings":";AAYA,MAAM,wBAAwB,MAAM;AAAA;AAAA,EAEhC,YAAY,KAAK,OAAO,MAAM;AAC1B,UAAM,GAAG;AACT,SAAK,QAAQ;AACb,SAAK,OAAO,QAAQ;AAAA,EAC5B;AACA;AACA,MAAM,QAAQ,CAAC,UAAU,QAAQ,IAAI,UAAU,UAAU,IAAI,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E,OAAO;AAAA;AAAA,WAEnB,OAAO,EAAE;AAChB,WAAO,CAAC,OAAO;AAAA,EACnB;AACA;","x_google_ignoreList":[0]}
|
|
@@ -16,7 +16,7 @@ function requireLexer() {
|
|
|
16
16
|
doubleapos: { match: "''", value: () => "'" },
|
|
17
17
|
quoted: {
|
|
18
18
|
lineBreaks: true,
|
|
19
|
-
match: /'[{}#](?:[^]
|
|
19
|
+
match: /'[{}#](?:[^']|'')*'(?!')/u,
|
|
20
20
|
value: (src) => src.slice(1, -1).replace(/''/g, "'")
|
|
21
21
|
},
|
|
22
22
|
argument: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lexer.js","sources":["../../../../../node_modules/@messageformat/parser/lib/lexer.js"],"sourcesContent":["\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.lexer = exports.states = void 0;\nconst moo_1 = __importDefault(require(\"moo\"));\nexports.states = {\n body: {\n doubleapos: { match: \"''\", value: () => \"'\" },\n quoted: {\n lineBreaks: true,\n match: /'[{}#](?:[^]
|
|
1
|
+
{"version":3,"file":"lexer.js","sources":["../../../../../node_modules/@messageformat/parser/lib/lexer.js"],"sourcesContent":["\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.lexer = exports.states = void 0;\nconst moo_1 = __importDefault(require(\"moo\"));\nexports.states = {\n body: {\n doubleapos: { match: \"''\", value: () => \"'\" },\n quoted: {\n lineBreaks: true,\n match: /'[{}#](?:[^']|'')*'(?!')/u,\n value: src => src.slice(1, -1).replace(/''/g, \"'\")\n },\n argument: {\n lineBreaks: true,\n match: /\\{\\s*[^\\p{Pat_Syn}\\p{Pat_WS}]+\\s*/u,\n push: 'arg',\n value: src => src.substring(1).trim()\n },\n octothorpe: '#',\n end: { match: '}', pop: 1 },\n content: { lineBreaks: true, match: /[^][^{}#']*/u }\n },\n arg: {\n select: {\n lineBreaks: true,\n match: /,\\s*(?:plural|select|selectordinal)\\s*,\\s*/u,\n next: 'select',\n value: src => src.split(',')[1].trim()\n },\n 'func-args': {\n lineBreaks: true,\n match: /,\\s*[^\\p{Pat_Syn}\\p{Pat_WS}]+\\s*,/u,\n next: 'body',\n value: src => src.split(',')[1].trim()\n },\n 'func-simple': {\n lineBreaks: true,\n match: /,\\s*[^\\p{Pat_Syn}\\p{Pat_WS}]+\\s*/u,\n value: src => src.substring(1).trim()\n },\n end: { match: '}', pop: 1 }\n },\n select: {\n offset: {\n lineBreaks: true,\n match: /\\s*offset\\s*:\\s*\\d+\\s*/u,\n value: src => src.split(':')[1].trim()\n },\n case: {\n lineBreaks: true,\n match: /\\s*(?:=\\d+|[^\\p{Pat_Syn}\\p{Pat_WS}]+)\\s*\\{/u,\n push: 'body',\n value: src => src.substring(0, src.indexOf('{')).trim()\n },\n end: { match: /\\s*\\}/u, pop: 1 }\n }\n};\nexports.lexer = moo_1.default.states(exports.states);\n"],"names":["this","require$$0"],"mappings":";;;;;;;AACA,QAAI,kBAAmBA,SAAQA,MAAK,mBAAoB,SAAU,KAAK;AACnE,aAAQ,OAAO,IAAI,aAAc,MAAM,EAAE,WAAW,IAAK;AAAA,IAC5D;AACD,WAAO,eAAc,SAAU,cAAc,EAAE,OAAO,MAAM;AAC5D,YAAgB,QAAA,QAAA,SAAiB;AACjC,UAAM,QAAQ,gBAAgBC,YAAc;AAC5C,YAAiB,SAAA;AAAA,MACb,MAAM;AAAA,QACF,YAAY,EAAE,OAAO,MAAM,OAAO,MAAM,IAAK;AAAA,QAC7C,QAAQ;AAAA,UACJ,YAAY;AAAA,UACZ,OAAO;AAAA,UACP,OAAO,SAAO,IAAI,MAAM,GAAG,EAAE,EAAE,QAAQ,OAAO,GAAG;AAAA,QACpD;AAAA,QACD,UAAU;AAAA,UACN,YAAY;AA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ser;
|
|
6
6
|
hasRequiredParser = 1;
|
|
7
7
|
Object.defineProperty(parser, "__esModule", { value: true });
|
|
8
|
-
parser.
|
|
8
|
+
parser.ParseError = void 0;
|
|
9
|
+
parser.parse = parse;
|
|
9
10
|
const lexer_js_1 = requireLexer();
|
|
10
11
|
const getContext = (lt) => ({
|
|
11
12
|
offset: lt.offset,
|
|
@@ -71,8 +72,9 @@ function requireParser() {
|
|
|
71
72
|
}
|
|
72
73
|
checkSelectKey(lt, type, key) {
|
|
73
74
|
if (key[0] === "=") {
|
|
74
|
-
if (type === "select")
|
|
75
|
+
if (type === "select") {
|
|
75
76
|
throw new ParseError(lt, `The case ${key} is not valid with select`);
|
|
77
|
+
}
|
|
76
78
|
} else if (type !== "select") {
|
|
77
79
|
const keys = type === "plural" ? this.cardinalKeys : this.ordinalKeys;
|
|
78
80
|
if (this.strictPluralKeys && keys.length > 0 && !keys.includes(key)) {
|
|
@@ -90,10 +92,12 @@ function requireParser() {
|
|
|
90
92
|
for (const lt of this.lexer) {
|
|
91
93
|
switch (lt.type) {
|
|
92
94
|
case "offset":
|
|
93
|
-
if (type === "select")
|
|
95
|
+
if (type === "select") {
|
|
94
96
|
throw new ParseError(lt, "Unexpected plural offset for select");
|
|
95
|
-
|
|
97
|
+
}
|
|
98
|
+
if (sel.cases.length > 0) {
|
|
96
99
|
throw new ParseError(lt, "Plural offset must be set before cases");
|
|
100
|
+
}
|
|
97
101
|
sel.pluralOffset = Number(lt.value);
|
|
98
102
|
ctx.text += lt.text;
|
|
99
103
|
ctx.lineBreaks += lt.lineBreaks;
|
|
@@ -134,11 +138,13 @@ function requireParser() {
|
|
|
134
138
|
const end = this.lexer.next();
|
|
135
139
|
if (!end)
|
|
136
140
|
throw new ParseError(null, "Unexpected message end");
|
|
137
|
-
if (end.type !== "end")
|
|
141
|
+
if (end.type !== "end") {
|
|
138
142
|
throw new ParseError(end, `Unexpected lexer token: ${end.type}`);
|
|
143
|
+
}
|
|
139
144
|
ctx.text += end.text;
|
|
140
|
-
if (isSelectType(argType.value.toLowerCase()))
|
|
145
|
+
if (isSelectType(argType.value.toLowerCase())) {
|
|
141
146
|
throw new ParseError(argType, `Invalid type identifier: ${argType.value}`);
|
|
147
|
+
}
|
|
142
148
|
return {
|
|
143
149
|
type: "function",
|
|
144
150
|
arg: lt.value,
|
|
@@ -152,8 +158,9 @@ function requireParser() {
|
|
|
152
158
|
throw new ParseError(argType, msg);
|
|
153
159
|
}
|
|
154
160
|
let param = this.parseBody(this.strict ? false : inPlural);
|
|
155
|
-
if (this.strict && param.length > 0)
|
|
161
|
+
if (this.strict && param.length > 0) {
|
|
156
162
|
param = strictArgStyleParam(lt, param);
|
|
163
|
+
}
|
|
157
164
|
return {
|
|
158
165
|
type: "function",
|
|
159
166
|
arg: lt.value,
|
|
@@ -163,10 +170,11 @@ function requireParser() {
|
|
|
163
170
|
};
|
|
164
171
|
}
|
|
165
172
|
case "select":
|
|
166
|
-
if (isSelectType(argType.value))
|
|
173
|
+
if (isSelectType(argType.value)) {
|
|
167
174
|
return this.parseSelect(lt, inPlural, ctx, argType.value);
|
|
168
|
-
else
|
|
175
|
+
} else {
|
|
169
176
|
throw new ParseError(argType, `Unexpected select type ${argType.value}`);
|
|
177
|
+
}
|
|
170
178
|
/* istanbul ignore next: never happens */
|
|
171
179
|
default:
|
|
172
180
|
throw new ParseError(argType, `Unexpected lexer token: ${argType.type}`);
|
|
@@ -214,7 +222,6 @@ function requireParser() {
|
|
|
214
222
|
const parser2 = new Parser(src, options);
|
|
215
223
|
return parser2.parse();
|
|
216
224
|
}
|
|
217
|
-
parser.parse = parse;
|
|
218
225
|
return parser;
|
|
219
226
|
}
|
|
220
227
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.js","sources":["../../../../../node_modules/@messageformat/parser/lib/parser.js"],"sourcesContent":["\"use strict\";\n/**\n * An AST parser for ICU MessageFormat strings\n *\n * @packageDocumentation\n * @example\n * ```\n * import { parse } from '@messageformat/parser\n *\n * parse('So {wow}.')\n * [ { type: 'content', value: 'So ' },\n * { type: 'argument', arg: 'wow' },\n * { type: 'content', value: '.' } ]\n *\n *\n * parse('Such { thing }. { count, selectordinal, one {First} two {Second}' +\n * ' few {Third} other {#th} } word.')\n * [ { type: 'content', value: 'Such ' },\n * { type: 'argument', arg: 'thing' },\n * { type: 'content', value: '. ' },\n * { type: 'selectordinal',\n * arg: 'count',\n * cases: [\n * { key: 'one', tokens: [ { type: 'content', value: 'First' } ] },\n * { key: 'two', tokens: [ { type: 'content', value: 'Second' } ] },\n * { key: 'few', tokens: [ { type: 'content', value: 'Third' } ] },\n * { key: 'other',\n * tokens: [ { type: 'octothorpe' }, { type: 'content', value: 'th' } ] }\n * ] },\n * { type: 'content', value: ' word.' } ]\n *\n *\n * parse('Many{type,select,plural{ numbers}selectordinal{ counting}' +\n * 'select{ choices}other{ some {type}}}.')\n * [ { type: 'content', value: 'Many' },\n * { type: 'select',\n * arg: 'type',\n * cases: [\n * { key: 'plural', tokens: [ { type: 'content', value: 'numbers' } ] },\n * { key: 'selectordinal', tokens: [ { type: 'content', value: 'counting' } ] },\n * { key: 'select', tokens: [ { type: 'content', value: 'choices' } ] },\n * { key: 'other',\n * tokens: [ { type: 'content', value: 'some ' }, { type: 'argument', arg: 'type' } ] }\n * ] },\n * { type: 'content', value: '.' } ]\n *\n *\n * parse('{Such compliance')\n * // ParseError: invalid syntax at line 1 col 7:\n * //\n * // {Such compliance\n * // ^\n *\n *\n * const msg = '{words, plural, zero{No words} one{One word} other{# words}}'\n * parse(msg)\n * [ { type: 'plural',\n * arg: 'words',\n * cases: [\n * { key: 'zero', tokens: [ { type: 'content', value: 'No words' } ] },\n * { key: 'one', tokens: [ { type: 'content', value: 'One word' } ] },\n * { key: 'other',\n * tokens: [ { type: 'octothorpe' }, { type: 'content', value: ' words' } ] }\n * ] } ]\n *\n *\n * parse(msg, { cardinal: [ 'one', 'other' ], ordinal: [ 'one', 'two', 'few', 'other' ] })\n * // ParseError: The plural case zero is not valid in this locale at line 1 col 17:\n * //\n * // {words, plural, zero{\n * // ^\n * ```\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parse = exports.ParseError = void 0;\nconst lexer_js_1 = require(\"./lexer.js\");\nconst getContext = (lt) => ({\n offset: lt.offset,\n line: lt.line,\n col: lt.col,\n text: lt.text,\n lineBreaks: lt.lineBreaks\n});\nconst isSelectType = (type) => type === 'plural' || type === 'select' || type === 'selectordinal';\nfunction strictArgStyleParam(lt, param) {\n let value = '';\n let text = '';\n for (const p of param) {\n const pText = p.ctx.text;\n text += pText;\n switch (p.type) {\n case 'content':\n value += p.value;\n break;\n case 'argument':\n case 'function':\n case 'octothorpe':\n value += pText;\n break;\n default:\n throw new ParseError(lt, `Unsupported part in strict mode function arg style: ${pText}`);\n }\n }\n const c = {\n type: 'content',\n value: value.trim(),\n ctx: Object.assign({}, param[0].ctx, { text })\n };\n return [c];\n}\nconst strictArgTypes = [\n 'number',\n 'date',\n 'time',\n 'spellout',\n 'ordinal',\n 'duration'\n];\nconst defaultPluralKeys = ['zero', 'one', 'two', 'few', 'many', 'other'];\n/**\n * Thrown by {@link parse} on error\n *\n * @public\n */\nclass ParseError extends Error {\n /** @internal */\n constructor(lt, msg) {\n super(lexer_js_1.lexer.formatError(lt, msg));\n }\n}\nexports.ParseError = ParseError;\nclass Parser {\n constructor(src, opt) {\n var _a, _b, _c, _d;\n this.lexer = lexer_js_1.lexer.reset(src);\n this.cardinalKeys = (_a = opt === null || opt === void 0 ? void 0 : opt.cardinal) !== null && _a !== void 0 ? _a : defaultPluralKeys;\n this.ordinalKeys = (_b = opt === null || opt === void 0 ? void 0 : opt.ordinal) !== null && _b !== void 0 ? _b : defaultPluralKeys;\n this.strict = (_c = opt === null || opt === void 0 ? void 0 : opt.strict) !== null && _c !== void 0 ? _c : false;\n this.strictPluralKeys = (_d = opt === null || opt === void 0 ? void 0 : opt.strictPluralKeys) !== null && _d !== void 0 ? _d : true;\n }\n parse() {\n return this.parseBody(false, true);\n }\n checkSelectKey(lt, type, key) {\n if (key[0] === '=') {\n if (type === 'select')\n throw new ParseError(lt, `The case ${key} is not valid with select`);\n }\n else if (type !== 'select') {\n const keys = type === 'plural' ? this.cardinalKeys : this.ordinalKeys;\n if (this.strictPluralKeys && keys.length > 0 && !keys.includes(key)) {\n const msg = `The ${type} case ${key} is not valid in this locale`;\n throw new ParseError(lt, msg);\n }\n }\n }\n parseSelect({ value: arg }, inPlural, ctx, type) {\n const sel = { type, arg, cases: [], ctx };\n if (type === 'plural' || type === 'selectordinal')\n inPlural = true;\n else if (this.strict)\n inPlural = false;\n for (const lt of this.lexer) {\n switch (lt.type) {\n case 'offset':\n if (type === 'select')\n throw new ParseError(lt, 'Unexpected plural offset for select');\n if (sel.cases.length > 0)\n throw new ParseError(lt, 'Plural offset must be set before cases');\n sel.pluralOffset = Number(lt.value);\n ctx.text += lt.text;\n ctx.lineBreaks += lt.lineBreaks;\n break;\n case 'case': {\n this.checkSelectKey(lt, type, lt.value);\n sel.cases.push({\n key: lt.value,\n tokens: this.parseBody(inPlural),\n ctx: getContext(lt)\n });\n break;\n }\n case 'end':\n return sel;\n /* istanbul ignore next: never happens */\n default:\n throw new ParseError(lt, `Unexpected lexer token: ${lt.type}`);\n }\n }\n throw new ParseError(null, 'Unexpected message end');\n }\n parseArgToken(lt, inPlural) {\n const ctx = getContext(lt);\n const argType = this.lexer.next();\n if (!argType)\n throw new ParseError(null, 'Unexpected message end');\n ctx.text += argType.text;\n ctx.lineBreaks += argType.lineBreaks;\n if (this.strict &&\n (argType.type === 'func-simple' || argType.type === 'func-args') &&\n !strictArgTypes.includes(argType.value)) {\n const msg = `Invalid strict mode function arg type: ${argType.value}`;\n throw new ParseError(lt, msg);\n }\n switch (argType.type) {\n case 'end':\n return { type: 'argument', arg: lt.value, ctx };\n case 'func-simple': {\n const end = this.lexer.next();\n if (!end)\n throw new ParseError(null, 'Unexpected message end');\n /* istanbul ignore if: never happens */\n if (end.type !== 'end')\n throw new ParseError(end, `Unexpected lexer token: ${end.type}`);\n ctx.text += end.text;\n if (isSelectType(argType.value.toLowerCase()))\n throw new ParseError(argType, `Invalid type identifier: ${argType.value}`);\n return {\n type: 'function',\n arg: lt.value,\n key: argType.value,\n ctx\n };\n }\n case 'func-args': {\n if (isSelectType(argType.value.toLowerCase())) {\n const msg = `Invalid type identifier: ${argType.value}`;\n throw new ParseError(argType, msg);\n }\n let param = this.parseBody(this.strict ? false : inPlural);\n if (this.strict && param.length > 0)\n param = strictArgStyleParam(lt, param);\n return {\n type: 'function',\n arg: lt.value,\n key: argType.value,\n param,\n ctx\n };\n }\n case 'select':\n /* istanbul ignore else: never happens */\n if (isSelectType(argType.value))\n return this.parseSelect(lt, inPlural, ctx, argType.value);\n else\n throw new ParseError(argType, `Unexpected select type ${argType.value}`);\n /* istanbul ignore next: never happens */\n default:\n throw new ParseError(argType, `Unexpected lexer token: ${argType.type}`);\n }\n }\n parseBody(inPlural, atRoot) {\n const tokens = [];\n let content = null;\n for (const lt of this.lexer) {\n if (lt.type === 'argument') {\n if (content)\n content = null;\n tokens.push(this.parseArgToken(lt, inPlural));\n }\n else if (lt.type === 'octothorpe' && inPlural) {\n if (content)\n content = null;\n tokens.push({ type: 'octothorpe', ctx: getContext(lt) });\n }\n else if (lt.type === 'end' && !atRoot) {\n return tokens;\n }\n else {\n let value = lt.value;\n if (!inPlural && lt.type === 'quoted' && value[0] === '#') {\n if (value.includes('{')) {\n const errMsg = `Unsupported escape pattern: ${value}`;\n throw new ParseError(lt, errMsg);\n }\n value = lt.text;\n }\n if (content) {\n content.value += value;\n content.ctx.text += lt.text;\n content.ctx.lineBreaks += lt.lineBreaks;\n }\n else {\n content = { type: 'content', value, ctx: getContext(lt) };\n tokens.push(content);\n }\n }\n }\n if (atRoot)\n return tokens;\n throw new ParseError(null, 'Unexpected message end');\n }\n}\n/**\n * Parse an input string into an array of tokens\n *\n * @public\n * @remarks\n * The parser only supports the default `DOUBLE_OPTIONAL`\n * {@link http://www.icu-project.org/apiref/icu4c/messagepattern_8h.html#af6e0757e0eb81c980b01ee5d68a9978b | apostrophe mode}.\n */\nfunction parse(src, options = {}) {\n const parser = new Parser(src, options);\n return parser.parse();\n}\nexports.parse = parse;\n"],"names":["require$$0","parser"],"mappings":";;;;;;AAyEA,SAAO,eAAe,QAAS,cAAc,EAAE,OAAO,MAAM;AAC5D,SAAA,QAAgB,OAAA,aAAqB;AACrC,QAAM,aAAaA,aAAqB;AACxC,QAAM,aAAa,CAAC,QAAQ;AAAA,IACxB,QAAQ,GAAG;AAAA,IACX,MAAM,GAAG;AAAA,IACT,KAAK,GAAG;AAAA,IACR,MAAM,GAAG;AAAA,IACT,YAAY,GAAG;AAAA,EACnB;AACA,QAAM,eAAe,CAAC,SAAS,SAAS,YAAY,SAAS,YAAY,SAAS;AAClF,WAAS,oBAAoB,IAAI,OAAO;AACpC,QAAI,QAAQ;AACZ,QAAI,OAAO;AACX,eAAW,KAAK,OAAO;AACnB,YAAM,QAAQ,EAAE,IAAI;AACpB,cAAQ;AACR,cAAQ,EAAE,MAAI;AAAA,QACV,KAAK;AACD,mBAAS,EAAE;AACX;AAAA,QACJ,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AACD,mBAAS;AACT;AAAA,QACJ;AACI,gBAAM,IAAI,WAAW,IAAI,uDAAuD,KAAK,EAAE;AAAA,MACvG;AAAA,IACA;AACI,UAAM,IAAI;AAAA,MACN,MAAM;AAAA,MACN,OAAO,MAAM,KAAM;AAAA,MACnB,KAAK,OAAO,OAAO,CAAE,GAAE,MAAM,CAAC,EAAE,KAAK,EAAE,KAAM,CAAA;AAAA,IAChD;AACD,WAAO,CAAC,CAAC;AAAA,EACb;AACA,QAAM,iBAAiB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACH;AACD,QAAM,oBAAoB,CAAC,QAAQ,OAAO,OAAO,OAAO,QAAQ,OAAO;AAAA,EAMvE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AM,SAAS,CAAE;AACjB,UAAI,UAAU;AACd,iBAAW,MAAM,KAAK,OAAO;AACzB,YAAI,GAAG,SAAS,YAAY;AACxB,cAAI;AACA,sBAAU;AACd,iBAAO,KAAK,KAAK,cAAc,IAAI,QAAQ,CAAC;AAAA,QAC5D,WACqB,GAAG,SAAS,gBAAgB,UAAU;AAC3C,cAAI;AACA,sBAAU;AACd,iBAAO,KAAK,EAAE,MAAM,cAAc,KAAK,WAAW,EAAE,GAAG;AAAA,QACvE,WACqB,GAAG,SAAS,SAAS,CAAC,QAAQ;AACnC,iBAAO;AAAA,QACvB,OACiB;AACD,cAAI,QAAQ,GAAG;AACf,cAAI,CAAC,YAAY,GAAG,SAAS,YAAY,MAAM,CAAC,MAAM,KAAK;AACvD,gBAAI,MAAM,SAAS,GAAG,GAAG;AACrB,oBAAM,SAAS,+BAA+B,KAAK;AACnD,oBAAM,IAAI,WAAW,IAAI,MAAM;AAAA,YACvD;AACoB,oBAAQ,GAAG;AAAA,UAC/B;AACgB,cAAI,SAAS;AACT,oBAAQ,SAAS;AACjB,oBAAQ,IAAI,QAAQ,GAAG;AACvB,oBAAQ,IAAI,cAAc,GAAG;AAAA,UACjD,OACqB;AACD,sBAAU,EAAE,MAAM,WAAW,OAAO,KAAK,WAAW,EAAE,EAAG;AACzD,mBAAO,KAAK,OAAO;AAAA,UACvC;AAAA,QACA;AAAA,MACA;AACQ,UAAI;AACA,eAAO;AACX,YAAM,IAAI,WAAW,MAAM,wBAAwB;AAAA,IAC3D;AAAA,EACA;AASA,WAAS,MAAM,KAAK,UAAU,IAAI;AAC9B,UAAMC,UAAS,IAAI,OAAO,KAAK,OAAO;AACtC,WAAOA,QAAO,MAAO;AAAA,EACzB;AACA,SAAA,QAAgB;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"parser.js","sources":["../../../../../node_modules/@messageformat/parser/lib/parser.js"],"sourcesContent":["\"use strict\";\n/**\n * An AST parser for ICU MessageFormat strings\n *\n * @packageDocumentation\n * @example\n * ```\n * import { parse } from '@messageformat/parser\n *\n * parse('So {wow}.')\n * [ { type: 'content', value: 'So ' },\n * { type: 'argument', arg: 'wow' },\n * { type: 'content', value: '.' } ]\n *\n *\n * parse('Such { thing }. { count, selectordinal, one {First} two {Second}' +\n * ' few {Third} other {#th} } word.')\n * [ { type: 'content', value: 'Such ' },\n * { type: 'argument', arg: 'thing' },\n * { type: 'content', value: '. ' },\n * { type: 'selectordinal',\n * arg: 'count',\n * cases: [\n * { key: 'one', tokens: [ { type: 'content', value: 'First' } ] },\n * { key: 'two', tokens: [ { type: 'content', value: 'Second' } ] },\n * { key: 'few', tokens: [ { type: 'content', value: 'Third' } ] },\n * { key: 'other',\n * tokens: [ { type: 'octothorpe' }, { type: 'content', value: 'th' } ] }\n * ] },\n * { type: 'content', value: ' word.' } ]\n *\n *\n * parse('Many{type,select,plural{ numbers}selectordinal{ counting}' +\n * 'select{ choices}other{ some {type}}}.')\n * [ { type: 'content', value: 'Many' },\n * { type: 'select',\n * arg: 'type',\n * cases: [\n * { key: 'plural', tokens: [ { type: 'content', value: 'numbers' } ] },\n * { key: 'selectordinal', tokens: [ { type: 'content', value: 'counting' } ] },\n * { key: 'select', tokens: [ { type: 'content', value: 'choices' } ] },\n * { key: 'other',\n * tokens: [ { type: 'content', value: 'some ' }, { type: 'argument', arg: 'type' } ] }\n * ] },\n * { type: 'content', value: '.' } ]\n *\n *\n * parse('{Such compliance')\n * // ParseError: invalid syntax at line 1 col 7:\n * //\n * // {Such compliance\n * // ^\n *\n *\n * const msg = '{words, plural, zero{No words} one{One word} other{# words}}'\n * parse(msg)\n * [ { type: 'plural',\n * arg: 'words',\n * cases: [\n * { key: 'zero', tokens: [ { type: 'content', value: 'No words' } ] },\n * { key: 'one', tokens: [ { type: 'content', value: 'One word' } ] },\n * { key: 'other',\n * tokens: [ { type: 'octothorpe' }, { type: 'content', value: ' words' } ] }\n * ] } ]\n *\n *\n * parse(msg, { cardinal: [ 'one', 'other' ], ordinal: [ 'one', 'two', 'few', 'other' ] })\n * // ParseError: The plural case zero is not valid in this locale at line 1 col 17:\n * //\n * // {words, plural, zero{\n * // ^\n * ```\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ParseError = void 0;\nexports.parse = parse;\nconst lexer_js_1 = require(\"./lexer.js\");\nconst getContext = (lt) => ({\n offset: lt.offset,\n line: lt.line,\n col: lt.col,\n text: lt.text,\n lineBreaks: lt.lineBreaks\n});\nconst isSelectType = (type) => type === 'plural' || type === 'select' || type === 'selectordinal';\nfunction strictArgStyleParam(lt, param) {\n let value = '';\n let text = '';\n for (const p of param) {\n const pText = p.ctx.text;\n text += pText;\n switch (p.type) {\n case 'content':\n value += p.value;\n break;\n case 'argument':\n case 'function':\n case 'octothorpe':\n value += pText;\n break;\n default:\n throw new ParseError(lt, `Unsupported part in strict mode function arg style: ${pText}`);\n }\n }\n const c = {\n type: 'content',\n value: value.trim(),\n ctx: Object.assign({}, param[0].ctx, { text })\n };\n return [c];\n}\nconst strictArgTypes = [\n 'number',\n 'date',\n 'time',\n 'spellout',\n 'ordinal',\n 'duration'\n];\nconst defaultPluralKeys = ['zero', 'one', 'two', 'few', 'many', 'other'];\n/**\n * Thrown by {@link parse} on error\n *\n * @public\n */\nclass ParseError extends Error {\n /** @internal */\n constructor(lt, msg) {\n super(lexer_js_1.lexer.formatError(lt, msg));\n }\n}\nexports.ParseError = ParseError;\nclass Parser {\n constructor(src, opt) {\n var _a, _b, _c, _d;\n this.lexer = lexer_js_1.lexer.reset(src);\n this.cardinalKeys = (_a = opt === null || opt === void 0 ? void 0 : opt.cardinal) !== null && _a !== void 0 ? _a : defaultPluralKeys;\n this.ordinalKeys = (_b = opt === null || opt === void 0 ? void 0 : opt.ordinal) !== null && _b !== void 0 ? _b : defaultPluralKeys;\n this.strict = (_c = opt === null || opt === void 0 ? void 0 : opt.strict) !== null && _c !== void 0 ? _c : false;\n this.strictPluralKeys = (_d = opt === null || opt === void 0 ? void 0 : opt.strictPluralKeys) !== null && _d !== void 0 ? _d : true;\n }\n parse() {\n return this.parseBody(false, true);\n }\n checkSelectKey(lt, type, key) {\n if (key[0] === '=') {\n if (type === 'select') {\n throw new ParseError(lt, `The case ${key} is not valid with select`);\n }\n }\n else if (type !== 'select') {\n const keys = type === 'plural' ? this.cardinalKeys : this.ordinalKeys;\n if (this.strictPluralKeys && keys.length > 0 && !keys.includes(key)) {\n const msg = `The ${type} case ${key} is not valid in this locale`;\n throw new ParseError(lt, msg);\n }\n }\n }\n parseSelect({ value: arg }, inPlural, ctx, type) {\n const sel = { type, arg, cases: [], ctx };\n if (type === 'plural' || type === 'selectordinal')\n inPlural = true;\n else if (this.strict)\n inPlural = false;\n for (const lt of this.lexer) {\n switch (lt.type) {\n case 'offset':\n if (type === 'select') {\n throw new ParseError(lt, 'Unexpected plural offset for select');\n }\n if (sel.cases.length > 0) {\n throw new ParseError(lt, 'Plural offset must be set before cases');\n }\n sel.pluralOffset = Number(lt.value);\n ctx.text += lt.text;\n ctx.lineBreaks += lt.lineBreaks;\n break;\n case 'case': {\n this.checkSelectKey(lt, type, lt.value);\n sel.cases.push({\n key: lt.value,\n tokens: this.parseBody(inPlural),\n ctx: getContext(lt)\n });\n break;\n }\n case 'end':\n return sel;\n /* istanbul ignore next: never happens */\n default:\n throw new ParseError(lt, `Unexpected lexer token: ${lt.type}`);\n }\n }\n throw new ParseError(null, 'Unexpected message end');\n }\n parseArgToken(lt, inPlural) {\n const ctx = getContext(lt);\n const argType = this.lexer.next();\n if (!argType)\n throw new ParseError(null, 'Unexpected message end');\n ctx.text += argType.text;\n ctx.lineBreaks += argType.lineBreaks;\n if (this.strict &&\n (argType.type === 'func-simple' || argType.type === 'func-args') &&\n !strictArgTypes.includes(argType.value)) {\n const msg = `Invalid strict mode function arg type: ${argType.value}`;\n throw new ParseError(lt, msg);\n }\n switch (argType.type) {\n case 'end':\n return { type: 'argument', arg: lt.value, ctx };\n case 'func-simple': {\n const end = this.lexer.next();\n if (!end)\n throw new ParseError(null, 'Unexpected message end');\n /* istanbul ignore if: never happens */\n if (end.type !== 'end') {\n throw new ParseError(end, `Unexpected lexer token: ${end.type}`);\n }\n ctx.text += end.text;\n if (isSelectType(argType.value.toLowerCase())) {\n throw new ParseError(argType, `Invalid type identifier: ${argType.value}`);\n }\n return {\n type: 'function',\n arg: lt.value,\n key: argType.value,\n ctx\n };\n }\n case 'func-args': {\n if (isSelectType(argType.value.toLowerCase())) {\n const msg = `Invalid type identifier: ${argType.value}`;\n throw new ParseError(argType, msg);\n }\n let param = this.parseBody(this.strict ? false : inPlural);\n if (this.strict && param.length > 0) {\n param = strictArgStyleParam(lt, param);\n }\n return {\n type: 'function',\n arg: lt.value,\n key: argType.value,\n param,\n ctx\n };\n }\n case 'select':\n /* istanbul ignore else: never happens */\n if (isSelectType(argType.value)) {\n return this.parseSelect(lt, inPlural, ctx, argType.value);\n }\n else {\n throw new ParseError(argType, `Unexpected select type ${argType.value}`);\n }\n /* istanbul ignore next: never happens */\n default:\n throw new ParseError(argType, `Unexpected lexer token: ${argType.type}`);\n }\n }\n parseBody(inPlural, atRoot) {\n const tokens = [];\n let content = null;\n for (const lt of this.lexer) {\n if (lt.type === 'argument') {\n if (content)\n content = null;\n tokens.push(this.parseArgToken(lt, inPlural));\n }\n else if (lt.type === 'octothorpe' && inPlural) {\n if (content)\n content = null;\n tokens.push({ type: 'octothorpe', ctx: getContext(lt) });\n }\n else if (lt.type === 'end' && !atRoot) {\n return tokens;\n }\n else {\n let value = lt.value;\n if (!inPlural && lt.type === 'quoted' && value[0] === '#') {\n if (value.includes('{')) {\n const errMsg = `Unsupported escape pattern: ${value}`;\n throw new ParseError(lt, errMsg);\n }\n value = lt.text;\n }\n if (content) {\n content.value += value;\n content.ctx.text += lt.text;\n content.ctx.lineBreaks += lt.lineBreaks;\n }\n else {\n content = { type: 'content', value, ctx: getContext(lt) };\n tokens.push(content);\n }\n }\n }\n if (atRoot)\n return tokens;\n throw new ParseError(null, 'Unexpected message end');\n }\n}\n/**\n * Parse an input string into an array of tokens\n *\n * @public\n * @remarks\n * The parser only supports the default `DOUBLE_OPTIONAL`\n * {@link http://www.icu-project.org/apiref/icu4c/messagepattern_8h.html#af6e0757e0eb81c980b01ee5d68a9978b | apostrophe mode}.\n */\nfunction parse(src, options = {}) {\n const parser = new Parser(src, options);\n return parser.parse();\n}\n"],"names":["require$$0","parser"],"mappings":";;;;;;AAyEA,SAAO,eAAe,QAAS,cAAc,EAAE,OAAO,MAAM;AAC1C,SAAA,aAAG;AACrB,SAAA,QAAgB;AAChB,QAAM,aAAaA,aAAqB;AACxC,QAAM,aAAa,CAAC,QAAQ;AAAA,IACxB,QAAQ,GAAG;AAAA,IACX,MAAM,GAAG;AAAA,IACT,KAAK,GAAG;AAAA,IACR,MAAM,GAAG;AAAA,IACT,YAAY,GAAG;AAAA,EACnB;AACA,QAAM,eAAe,CAAC,SAAS,SAAS,YAAY,SAAS,YAAY,SAAS;AAClF,WAAS,oBAAoB,IAAI,OAAO;AACpC,QAAI,QAAQ;AACZ,QAAI,OAAO;AACX,eAAW,KAAK,OAAO;AACnB,YAAM,QAAQ,EAAE,IAAI;AACpB,cAAQ;AACR,cAAQ,EAAE,MAAI;AAAA,QACV,KAAK;AACD,mBAAS,EAAE;AACX;AAAA,QACJ,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AACD,mBAAS;AACT;AAAA,QACJ;AACI,gBAAM,IAAI,WAAW,IAAI,uDAAuD,KAAK,EAAE;AAAA,MACvG;AAAA,IACA;AACI,UAAM,IAAI;AAAA,MACN,MAAM;AAAA,MACN,OAAO,MAAM,KAAM;AAAA,MACnB,KAAK,OAAO,OAAO,CAAE,GAAE,MAAM,CAAC,EAAE,KAAK,EAAE,KAAM,CAAA;AAAA,IAChD;AACD,WAAO,CAAC,CAAC;AAAA,EACb;AACA,QAAM,iBAAiB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACH;AAC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K,OAAO;AACtC,WAAOA,QAAO,MAAO;AAAA,EACzB;;;","x_google_ignoreList":[0]}
|
package/dist/types/Auth.d.ts
CHANGED
|
@@ -16,7 +16,8 @@ export declare enum FlowEnum {
|
|
|
16
16
|
ProviderToken = "provider_token",
|
|
17
17
|
MfaAuthenticate = "mfa_authenticate",
|
|
18
18
|
Reauthenticate = "reauthenticate",
|
|
19
|
-
MfaReauthenticate = "mfa_reauthenticate"
|
|
19
|
+
MfaReauthenticate = "mfa_reauthenticate",
|
|
20
|
+
MfaTrust = "mfa_trust"
|
|
20
21
|
}
|
|
21
22
|
export interface Flow {
|
|
22
23
|
id: FlowEnum;
|
package/dist/types/Forms.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DefaultMantineColor, MantineStyleProp } from '@mantine/core';
|
|
2
2
|
import { UseFormReturnType } from '@mantine/form';
|
|
3
|
-
import { ReactNode } from 'react';
|
|
4
|
-
import { FieldValues } from 'react-hook-form';
|
|
3
|
+
import { JSX, ReactNode } from 'react';
|
|
4
|
+
import { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
5
5
|
import { ApiEndpoints } from '../enums/ApiEndpoints';
|
|
6
6
|
import { ModelType } from '../enums/ModelType';
|
|
7
7
|
import { PathParams, UiSizeType } from './Core';
|
|
@@ -106,6 +106,7 @@ export type ApiFormFieldSet = Record<string, ApiFormFieldType>;
|
|
|
106
106
|
* @param onFormSuccess : A callback function to call when the form is submitted successfully.
|
|
107
107
|
* @param onFormError : A callback function to call when the form is submitted with errors.
|
|
108
108
|
* @param processFormData : A callback function to process the form data before submission
|
|
109
|
+
* @param checkClose: A callback function to check if the form can be closed after submission
|
|
109
110
|
* @param modelType : Define a model type for this form
|
|
110
111
|
* @param follow : Boolean, follow the result of the form (if possible)
|
|
111
112
|
* @param table : Table to update on success (if provided)
|
|
@@ -129,9 +130,10 @@ export interface ApiFormProps {
|
|
|
129
130
|
preFormSuccess?: string;
|
|
130
131
|
postFormContent?: JSX.Element;
|
|
131
132
|
successMessage?: string | null;
|
|
132
|
-
onFormSuccess?: (data: any) => void;
|
|
133
|
-
onFormError?: (response: any) => void;
|
|
134
|
-
processFormData?: (data: any) => any;
|
|
133
|
+
onFormSuccess?: (data: any, form: UseFormReturn) => void;
|
|
134
|
+
onFormError?: (response: any, form: UseFormReturn) => void;
|
|
135
|
+
processFormData?: (data: any, form: UseFormReturn) => any;
|
|
136
|
+
checkClose?: (data: any, form: UseFormReturn) => boolean;
|
|
135
137
|
table?: TableState;
|
|
136
138
|
modelType?: ModelType;
|
|
137
139
|
follow?: boolean;
|
package/dist/types/Plugins.d.ts
CHANGED
|
@@ -12,6 +12,12 @@ export interface PluginProps {
|
|
|
12
12
|
slug: string;
|
|
13
13
|
version: null | string;
|
|
14
14
|
}
|
|
15
|
+
export interface PluginVersion {
|
|
16
|
+
inventree: string;
|
|
17
|
+
react: string;
|
|
18
|
+
reactDom: string;
|
|
19
|
+
mantine: string;
|
|
20
|
+
}
|
|
15
21
|
export type InvenTreeFormsContext = {
|
|
16
22
|
bulkEdit: (props: BulkEditApiFormModalProps) => UseModalReturn;
|
|
17
23
|
create: (props: ApiFormModalProps) => UseModalReturn;
|
|
@@ -40,7 +46,7 @@ export type InvenTreeFormsContext = {
|
|
|
40
46
|
* @param context - Any additional context data which may be passed to the plugin
|
|
41
47
|
*/
|
|
42
48
|
export type InvenTreePluginContext = {
|
|
43
|
-
version:
|
|
49
|
+
version: PluginVersion;
|
|
44
50
|
api: AxiosInstance;
|
|
45
51
|
queryClient: QueryClient;
|
|
46
52
|
user: UserStateProps;
|
|
@@ -60,3 +66,6 @@ export type InvenTreePluginContext = {
|
|
|
60
66
|
context?: any;
|
|
61
67
|
};
|
|
62
68
|
export declare const INVENTREE_PLUGIN_VERSION: string;
|
|
69
|
+
export declare const INVENTREE_REACT_VERSION: string;
|
|
70
|
+
export declare const INVENTREE_REACT_DOM_VERSION: string;
|
|
71
|
+
export declare const INVENTREE_MANTINE_VERSION: string;
|
package/dist/types/Plugins.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
const INVENTREE_PLUGIN_VERSION = "0.0.
|
|
1
|
+
const INVENTREE_PLUGIN_VERSION = "0.0.9";
|
|
2
|
+
const INVENTREE_REACT_VERSION = "18.3.1";
|
|
3
|
+
const INVENTREE_REACT_DOM_VERSION = (
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
"18.3.1"
|
|
6
|
+
);
|
|
7
|
+
const INVENTREE_MANTINE_VERSION = "7.16.0";
|
|
2
8
|
export {
|
|
3
|
-
|
|
9
|
+
INVENTREE_MANTINE_VERSION,
|
|
10
|
+
INVENTREE_PLUGIN_VERSION,
|
|
11
|
+
INVENTREE_REACT_DOM_VERSION,
|
|
12
|
+
INVENTREE_REACT_VERSION
|
|
4
13
|
};
|
|
5
14
|
//# sourceMappingURL=Plugins.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plugins.js","sources":["../../lib/types/Plugins.tsx"],"sourcesContent":["import type { MantineColorScheme, MantineTheme } from '@mantine/core';\nimport type { QueryClient } from '@tanstack/react-query';\nimport type { AxiosInstance } from 'axios';\nimport type { NavigateFunction } from 'react-router-dom';\nimport type { ModelType } from '../enums/ModelType';\nimport type { ApiFormModalProps, BulkEditApiFormModalProps } from './Forms';\nimport type { UseModalReturn } from './Modals';\nimport type { SettingsStateProps } from './Settings';\nimport type { UserStateProps } from './User';\n\nexport interface PluginProps {\n name: string;\n slug: string;\n version: null | string;\n}\n\nexport type InvenTreeFormsContext = {\n bulkEdit: (props: BulkEditApiFormModalProps) => UseModalReturn;\n create: (props: ApiFormModalProps) => UseModalReturn;\n delete: (props: ApiFormModalProps) => UseModalReturn;\n edit: (props: ApiFormModalProps) => UseModalReturn;\n};\n\n/**\n * A set of properties which are passed to a plugin,\n * for rendering an element in the user interface.\n *\n * @param version - The version of the running InvenTree software stack\n * @param api - The Axios API instance (see ../states/ApiState.tsx)\n * @param user - The current user instance (see ../states/UserState.tsx)\n * @param userSettings - The current user settings (see ../states/SettingsState.tsx)\n * @param globalSettings - The global settings (see ../states/SettingsState.tsx)\n * @param navigate - The navigation function (see react-router-dom)\n * @param theme - The current Mantine theme\n * @param colorScheme - The current Mantine color scheme (e.g. 'light' / 'dark')\n * @param host - The current host URL\n * @param locale - The current locale string (e.g. 'en' / 'de')\n * @param model - The model type associated with the rendered component (if applicable)\n * @param id - The ID (primary key) of the model instance for the plugin (if applicable)\n * @param instance - The model instance data (if available)\n * @param reloadContent - A function which can be called to reload the plugin content\n * @param reloadInstance - A function which can be called to reload the model instance\n * @param context - Any additional context data which may be passed to the plugin\n */\nexport type InvenTreePluginContext = {\n version:
|
|
1
|
+
{"version":3,"file":"Plugins.js","sources":["../../lib/types/Plugins.tsx"],"sourcesContent":["import type { MantineColorScheme, MantineTheme } from '@mantine/core';\nimport type { QueryClient } from '@tanstack/react-query';\nimport type { AxiosInstance } from 'axios';\nimport type { NavigateFunction } from 'react-router-dom';\nimport type { ModelType } from '../enums/ModelType';\nimport type { ApiFormModalProps, BulkEditApiFormModalProps } from './Forms';\nimport type { UseModalReturn } from './Modals';\nimport type { SettingsStateProps } from './Settings';\nimport type { UserStateProps } from './User';\n\nexport interface PluginProps {\n name: string;\n slug: string;\n version: null | string;\n}\n\nexport interface PluginVersion {\n inventree: string;\n react: string;\n reactDom: string;\n mantine: string;\n}\n\nexport type InvenTreeFormsContext = {\n bulkEdit: (props: BulkEditApiFormModalProps) => UseModalReturn;\n create: (props: ApiFormModalProps) => UseModalReturn;\n delete: (props: ApiFormModalProps) => UseModalReturn;\n edit: (props: ApiFormModalProps) => UseModalReturn;\n};\n\n/**\n * A set of properties which are passed to a plugin,\n * for rendering an element in the user interface.\n *\n * @param version - The version of the running InvenTree software stack\n * @param api - The Axios API instance (see ../states/ApiState.tsx)\n * @param user - The current user instance (see ../states/UserState.tsx)\n * @param userSettings - The current user settings (see ../states/SettingsState.tsx)\n * @param globalSettings - The global settings (see ../states/SettingsState.tsx)\n * @param navigate - The navigation function (see react-router-dom)\n * @param theme - The current Mantine theme\n * @param colorScheme - The current Mantine color scheme (e.g. 'light' / 'dark')\n * @param host - The current host URL\n * @param locale - The current locale string (e.g. 'en' / 'de')\n * @param model - The model type associated with the rendered component (if applicable)\n * @param id - The ID (primary key) of the model instance for the plugin (if applicable)\n * @param instance - The model instance data (if available)\n * @param reloadContent - A function which can be called to reload the plugin content\n * @param reloadInstance - A function which can be called to reload the model instance\n * @param context - Any additional context data which may be passed to the plugin\n */\nexport type InvenTreePluginContext = {\n version: PluginVersion;\n api: AxiosInstance;\n queryClient: QueryClient;\n user: UserStateProps;\n userSettings: SettingsStateProps;\n globalSettings: SettingsStateProps;\n host: string;\n locale: string;\n navigate: NavigateFunction;\n theme: MantineTheme;\n forms: InvenTreeFormsContext;\n colorScheme: MantineColorScheme;\n model?: ModelType | string;\n id?: string | number | null;\n instance?: any;\n reloadContent?: () => void;\n reloadInstance?: () => void;\n context?: any;\n};\n\n/*\n * The version of the InvenTree plugin context interface.\n * This number should be incremented if the interface changes.\n */\n\n// @ts-ignore\nexport const INVENTREE_PLUGIN_VERSION: string = __INVENTREE_LIB_VERSION__;\n// @ts-ignore\nexport const INVENTREE_REACT_VERSION: string = __INVENTREE_REACT_VERSION__;\n// @ts-ignore\nexport const INVENTREE_REACT_DOM_VERSION: string =\n // @ts-ignore\n __INVENTREE_REACT_DOM_VERSION__;\n// @ts-ignore\nexport const INVENTREE_MANTINE_VERSION: string = __INVENTREE_MANTINE_VERSION__;\n"],"names":["INVENTREE_PLUGIN_VERSION","__INVENTREE_LIB_VERSION__","INVENTREE_REACT_VERSION","__INVENTREE_REACT_VERSION__","INVENTREE_REACT_DOM_VERSION","__INVENTREE_REACT_DOM_VERSION__","INVENTREE_MANTINE_VERSION","__INVENTREE_MANTINE_VERSION__"],"mappings":"AA8EO,MAAMA,2BAAmCC;AAEzC,MAAMC,0BAAkCC;AAElCC,MAAAA;AAAAA;AAAAA,EAEXC;AAAAA;AAEK,MAAMC,4BAAoCC;"}
|
package/dist/types/Settings.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export interface SettingsStateProps {
|
|
|
41
41
|
settings: Setting[];
|
|
42
42
|
lookup: SettingsLookup;
|
|
43
43
|
fetchSettings: () => Promise<boolean>;
|
|
44
|
+
loaded: boolean;
|
|
44
45
|
endpoint: ApiEndpoints;
|
|
45
46
|
pathParams?: PathParams;
|
|
46
47
|
getSetting: (key: string, default_value?: string) => string;
|
|
@@ -30,6 +30,7 @@ export enum ApiEndpoints {
|
|
|
30
30
|
auth_recovery = 'auth/v1/account/authenticators/recovery-codes',
|
|
31
31
|
auth_mfa_reauthenticate = 'auth/v1/auth/2fa/reauthenticate',
|
|
32
32
|
auth_totp = 'auth/v1/account/authenticators/totp',
|
|
33
|
+
auth_trust = 'auth/v1/auth/2fa/trust',
|
|
33
34
|
auth_reauthenticate = 'auth/v1/auth/reauthenticate',
|
|
34
35
|
auth_email = 'auth/v1/account/email',
|
|
35
36
|
auth_email_verify = 'auth/v1/auth/email/verify',
|
|
@@ -55,6 +56,7 @@ export enum ApiEndpoints {
|
|
|
55
56
|
license = 'license/',
|
|
56
57
|
group_list = 'user/group/',
|
|
57
58
|
owner_list = 'user/owner/',
|
|
59
|
+
ruleset_list = 'user/ruleset/',
|
|
58
60
|
content_type_list = 'contenttype/',
|
|
59
61
|
icons = 'icons/',
|
|
60
62
|
selectionlist_list = 'selection/',
|
|
@@ -101,6 +103,7 @@ export enum ApiEndpoints {
|
|
|
101
103
|
bom_list = 'bom/',
|
|
102
104
|
bom_item_validate = 'bom/:id/validate/',
|
|
103
105
|
bom_validate = 'part/:id/bom-validate/',
|
|
106
|
+
bom_substitute_list = 'bom/substitute/',
|
|
104
107
|
|
|
105
108
|
// Part API endpoints
|
|
106
109
|
part_list = 'part/',
|
|
@@ -151,6 +154,7 @@ export enum ApiEndpoints {
|
|
|
151
154
|
stock_uninstall = 'stock/:id/uninstall/',
|
|
152
155
|
stock_serialize = 'stock/:id/serialize/',
|
|
153
156
|
stock_return = 'stock/:id/return/',
|
|
157
|
+
stock_serial_info = 'stock/:id/serial-numbers/',
|
|
154
158
|
|
|
155
159
|
// Generator API endpoints
|
|
156
160
|
generate_batch_code = 'generate/batch-code/',
|
package/lib/enums/Roles.tsx
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { t } from '@lingui/core/macro';
|
|
2
|
+
|
|
1
3
|
/*
|
|
2
4
|
* Enumeration of available user role groups
|
|
3
5
|
*/
|
|
@@ -23,3 +25,30 @@ export enum UserPermissions {
|
|
|
23
25
|
change = 'change',
|
|
24
26
|
delete = 'delete'
|
|
25
27
|
}
|
|
28
|
+
|
|
29
|
+
export function userRoleLabel(role: UserRoles): string {
|
|
30
|
+
switch (role) {
|
|
31
|
+
case UserRoles.admin:
|
|
32
|
+
return t`Admin`;
|
|
33
|
+
case UserRoles.build:
|
|
34
|
+
return t`Build Orders`;
|
|
35
|
+
case UserRoles.part:
|
|
36
|
+
return t`Parts`;
|
|
37
|
+
case UserRoles.part_category:
|
|
38
|
+
return t`Part Categories`;
|
|
39
|
+
case UserRoles.purchase_order:
|
|
40
|
+
return t`Purchase Orders`;
|
|
41
|
+
case UserRoles.return_order:
|
|
42
|
+
return t`Return Orders`;
|
|
43
|
+
case UserRoles.sales_order:
|
|
44
|
+
return t`Sales Orders`;
|
|
45
|
+
case UserRoles.stock:
|
|
46
|
+
return t`Stock Items`;
|
|
47
|
+
case UserRoles.stock_location:
|
|
48
|
+
return t`Stock Location`;
|
|
49
|
+
case UserRoles.stocktake:
|
|
50
|
+
return t`Stocktake`;
|
|
51
|
+
default:
|
|
52
|
+
return role as string;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { NavigateFunction } from 'react-router-dom';
|
|
2
2
|
import { ModelInformationDict } from '../enums/ModelInformation';
|
|
3
3
|
import type { ModelType } from '../enums/ModelType';
|
|
4
|
+
import { apiUrl } from './Api';
|
|
4
5
|
import { cancelEvent } from './Events';
|
|
5
6
|
|
|
6
7
|
export const getBaseUrl = (): string =>
|
|
7
8
|
(window as any).INVENTREE_SETTINGS?.base_url || 'web';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
|
-
* Returns the detail view URL for a given model type
|
|
11
|
+
* Returns the detail view URL for a given model type.
|
|
12
|
+
* This is the UI URL, not the API URL.
|
|
11
13
|
*/
|
|
12
14
|
export function getDetailUrl(
|
|
13
15
|
model: ModelType,
|
|
@@ -35,6 +37,27 @@ export function getDetailUrl(
|
|
|
35
37
|
return '';
|
|
36
38
|
}
|
|
37
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Returns the API detail URL for a given model type.
|
|
42
|
+
*/
|
|
43
|
+
export function getApiUrl(
|
|
44
|
+
model: ModelType,
|
|
45
|
+
pk: number | string
|
|
46
|
+
): string | undefined {
|
|
47
|
+
const modelInfo = ModelInformationDict[model];
|
|
48
|
+
|
|
49
|
+
if (pk === undefined || pk === null) {
|
|
50
|
+
return '';
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (!!pk && modelInfo && modelInfo.api_endpoint) {
|
|
54
|
+
return apiUrl(modelInfo.api_endpoint, pk);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
console.error(`No API detail URL found for model ${model} <${pk}>`);
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
|
|
38
61
|
/*
|
|
39
62
|
* Navigate to a provided link.
|
|
40
63
|
* - If the link is to be opened externally, open it in a new tab.
|
|
@@ -5,6 +5,17 @@ import {
|
|
|
5
5
|
|
|
6
6
|
function extractVersion(version: string) {
|
|
7
7
|
// Extract the version number from the string
|
|
8
|
+
|
|
9
|
+
if (!version) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
version = version.toString().trim();
|
|
14
|
+
|
|
15
|
+
if (!version.includes('.')) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
8
19
|
const [major, minor, patch] = version
|
|
9
20
|
.split('.')
|
|
10
21
|
.map((v) => Number.parseInt(v, 10));
|
|
@@ -12,16 +23,30 @@ function extractVersion(version: string) {
|
|
|
12
23
|
return { major, minor, patch };
|
|
13
24
|
}
|
|
14
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Check that the plugin version matches the expected version.
|
|
28
|
+
* This is a helper function which only generates a warning if there is a mismatch.
|
|
29
|
+
*/
|
|
15
30
|
export function checkPluginVersion(context: InvenTreePluginContext) {
|
|
16
|
-
|
|
17
|
-
|
|
31
|
+
let pluginVersion: any = null;
|
|
32
|
+
let systemVersion: any = null;
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
pluginVersion = extractVersion(INVENTREE_PLUGIN_VERSION);
|
|
36
|
+
systemVersion = extractVersion(context.version.inventree);
|
|
37
|
+
} catch {
|
|
38
|
+
console.warn("Failed to extract plugin version information");
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
18
41
|
|
|
19
42
|
const mismatch = `Plugin version mismatch! Expected version ${INVENTREE_PLUGIN_VERSION}, got ${context.version}`;
|
|
20
43
|
|
|
21
|
-
|
|
22
|
-
|
|
44
|
+
if (!pluginVersion || !systemVersion) {
|
|
45
|
+
console.warn("Could not extract plugin version information");
|
|
46
|
+
} else if (pluginVersion.major !== systemVersion.major) {
|
|
47
|
+
// A major version mismatch indicates a potentially breaking change
|
|
23
48
|
console.warn(mismatch);
|
|
24
|
-
} else if (INVENTREE_PLUGIN_VERSION != context.version) {
|
|
49
|
+
} else if (INVENTREE_PLUGIN_VERSION != context.version.inventree) {
|
|
25
50
|
console.info(mismatch);
|
|
26
51
|
}
|
|
27
52
|
}
|
package/lib/index.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
// Constant value definitions
|
|
2
|
-
export {
|
|
2
|
+
export {
|
|
3
|
+
INVENTREE_PLUGIN_VERSION,
|
|
4
|
+
INVENTREE_REACT_VERSION,
|
|
5
|
+
INVENTREE_REACT_DOM_VERSION,
|
|
6
|
+
INVENTREE_MANTINE_VERSION
|
|
7
|
+
} from './types/Plugins';
|
|
3
8
|
|
|
4
9
|
// Common type definitions
|
|
5
10
|
export { ApiEndpoints } from './enums/ApiEndpoints';
|
package/lib/types/Auth.tsx
CHANGED
|
@@ -13,7 +13,8 @@ export enum FlowEnum {
|
|
|
13
13
|
ProviderToken = 'provider_token',
|
|
14
14
|
MfaAuthenticate = 'mfa_authenticate',
|
|
15
15
|
Reauthenticate = 'reauthenticate',
|
|
16
|
-
MfaReauthenticate = 'mfa_reauthenticate'
|
|
16
|
+
MfaReauthenticate = 'mfa_reauthenticate',
|
|
17
|
+
MfaTrust = 'mfa_trust'
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
export interface Flow {
|
package/lib/types/Forms.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DefaultMantineColor, MantineStyleProp } from '@mantine/core';
|
|
2
2
|
import type { UseFormReturnType } from '@mantine/form';
|
|
3
|
-
import type { ReactNode } from 'react';
|
|
4
|
-
import type { FieldValues } from 'react-hook-form';
|
|
3
|
+
import type { JSX, ReactNode } from 'react';
|
|
4
|
+
import type { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
5
5
|
import type { ApiEndpoints } from '../enums/ApiEndpoints';
|
|
6
6
|
import type { ModelType } from '../enums/ModelType';
|
|
7
7
|
import type { PathParams, UiSizeType } from './Core';
|
|
@@ -130,6 +130,7 @@ export type ApiFormFieldSet = Record<string, ApiFormFieldType>;
|
|
|
130
130
|
* @param onFormSuccess : A callback function to call when the form is submitted successfully.
|
|
131
131
|
* @param onFormError : A callback function to call when the form is submitted with errors.
|
|
132
132
|
* @param processFormData : A callback function to process the form data before submission
|
|
133
|
+
* @param checkClose: A callback function to check if the form can be closed after submission
|
|
133
134
|
* @param modelType : Define a model type for this form
|
|
134
135
|
* @param follow : Boolean, follow the result of the form (if possible)
|
|
135
136
|
* @param table : Table to update on success (if provided)
|
|
@@ -153,9 +154,10 @@ export interface ApiFormProps {
|
|
|
153
154
|
preFormSuccess?: string;
|
|
154
155
|
postFormContent?: JSX.Element;
|
|
155
156
|
successMessage?: string | null;
|
|
156
|
-
onFormSuccess?: (data: any) => void;
|
|
157
|
-
onFormError?: (response: any) => void;
|
|
158
|
-
processFormData?: (data: any) => any;
|
|
157
|
+
onFormSuccess?: (data: any, form: UseFormReturn) => void;
|
|
158
|
+
onFormError?: (response: any, form: UseFormReturn) => void;
|
|
159
|
+
processFormData?: (data: any, form: UseFormReturn) => any;
|
|
160
|
+
checkClose?: (data: any, form: UseFormReturn) => boolean;
|
|
159
161
|
table?: TableState;
|
|
160
162
|
modelType?: ModelType;
|
|
161
163
|
follow?: boolean;
|
package/lib/types/Plugins.tsx
CHANGED
|
@@ -14,6 +14,13 @@ export interface PluginProps {
|
|
|
14
14
|
version: null | string;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
export interface PluginVersion {
|
|
18
|
+
inventree: string;
|
|
19
|
+
react: string;
|
|
20
|
+
reactDom: string;
|
|
21
|
+
mantine: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
17
24
|
export type InvenTreeFormsContext = {
|
|
18
25
|
bulkEdit: (props: BulkEditApiFormModalProps) => UseModalReturn;
|
|
19
26
|
create: (props: ApiFormModalProps) => UseModalReturn;
|
|
@@ -43,7 +50,7 @@ export type InvenTreeFormsContext = {
|
|
|
43
50
|
* @param context - Any additional context data which may be passed to the plugin
|
|
44
51
|
*/
|
|
45
52
|
export type InvenTreePluginContext = {
|
|
46
|
-
version:
|
|
53
|
+
version: PluginVersion;
|
|
47
54
|
api: AxiosInstance;
|
|
48
55
|
queryClient: QueryClient;
|
|
49
56
|
user: UserStateProps;
|
|
@@ -70,3 +77,11 @@ export type InvenTreePluginContext = {
|
|
|
70
77
|
|
|
71
78
|
// @ts-ignore
|
|
72
79
|
export const INVENTREE_PLUGIN_VERSION: string = __INVENTREE_LIB_VERSION__;
|
|
80
|
+
// @ts-ignore
|
|
81
|
+
export const INVENTREE_REACT_VERSION: string = __INVENTREE_REACT_VERSION__;
|
|
82
|
+
// @ts-ignore
|
|
83
|
+
export const INVENTREE_REACT_DOM_VERSION: string =
|
|
84
|
+
// @ts-ignore
|
|
85
|
+
__INVENTREE_REACT_DOM_VERSION__;
|
|
86
|
+
// @ts-ignore
|
|
87
|
+
export const INVENTREE_MANTINE_VERSION: string = __INVENTREE_MANTINE_VERSION__;
|
package/lib/types/Settings.tsx
CHANGED
|
@@ -48,6 +48,7 @@ export interface SettingsStateProps {
|
|
|
48
48
|
settings: Setting[];
|
|
49
49
|
lookup: SettingsLookup;
|
|
50
50
|
fetchSettings: () => Promise<boolean>;
|
|
51
|
+
loaded: boolean;
|
|
51
52
|
endpoint: ApiEndpoints;
|
|
52
53
|
pathParams?: PathParams;
|
|
53
54
|
getSetting: (key: string, default_value?: string) => string; // Return a raw setting value
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inventreedb/ui",
|
|
3
3
|
"description": "UI components for the InvenTree project",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.9",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"react-window": "1.8.10",
|
|
102
102
|
"recharts": "^2.15.0",
|
|
103
103
|
"styled-components": "^6.1.14",
|
|
104
|
-
"zustand": "^
|
|
104
|
+
"zustand": "^5.0.3"
|
|
105
105
|
},
|
|
106
106
|
"devDependencies": {
|
|
107
107
|
"@babel/core": "^7.26.10",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"@babel/runtime": "^7.27.0",
|
|
111
111
|
"@codecov/vite-plugin": "^1.9.0",
|
|
112
112
|
"@lingui/babel-plugin-lingui-macro": "^5.3.0",
|
|
113
|
-
"@lingui/cli": "^5.3.
|
|
113
|
+
"@lingui/cli": "^5.3.1",
|
|
114
114
|
"@lingui/macro": "^5.3.0",
|
|
115
115
|
"@playwright/test": "^1.49.1",
|
|
116
116
|
"@types/node": "^22.13.14",
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"rollup": "^4.0.0",
|
|
129
129
|
"rollup-plugin-license": "^3.5.3",
|
|
130
130
|
"typescript": "^5.8.2",
|
|
131
|
-
"vite": "^6.2.
|
|
131
|
+
"vite": "^6.2.6",
|
|
132
132
|
"vite-plugin-babel-macros": "^1.0.6",
|
|
133
133
|
"vite-plugin-dts": "^4.5.3",
|
|
134
134
|
"vite-plugin-istanbul": "^6.0.2"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compileMessage.js","sources":["../../../../../node_modules/@lingui/message-utils/dist/compileMessage.mjs"],"sourcesContent":["import { parse } from '@messageformat/parser';\n\n/**\n * Parent class for errors.\n *\n * @remarks\n * Errors with `type: \"warning\"` do not necessarily indicate that the parser\n * encountered an error. In addition to a human-friendly `message`, may also\n * includes the `token` at which the error was encountered.\n *\n * @public\n */\nclass DateFormatError extends Error {\n /** @internal */\n constructor(msg, token, type) {\n super(msg);\n this.token = token;\n this.type = type || 'error';\n }\n}\nconst alpha = (width) => width < 4 ? 'short' : width === 4 ? 'long' : 'narrow';\nconst numeric = (width) => (width % 2 === 0 ? '2-digit' : 'numeric');\nfunction yearOptions(token, onError) {\n switch (token.char) {\n case 'y':\n return { year: numeric(token.width) };\n case 'r':\n return { calendar: 'gregory', year: 'numeric' };\n case 'u':\n case 'U':\n case 'Y':\n default:\n onError(`${token.desc} is not supported; falling back to year:numeric`, DateFormatError.WARNING);\n return { year: 'numeric' };\n }\n}\nfunction monthStyle(token, onError) {\n switch (token.width) {\n case 1:\n return 'numeric';\n case 2:\n return '2-digit';\n case 3:\n return 'short';\n case 4:\n return 'long';\n case 5:\n return 'narrow';\n default:\n onError(`${token.desc} is not supported with width ${token.width}`);\n return undefined;\n }\n}\nfunction dayStyle(token, onError) {\n const { char, desc, width } = token;\n if (char === 'd') {\n return numeric(width);\n }\n else {\n onError(`${desc} is not supported`);\n return undefined;\n }\n}\nfunction weekdayStyle(token, onError) {\n const { char, desc, width } = token;\n if ((char === 'c' || char === 'e') && width < 3) {\n // ignoring stand-alone-ness\n const msg = `Numeric value is not supported for ${desc}; falling back to weekday:short`;\n onError(msg, DateFormatError.WARNING);\n }\n // merging narrow styles\n return alpha(width);\n}\nfunction hourOptions(token) {\n const hour = numeric(token.width);\n let hourCycle;\n switch (token.char) {\n case 'h':\n hourCycle = 'h12';\n break;\n case 'H':\n hourCycle = 'h23';\n break;\n case 'k':\n hourCycle = 'h24';\n break;\n case 'K':\n hourCycle = 'h11';\n break;\n }\n return hourCycle ? { hour, hourCycle } : { hour };\n}\nfunction timeZoneNameStyle(token, onError) {\n // so much fallback behaviour here\n const { char, desc, width } = token;\n switch (char) {\n case 'v':\n case 'z':\n return width === 4 ? 'long' : 'short';\n case 'V':\n if (width === 4)\n return 'long';\n onError(`${desc} is not supported with width ${width}`);\n return undefined;\n case 'X':\n onError(`${desc} is not supported`);\n return undefined;\n }\n return 'short';\n}\nfunction compileOptions(token, onError) {\n switch (token.field) {\n case 'era':\n return { era: alpha(token.width) };\n case 'year':\n return yearOptions(token, onError);\n case 'month':\n return { month: monthStyle(token, onError) };\n case 'day':\n return { day: dayStyle(token, onError) };\n case 'weekday':\n return { weekday: weekdayStyle(token, onError) };\n case 'period':\n return undefined;\n case 'hour':\n return hourOptions(token);\n case 'min':\n return { minute: numeric(token.width) };\n case 'sec':\n return { second: numeric(token.width) };\n case 'tz':\n return { timeZoneName: timeZoneNameStyle(token, onError) };\n case 'quarter':\n case 'week':\n case 'sec-frac':\n case 'ms':\n onError(`${token.desc} is not supported`);\n }\n return undefined;\n}\nfunction getDateFormatOptions(tokens, timeZone, onError = error => {\n throw error;\n}) {\n const options = {\n timeZone\n };\n const fields = [];\n for (const token of tokens) {\n const { error, field, str } = token;\n if (error) {\n const dte = new DateFormatError(error.message, token);\n dte.stack = error.stack;\n onError(dte);\n }\n if (str) {\n const msg = `Ignoring string part: ${str}`;\n onError(new DateFormatError(msg, token, DateFormatError.WARNING));\n }\n if (field) {\n if (fields.indexOf(field) === -1)\n fields.push(field);\n else\n onError(new DateFormatError(`Duplicate ${field} token`, token));\n }\n const opt = compileOptions(token, (msg, isWarning) => onError(new DateFormatError(msg, token, isWarning)));\n if (opt)\n Object.assign(options, opt);\n }\n return options;\n}\n\nconst fields = {\n G: { field: 'era', desc: 'Era' },\n y: { field: 'year', desc: 'Year' },\n Y: { field: 'year', desc: 'Year of \"Week of Year\"' },\n u: { field: 'year', desc: 'Extended year' },\n U: { field: 'year', desc: 'Cyclic year name' },\n r: { field: 'year', desc: 'Related Gregorian year' },\n Q: { field: 'quarter', desc: 'Quarter' },\n q: { field: 'quarter', desc: 'Stand-alone quarter' },\n M: { field: 'month', desc: 'Month in year' },\n L: { field: 'month', desc: 'Stand-alone month in year' },\n w: { field: 'week', desc: 'Week of year' },\n W: { field: 'week', desc: 'Week of month' },\n d: { field: 'day', desc: 'Day in month' },\n D: { field: 'day', desc: 'Day of year' },\n F: { field: 'day', desc: 'Day of week in month' },\n g: { field: 'day', desc: 'Modified julian day' },\n E: { field: 'weekday', desc: 'Day of week' },\n e: { field: 'weekday', desc: 'Local day of week' },\n c: { field: 'weekday', desc: 'Stand-alone local day of week' },\n a: { field: 'period', desc: 'AM/PM marker' },\n b: { field: 'period', desc: 'AM/PM/noon/midnight marker' },\n B: { field: 'period', desc: 'Flexible day period' },\n h: { field: 'hour', desc: 'Hour in AM/PM (1~12)' },\n H: { field: 'hour', desc: 'Hour in day (0~23)' },\n k: { field: 'hour', desc: 'Hour in day (1~24)' },\n K: { field: 'hour', desc: 'Hour in AM/PM (0~11)' },\n j: { field: 'hour', desc: 'Hour in preferred cycle' },\n J: { field: 'hour', desc: 'Hour in preferred cycle without marker' },\n C: { field: 'hour', desc: 'Hour in preferred cycle with flexible marker' },\n m: { field: 'min', desc: 'Minute in hour' },\n s: { field: 'sec', desc: 'Second in minute' },\n S: { field: 'sec-frac', desc: 'Fractional second' },\n A: { field: 'ms', desc: 'Milliseconds in day' },\n z: { field: 'tz', desc: 'Time Zone: specific non-location' },\n Z: { field: 'tz', desc: 'Time Zone' },\n O: { field: 'tz', desc: 'Time Zone: localized' },\n v: { field: 'tz', desc: 'Time Zone: generic non-location' },\n V: { field: 'tz', desc: 'Time Zone: ID' },\n X: { field: 'tz', desc: 'Time Zone: ISO8601 with Z' },\n x: { field: 'tz', desc: 'Time Zone: ISO8601' }\n};\nconst isLetter = (char) => (char >= 'A' && char <= 'Z') || (char >= 'a' && char <= 'z');\nfunction readFieldToken(src, pos) {\n const char = src[pos];\n let width = 1;\n while (src[++pos] === char)\n ++width;\n const field = fields[char];\n if (!field) {\n const msg = `The letter ${char} is not a valid field identifier`;\n return { char, error: new Error(msg), width };\n }\n return { char, field: field.field, desc: field.desc, width };\n}\nfunction readQuotedToken(src, pos) {\n let str = src[++pos];\n let width = 2;\n if (str === \"'\")\n return { char: \"'\", str, width };\n while (true) {\n const next = src[++pos];\n ++width;\n if (next === undefined) {\n const msg = `Unterminated quoted literal in pattern: ${str || src}`;\n return { char: \"'\", error: new Error(msg), str, width };\n }\n else if (next === \"'\") {\n if (src[++pos] !== \"'\")\n return { char: \"'\", str, width };\n else\n ++width;\n }\n str += next;\n }\n}\nfunction readToken(src, pos) {\n const char = src[pos];\n if (!char)\n return null;\n if (isLetter(char))\n return readFieldToken(src, pos);\n if (char === \"'\")\n return readQuotedToken(src, pos);\n let str = char;\n let width = 1;\n while (true) {\n const next = src[++pos];\n if (!next || isLetter(next) || next === \"'\")\n return { char, str, width };\n str += next;\n width += 1;\n }\n}\n/**\n * Parse an {@link http://userguide.icu-project.org/formatparse/datetime | ICU\n * DateFormat skeleton} string into a {@link DateToken} array.\n *\n * @remarks\n * Errors will not be thrown, but if encountered are included as the relevant\n * token's `error` value.\n *\n * @public\n * @param src - The skeleton string\n *\n * @example\n * ```js\n * import { parseDateTokens } from '@messageformat/date-skeleton'\n *\n * parseDateTokens('GrMMMdd', console.error)\n * // [\n * // { char: 'G', field: 'era', desc: 'Era', width: 1 },\n * // { char: 'r', field: 'year', desc: 'Related Gregorian year', width: 1 },\n * // { char: 'M', field: 'month', desc: 'Month in year', width: 3 },\n * // { char: 'd', field: 'day', desc: 'Day in month', width: 2 }\n * // ]\n * ```\n */\nfunction parseDateTokens(src) {\n const tokens = [];\n let pos = 0;\n while (true) {\n const token = readToken(src, pos);\n if (!token)\n return tokens;\n tokens.push(token);\n pos += token.width;\n }\n}\n\nfunction processTokens(tokens, mapText) {\n if (!tokens.filter((token) => token.type !== \"content\").length) {\n return tokens.map((token) => mapText(token.value));\n }\n return tokens.map((token) => {\n if (token.type === \"content\") {\n return mapText(token.value);\n } else if (token.type === \"octothorpe\") {\n return \"#\";\n } else if (token.type === \"argument\") {\n return [token.arg];\n } else if (token.type === \"function\") {\n const _param = token?.param?.[0];\n if (token.key === \"date\" && _param) {\n const opts = compileDateExpression(_param.value.trim(), (e) => {\n throw new Error(`Unable to compile date expression: ${e.message}`);\n });\n return [token.arg, token.key, opts];\n }\n if (_param) {\n return [token.arg, token.key, _param.value.trim()];\n } else {\n return [token.arg, token.key];\n }\n }\n const offset = token.pluralOffset;\n const formatProps = {};\n token.cases.forEach(({ key, tokens: tokens2 }) => {\n const prop = key[0] === \"=\" ? key.slice(1) : key;\n formatProps[prop] = processTokens(tokens2, mapText);\n });\n return [\n token.arg,\n token.type,\n {\n offset,\n ...formatProps\n }\n ];\n });\n}\nfunction compileDateExpression(format, onError) {\n if (/^::/.test(format)) {\n const tokens = parseDateTokens(format.substring(2));\n return getDateFormatOptions(tokens, void 0, onError);\n }\n return format;\n}\nfunction compileMessageOrThrow(message, mapText = (v) => v) {\n return processTokens(parse(message), mapText);\n}\nfunction compileMessage(message, mapText = (v) => v) {\n try {\n return compileMessageOrThrow(message, mapText);\n } catch (e) {\n console.error(`${e.message} \n\nMessage: ${message}`);\n return [message];\n }\n}\n\nexport { comp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