@leaddreamer/inventorylogic 0.0.3-beta.81 → 0.0.3-beta.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +0 -648
  2. package/business/Product/GoogleMerchantAPI.js +0 -2
  3. package/business/Utilities/index.js +0 -3
  4. package/package.json +5 -16
  5. package/business/Utilities/other.js +0 -404
  6. package/business/Utilities/promise-queue/index.js +0 -264
  7. package/business/Utilities/promise-queue/new.js +0 -231
  8. package/business/Utilities/rate-limited-queue/index.js +0 -127
  9. package/dist/InventoryLogic.0ac93278.js +0 -35
  10. package/dist/InventoryLogic.0ac93278.js.map +0 -1
  11. package/dist/InventoryLogic.31f6d549.js +0 -152
  12. package/dist/InventoryLogic.31f6d549.js.map +0 -1
  13. package/dist/InventoryLogic.35827495.js +0 -285
  14. package/dist/InventoryLogic.35827495.js.map +0 -1
  15. package/dist/InventoryLogic.37dfff3e.js +0 -72
  16. package/dist/InventoryLogic.37dfff3e.js.map +0 -1
  17. package/dist/InventoryLogic.4206cb15.js +0 -213
  18. package/dist/InventoryLogic.4206cb15.js.map +0 -1
  19. package/dist/InventoryLogic.44193a77.js +0 -35
  20. package/dist/InventoryLogic.44193a77.js.map +0 -1
  21. package/dist/InventoryLogic.46ca6768.js +0 -131
  22. package/dist/InventoryLogic.46ca6768.js.map +0 -1
  23. package/dist/InventoryLogic.4d012935.js +0 -151
  24. package/dist/InventoryLogic.4d012935.js.map +0 -1
  25. package/dist/InventoryLogic.57f24f5f.js +0 -155
  26. package/dist/InventoryLogic.57f24f5f.js.map +0 -1
  27. package/dist/InventoryLogic.59be76a4.js +0 -184
  28. package/dist/InventoryLogic.59be76a4.js.map +0 -1
  29. package/dist/InventoryLogic.70925a32.js +0 -375
  30. package/dist/InventoryLogic.70925a32.js.map +0 -1
  31. package/dist/InventoryLogic.72fcf301.js +0 -6
  32. package/dist/InventoryLogic.72fcf301.js.map +0 -1
  33. package/dist/InventoryLogic.7741caec.js +0 -375
  34. package/dist/InventoryLogic.7741caec.js.map +0 -1
  35. package/dist/InventoryLogic.78480e5e.js +0 -152
  36. package/dist/InventoryLogic.78480e5e.js.map +0 -1
  37. package/dist/InventoryLogic.80d0e568.js +0 -135
  38. package/dist/InventoryLogic.80d0e568.js.map +0 -1
  39. package/dist/InventoryLogic.8a273d2e.js +0 -110
  40. package/dist/InventoryLogic.8a273d2e.js.map +0 -1
  41. package/dist/InventoryLogic.8addb055.js +0 -202
  42. package/dist/InventoryLogic.8addb055.js.map +0 -1
  43. package/dist/InventoryLogic.9dee46ea.js +0 -6
  44. package/dist/InventoryLogic.9dee46ea.js.map +0 -1
  45. package/dist/InventoryLogic.b90f66ea.js +0 -124
  46. package/dist/InventoryLogic.b90f66ea.js.map +0 -1
  47. package/dist/InventoryLogic.bb447b4c.js +0 -39
  48. package/dist/InventoryLogic.bb447b4c.js.map +0 -1
  49. package/dist/InventoryLogic.d27e84a7.js +0 -75
  50. package/dist/InventoryLogic.d27e84a7.js.map +0 -1
  51. package/dist/InventoryLogic.d69ad127.js +0 -217
  52. package/dist/InventoryLogic.d69ad127.js.map +0 -1
  53. package/dist/InventoryLogic.e03e6b07.js +0 -245
  54. package/dist/InventoryLogic.e03e6b07.js.map +0 -1
  55. package/dist/InventoryLogic.f276f76c.js +0 -213
  56. package/dist/InventoryLogic.f276f76c.js.map +0 -1
  57. package/dist/InventoryLogic.f4627c8a.js +0 -160
  58. package/dist/InventoryLogic.f4627c8a.js.map +0 -1
  59. package/dist/index.js +0 -23
  60. package/dist/index.js.map +0 -1
package/README.md CHANGED
@@ -74,10 +74,6 @@ users</p>
74
74
  <dd><p>Typedefs, constants, support functions and database operations related to usage Units
75
75
  and conversions</p>
76
76
  </dd>
77
- <dt><a href="#module_Utilities">Utilities</a></dt>
78
- <dd><p>Typedefs, constants, support functions and database operations for
79
- general Utilities</p>
80
- </dd>
81
77
  <dt><a href="#module_Boilerplate">Boilerplate</a></dt>
82
78
  <dd><p>Shared constants and symbols</p>
83
79
  </dd>
@@ -3710,495 +3706,6 @@ and conversions
3710
3706
  * [.saveForm(type)](#module_Utilities.saveForm) ⇒ <code>callback</code>
3711
3707
  * [.updateChangeForm(type)](#module_Utilities.updateChangeForm) ⇒ <code>callback</code>
3712
3708
  * [.choicesForm(fieldname)](#module_Utilities.choicesForm) ⇒ <code>object</code>
3713
- * [.saveHost(host)](#module_Utilities.saveHost) ⇒ <code>Promise.OrganizationType</code>
3714
- * [.simpleObjectCompare(object1, object2)](#module_Utilities.simpleObjectCompare) ⇒ <code>boolean</code>
3715
- * [.formatItem(thisItem, thisFormat)](#module_Utilities.formatItem) ⇒ <code>string</code>
3716
- * [.compare(thisItem, anotherItem, sort)](#module_Utilities.compare) ⇒ <code>string</code>
3717
- * [.anyInAny(findFrom, findIn)](#module_Utilities.anyInAny) ⇒ <code>boolean</code>
3718
- * [.lesserOf(args)](#module_Utilities.lesserOf) ⇒ <code>number</code>
3719
- * [.largerOf(args)](#module_Utilities.largerOf) ⇒ <code>number</code>
3720
- * [.archiveRecord(record)](#module_Utilities.archiveRecord) ⇒ <code>Promise</code>
3721
- * [.refPathToBaseRecord(refPath)](#module_Utilities.refPathToBaseRecord) ⇒ <code>RecordDocument</code>
3722
- * [.bound(value, lowerBound, upperBound)](#module_Utilities.bound) ⇒ <code>number</code>
3723
- * [.blindPush(targetArray, newObject)](#module_Utilities.blindPush)
3724
- * [.addToArrayObject(arrayObject, key, object)](#module_Utilities.addToArrayObject)
3725
- * [.makeHexAsNeeded(color)](#module_Utilities.makeHexAsNeeded) ⇒ <code>string</code>
3726
- * _inner_
3727
- * [~stripDocIdFromRefPath(refPath)](#module_Utilities..stripDocIdFromRefPath) ⇒ <code>string</code>
3728
- * [~UpdateChange
3729
- Function Signature for UpdateChange functions(prev, value, itemFor, fullChoiceObject)](#module_Utilities..UpdateChange
3730
- Function Signature for UpdateChange functions) ⇒ <code>object</code>
3731
-
3732
- <a name="module_Utilities.recordByIdAndType"></a>
3733
-
3734
- ### Utilities.recordByIdAndType ⇒ <code>AccountType</code>
3735
- creates and returns a minimal record from an Id and `type`
3736
-
3737
- **Kind**: static constant of [<code>Utilities</code>](#module_Utilities)
3738
-
3739
- | Param | Type |
3740
- | --- | --- |
3741
- | Id | <code>string</code> |
3742
- | Type | <code>string</code> |
3743
-
3744
- <a name="module_Utilities.fetchLinkedItem"></a>
3745
-
3746
- ### Utilities.fetchLinkedItem(type, link, refPath) ⇒ <code>Promise.RecordDocument</code>
3747
- used generic for constructing forms for input and display
3748
-
3749
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
3750
-
3751
- | Param | Type | Description |
3752
- | --- | --- | --- |
3753
- | type | <code>string</code> | refers to the sub-collection name |
3754
- | link | <code>string</code> | refers to the linking "value" - a documentID |
3755
- | refPath | <code>string</code> | optionally refers to the "/" separate path to the parent document in firebase |
3756
-
3757
- <a name="module_Utilities.fetchSubItem"></a>
3758
-
3759
- ### Utilities.fetchSubItem(type, refPath) ⇒ <code>Promise.RecordDocument</code>
3760
- some items are stored in the database as a single-record collection, using
3761
- the same Id as the parent
3762
-
3763
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
3764
-
3765
- | Param | Type | Description |
3766
- | --- | --- | --- |
3767
- | type | <code>string</code> | refers to the sub-collection name |
3768
- | refPath | <code>string</code> | refers to the "/" separate path to the required parent document in firebase |
3769
-
3770
- <a name="module_Utilities.fetchType"></a>
3771
-
3772
- ### Utilities.fetchType(type, refPath) ⇒ <code>Promise.Array.RecordDocument</code>
3773
- returns an entire sub-collection by "type" (sub-collection name).
3774
- If refpath is omitted, assumes "type" is a top-level collection
3775
-
3776
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
3777
-
3778
- | Param | Type | Description |
3779
- | --- | --- | --- |
3780
- | type | <code>string</code> | refers to the sub-collection name |
3781
- | refPath | <code>string</code> | optionally refers to the "/" separate path to the parent document in firebase |
3782
-
3783
- <a name="module_Utilities.searchType"></a>
3784
-
3785
- ### Utilities.searchType(type, parent, prompt, limit) ⇒ <code>Promise.Array.OrganizationType</code>
3786
- returns a Promise which resolves to an array of all Type's whose
3787
- name begins with the provided prompt, optionally limited to a provided number
3788
- CASE SENSITIVE FOR NOW
3789
-
3790
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
3791
-
3792
- | Param | Type | Description |
3793
- | --- | --- | --- |
3794
- | type | <code>string</code> | type of record to search |
3795
- | parent | <code>Record</code> | parent object of records, if any |
3796
- | prompt | <code>string</code> | Used to query for matching records |
3797
- | limit | <code>string</code> \| <code>number</code> | Used to limit the number of results |
3798
-
3799
- <a name="module_Utilities.typedRecordFromChild"></a>
3800
-
3801
- ### Utilities.typedRecordFromChild(type, child) ⇒ <code>Record</code>
3802
- builds a representation of a parent from a child, by type
3803
-
3804
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
3805
-
3806
- | Param | Type |
3807
- | --- | --- |
3808
- | type | <code>string</code> |
3809
- | child | <code>Record</code> |
3810
-
3811
- <a name="module_Utilities.typedSortArray"></a>
3812
-
3813
- ### Utilities.typedSortArray(type) ⇒ <code>Array.SortObject</code>
3814
- Firebase query support - builds default sort options
3815
-
3816
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
3817
-
3818
- | Param | Type |
3819
- | --- | --- |
3820
- | type | <code>string</code> |
3821
-
3822
- <a name="module_Utilities.processItemType"></a>
3823
-
3824
- ### Utilities.processItemType(item, type, refPath) ⇒ <code>Promise.RecordDocument</code>
3825
- generic form data processing for database by "type" (collection name)
3826
-
3827
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
3828
-
3829
- | Param | Type | Description |
3830
- | --- | --- | --- |
3831
- | item | <code>RecordDocument</code> | |
3832
- | type | <code>string</code> | refers to the sub-collection name |
3833
- | refPath | <code>string</code> | optionally refers to the "/" separate path to the parent document in firebase |
3834
-
3835
- <a name="module_Utilities.formatLinkedItem"></a>
3836
-
3837
- ### Utilities.formatLinkedItem(link, type, refPath) ⇒ <code>Promise.string</code>
3838
- fetches a sub-record from the database and returns the result as a summary string
3839
-
3840
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
3841
-
3842
- | Param | Type | Description |
3843
- | --- | --- | --- |
3844
- | link | <code>string</code> | refers to the linking "value" - a documentID |
3845
- | type | <code>string</code> | refers to the sub-collection name |
3846
- | refPath | <code>string</code> | refers to the "/" separate path to the required parent document in firebase |
3847
-
3848
- <a name="module_Utilities.summarizeItem"></a>
3849
-
3850
- ### Utilities.summarizeItem(item, type) ⇒ <code>string</code>
3851
- parameterized function to return string summary of an object
3852
- By default, returns the "name" property of the item.
3853
-
3854
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
3855
-
3856
- | Param | Type | Description |
3857
- | --- | --- | --- |
3858
- | item | <code>object</code> | data object to summarize |
3859
- | type | <code>String</code> \| <code>&quot;User&quot;</code> \| <code>&quot;Product&quot;</code> \| <code>&quot;LineItem&quot;</code> \| <code>&quot;Commodities&quot;</code> \| <code>&quot;Units&quot;</code> | - type of the object to summarize |
3860
-
3861
- <a name="module_Utilities.baseItem"></a>
3862
-
3863
- ### Utilities.baseItem(type) ⇒ <code>object</code>
3864
- Convenience function to mask actual Forms array from the front-end
3865
- This version returns the "base" item sample for a business-object type,
3866
- where the keys are the field/property names, and the values are the
3867
- default values as defined in the business logic
3868
-
3869
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
3870
- **Returns**: <code>object</code> - keys and default values
3871
-
3872
- | Param | Type |
3873
- | --- | --- |
3874
- | type | <code>string</code> |
3875
-
3876
- <a name="module_Utilities.baseForm"></a>
3877
-
3878
- ### Utilities.baseForm(type) ⇒ <code>object</code>
3879
- Convenience function to mask actual Forms array from the front-end
3880
- This version returns the "baseForm" withe keys/properties, and
3881
- values are strings with ":" separated definitions for EditForm and
3882
- similar functionality - see "EditForm" for more details
3883
-
3884
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
3885
- **Returns**: <code>object</code> - keys and default values
3886
-
3887
- | Param | Type |
3888
- | --- | --- |
3889
- | type | <code>string</code> |
3890
-
3891
- <a name="module_Utilities.dataForm"></a>
3892
-
3893
- ### Utilities.dataForm(type) ⇒ <code>object</code>
3894
- Convenience function to mask actual Forms array from the front-end
3895
- This version returns the "Data" object with keys/properties, and
3896
- values are strings with ":" separated definitions for Faker and
3897
- similar functionality - to generate "fake" simulated data for testing
3898
-
3899
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
3900
- **Returns**: <code>object</code> - keys and default values
3901
-
3902
- | Param | Type |
3903
- | --- | --- |
3904
- | type | <code>string</code> |
3905
-
3906
- <a name="module_Utilities.createForm"></a>
3907
-
3908
- ### Utilities.createForm(type) ⇒ <code>object</code>
3909
- Convenience function to mask actual Forms array from the front-end
3910
- This version returns the "createForm" withe keys/properties, and
3911
- values are strings with ":" separated definitions for EditForm and
3912
- similar functionality - see "EditForm" for more details
3913
- Specifically for limited "front-end" use to CREATE new
3914
- business-objects with the minimum entries necessary
3915
-
3916
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
3917
- **Returns**: <code>object</code> - keys and default values
3918
-
3919
- | Param | Type |
3920
- | --- | --- |
3921
- | type | <code>string</code> |
3922
-
3923
- <a name="module_Utilities.accountForm"></a>
3924
-
3925
- ### Utilities.accountForm(type) ⇒ <code>object</code>
3926
- Convenience function to mask actual Forms array from the front-end
3927
- This version returns the "createForm" withe keys/properties, and
3928
- values are strings with ":" separated definitions for EditForm and
3929
- similar functionality - see "EditForm" for more details
3930
- Specifically for limited "front-end" use on ACCOUNT business-objects
3931
- with the minimum entries necessary
3932
-
3933
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
3934
- **Returns**: <code>object</code> - keys and default values
3935
-
3936
- | Param | Type |
3937
- | --- | --- |
3938
- | type | <code>string</code> |
3939
-
3940
- <a name="module_Utilities.saveForm"></a>
3941
-
3942
- ### Utilities.saveForm(type) ⇒ <code>callback</code>
3943
- Convenience function to mask actual Forms array from the front-end
3944
- This version returns a FUNCTION to use for saving a business-object
3945
- to the database - abstracting type-specific features and functionality
3946
- from the front end
3947
-
3948
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
3949
-
3950
- | Param | Type |
3951
- | --- | --- |
3952
- | type | <code>string</code> |
3953
-
3954
- <a name="module_Utilities.updateChangeForm"></a>
3955
-
3956
- ### Utilities.updateChangeForm(type) ⇒ <code>callback</code>
3957
- Convenience function to mask actual Forms array from the front-end
3958
- This version returns a FUNCTION to respond to cross-field dependent
3959
- chnages during editing with EditForm, reactdatagrid, etc
3960
-
3961
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
3962
-
3963
- | Param | Type |
3964
- | --- | --- |
3965
- | type | <code>string</code> |
3966
-
3967
- <a name="module_Utilities.choicesForm"></a>
3968
-
3969
- ### Utilities.choicesForm(fieldname) ⇒ <code>object</code>
3970
- Returns an object whose keys are the available choices for a
3971
- business-object field, and whose values represent the sort order
3972
- Most fieldname have no such choices. Both the definitions and
3973
- usage are defined in business logic elsewhere
3974
-
3975
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
3976
-
3977
- | Param | Type | Description |
3978
- | --- | --- | --- |
3979
- | fieldname | <code>string</code> | which business type is being processes |
3980
-
3981
- <a name="module_Utilities.saveHost"></a>
3982
-
3983
- ### Utilities.saveHost(host) ⇒ <code>Promise.OrganizationType</code>
3984
- A convenience function for some shared artist/host front-end pages
3985
-
3986
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
3987
-
3988
- | Param | Type |
3989
- | --- | --- |
3990
- | host | <code>OrganizationType</code> |
3991
-
3992
- <a name="module_Utilities.simpleObjectCompare"></a>
3993
-
3994
- ### Utilities.simpleObjectCompare(object1, object2) ⇒ <code>boolean</code>
3995
- Simple top-level object compare - assumes objects have similar structure - or
3996
- AT LEAST all the fields of object1 are present in object2
3997
-
3998
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
3999
-
4000
- | Param | Type |
4001
- | --- | --- |
4002
- | object1 | <code>object</code> |
4003
- | object2 | <code>object</code> |
4004
-
4005
- <a name="module_Utilities.formatItem"></a>
4006
-
4007
- ### Utilities.formatItem(thisItem, thisFormat) ⇒ <code>string</code>
4008
- Allows string substitution from an object
4009
- field names support Dot notation
4010
- field names allow ":" extension for alternate formatting
4011
-
4012
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
4013
-
4014
- | Param | Type | Description |
4015
- | --- | --- | --- |
4016
- | thisItem | <code>object</code> | object to create formated string from |
4017
- | thisFormat | <code>string</code> | string describing formatted output - fieldname wrapped in {} will be substituted. DOT notation allowed for fields. |
4018
-
4019
- <a name="module_Utilities.compare"></a>
4020
-
4021
- ### Utilities.compare(thisItem, anotherItem, sort) ⇒ <code>string</code>
4022
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
4023
-
4024
- | Param | Type | Description |
4025
- | --- | --- | --- |
4026
- | thisItem | <code>object</code> | one of two objects being compared |
4027
- | anotherItem | <code>object</code> | the other of two objects being compared |
4028
- | sort | <code>string</code> | string describing sort - format "fieldName:sortType" - sort Type is "string, "date" or "number" (default) |
4029
-
4030
- <a name="module_Utilities.anyInAny"></a>
4031
-
4032
- ### Utilities.anyInAny(findFrom, findIn) ⇒ <code>boolean</code>
4033
- An array based compare function - is any entry of findFrom present in findIn
4034
-
4035
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
4036
-
4037
- | Param | Type |
4038
- | --- | --- |
4039
- | findFrom | <code>Array.any</code> |
4040
- | findIn | <code>Array.any</code> |
4041
-
4042
- <a name="module_Utilities.lesserOf"></a>
4043
-
4044
- ### Utilities.lesserOf(args) ⇒ <code>number</code>
4045
- A convenience function for legibility
4046
-
4047
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
4048
- **Returns**: <code>number</code> - the least of any of the arguments
4049
- b
4050
-
4051
- | Param | Type | Description |
4052
- | --- | --- | --- |
4053
- | args | <code>any</code> | unbounded list of arguments |
4054
-
4055
- <a name="module_Utilities.largerOf"></a>
4056
-
4057
- ### Utilities.largerOf(args) ⇒ <code>number</code>
4058
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
4059
- **Returns**: <code>number</code> - the largest of any of the arguments
4060
-
4061
- | Param | Type | Description |
4062
- | --- | --- | --- |
4063
- | args | <code>any</code> | unbounded list of arguments |
4064
-
4065
- <a name="module_Utilities.archiveRecord"></a>
4066
-
4067
- ### Utilities.archiveRecord(record) ⇒ <code>Promise</code>
4068
- "Moves" a record from our standard tree structureto a parallel archival
4069
- structure, by prepending a "_" to the collection names in the path
4070
- This prevents the archived record from appearing in collectionGroup queries
4071
-
4072
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
4073
-
4074
- | Param | Type |
4075
- | --- | --- |
4076
- | record | <code>RecordDocument</code> |
4077
- | record.refPath | <code>string</code> |
4078
-
4079
- <a name="module_Utilities.refPathToBaseRecord"></a>
4080
-
4081
- ### Utilities.refPathToBaseRecord(refPath) ⇒ <code>RecordDocument</code>
4082
- uses a passed refPath to create the most basic document record form
4083
-
4084
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
4085
-
4086
- | Param | Type | Description |
4087
- | --- | --- | --- |
4088
- | refPath | <code>string</code> | "/" separated document path reference |
4089
-
4090
- <a name="module_Utilities.bound"></a>
4091
-
4092
- ### Utilities.bound(value, lowerBound, upperBound) ⇒ <code>number</code>
4093
- clips value to given bounds
4094
-
4095
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
4096
-
4097
- | Param | Type |
4098
- | --- | --- |
4099
- | value | <code>number</code> |
4100
- | lowerBound | <code>number</code> |
4101
- | upperBound | <code>number</code> |
4102
-
4103
- <a name="module_Utilities.blindPush"></a>
4104
-
4105
- ### Utilities.blindPush(targetArray, newObject)
4106
- function to push an element to an array which may not be initialized
4107
-
4108
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
4109
-
4110
- | Param | Type |
4111
- | --- | --- |
4112
- | targetArray | <code>Array.object</code> |
4113
- | newObject | <code>object</code> |
4114
-
4115
- <a name="module_Utilities.addToArrayObject"></a>
4116
-
4117
- ### Utilities.addToArrayObject(arrayObject, key, object)
4118
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
4119
-
4120
- | Param | Type | Description |
4121
- | --- | --- | --- |
4122
- | arrayObject | <code>Array.Array.object</code> | |
4123
- | key | <code>string</code> | key or index to choose which Array.object to add *this* object to |
4124
- | object | <code>object</code> | |
4125
-
4126
- <a name="module_Utilities.makeHexAsNeeded"></a>
4127
-
4128
- ### Utilities.makeHexAsNeeded(color) ⇒ <code>string</code>
4129
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
4130
- **Returns**: <code>string</code> - hex value of named color
4131
-
4132
- | Param | Type | Description |
4133
- | --- | --- | --- |
4134
- | color | <code>string</code> | name of color |
4135
-
4136
- <a name="module_Utilities..stripDocIdFromRefPath"></a>
4137
-
4138
- ### Utilities~stripDocIdFromRefPath(refPath) ⇒ <code>string</code>
4139
- pulls the document Id from a passed refPath string (firebase dependent)
4140
-
4141
- **Kind**: inner method of [<code>Utilities</code>](#module_Utilities)
4142
- **Returns**: <code>string</code> - Id
4143
-
4144
- | Param | Type |
4145
- | --- | --- |
4146
- | refPath | <code>string</code> |
4147
-
4148
- <a name="module_Utilities..UpdateChange
4149
- Function Signature for UpdateChange functions"></a>
4150
-
4151
- ### Utilities~UpdateChange
4152
- Function Signature for UpdateChange functions(prev, value, itemFor, fullChoiceObject) ⇒ <code>object</code>
4153
- **Kind**: inner method of [<code>Utilities</code>](#module_Utilities)
4154
-
4155
- | Param | Type |
4156
- | --- | --- |
4157
- | prev | <code>object</code> |
4158
- | value | <code>object</code> |
4159
- | itemFor | <code>string</code> |
4160
- | fullChoiceObject | <code>object</code> |
4161
-
4162
- <a name="module_Utilities"></a>
4163
-
4164
- ## Utilities
4165
- Typedefs, constants, support functions and database operations for
4166
- general Utilities
4167
-
4168
-
4169
- * [Utilities](#module_Utilities)
4170
- * _static_
4171
- * [.recordByIdAndType](#module_Utilities.recordByIdAndType) ⇒ <code>AccountType</code>
4172
- * [.fetchLinkedItem(type, link, refPath)](#module_Utilities.fetchLinkedItem) ⇒ <code>Promise.RecordDocument</code>
4173
- * [.fetchSubItem(type, refPath)](#module_Utilities.fetchSubItem) ⇒ <code>Promise.RecordDocument</code>
4174
- * [.fetchType(type, refPath)](#module_Utilities.fetchType) ⇒ <code>Promise.Array.RecordDocument</code>
4175
- * [.searchType(type, parent, prompt, limit)](#module_Utilities.searchType) ⇒ <code>Promise.Array.OrganizationType</code>
4176
- * [.typedRecordFromChild(type, child)](#module_Utilities.typedRecordFromChild) ⇒ <code>Record</code>
4177
- * [.typedSortArray(type)](#module_Utilities.typedSortArray) ⇒ <code>Array.SortObject</code>
4178
- * [.processItemType(item, type, refPath)](#module_Utilities.processItemType) ⇒ <code>Promise.RecordDocument</code>
4179
- * [.formatLinkedItem(link, type, refPath)](#module_Utilities.formatLinkedItem) ⇒ <code>Promise.string</code>
4180
- * [.summarizeItem(item, type)](#module_Utilities.summarizeItem) ⇒ <code>string</code>
4181
- * [.baseItem(type)](#module_Utilities.baseItem) ⇒ <code>object</code>
4182
- * [.baseForm(type)](#module_Utilities.baseForm) ⇒ <code>object</code>
4183
- * [.dataForm(type)](#module_Utilities.dataForm) ⇒ <code>object</code>
4184
- * [.createForm(type)](#module_Utilities.createForm) ⇒ <code>object</code>
4185
- * [.accountForm(type)](#module_Utilities.accountForm) ⇒ <code>object</code>
4186
- * [.saveForm(type)](#module_Utilities.saveForm) ⇒ <code>callback</code>
4187
- * [.updateChangeForm(type)](#module_Utilities.updateChangeForm) ⇒ <code>callback</code>
4188
- * [.choicesForm(fieldname)](#module_Utilities.choicesForm) ⇒ <code>object</code>
4189
- * [.saveHost(host)](#module_Utilities.saveHost) ⇒ <code>Promise.OrganizationType</code>
4190
- * [.simpleObjectCompare(object1, object2)](#module_Utilities.simpleObjectCompare) ⇒ <code>boolean</code>
4191
- * [.formatItem(thisItem, thisFormat)](#module_Utilities.formatItem) ⇒ <code>string</code>
4192
- * [.compare(thisItem, anotherItem, sort)](#module_Utilities.compare) ⇒ <code>string</code>
4193
- * [.anyInAny(findFrom, findIn)](#module_Utilities.anyInAny) ⇒ <code>boolean</code>
4194
- * [.lesserOf(args)](#module_Utilities.lesserOf) ⇒ <code>number</code>
4195
- * [.largerOf(args)](#module_Utilities.largerOf) ⇒ <code>number</code>
4196
- * [.archiveRecord(record)](#module_Utilities.archiveRecord) ⇒ <code>Promise</code>
4197
- * [.refPathToBaseRecord(refPath)](#module_Utilities.refPathToBaseRecord) ⇒ <code>RecordDocument</code>
4198
- * [.bound(value, lowerBound, upperBound)](#module_Utilities.bound) ⇒ <code>number</code>
4199
- * [.blindPush(targetArray, newObject)](#module_Utilities.blindPush)
4200
- * [.addToArrayObject(arrayObject, key, object)](#module_Utilities.addToArrayObject)
4201
- * [.makeHexAsNeeded(color)](#module_Utilities.makeHexAsNeeded) ⇒ <code>string</code>
4202
3709
  * _inner_
4203
3710
  * [~stripDocIdFromRefPath(refPath)](#module_Utilities..stripDocIdFromRefPath) ⇒ <code>string</code>
4204
3711
  * [~UpdateChange
@@ -4454,161 +3961,6 @@ usage are defined in business logic elsewhere
4454
3961
  | --- | --- | --- |
4455
3962
  | fieldname | <code>string</code> | which business type is being processes |
4456
3963
 
4457
- <a name="module_Utilities.saveHost"></a>
4458
-
4459
- ### Utilities.saveHost(host) ⇒ <code>Promise.OrganizationType</code>
4460
- A convenience function for some shared artist/host front-end pages
4461
-
4462
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
4463
-
4464
- | Param | Type |
4465
- | --- | --- |
4466
- | host | <code>OrganizationType</code> |
4467
-
4468
- <a name="module_Utilities.simpleObjectCompare"></a>
4469
-
4470
- ### Utilities.simpleObjectCompare(object1, object2) ⇒ <code>boolean</code>
4471
- Simple top-level object compare - assumes objects have similar structure - or
4472
- AT LEAST all the fields of object1 are present in object2
4473
-
4474
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
4475
-
4476
- | Param | Type |
4477
- | --- | --- |
4478
- | object1 | <code>object</code> |
4479
- | object2 | <code>object</code> |
4480
-
4481
- <a name="module_Utilities.formatItem"></a>
4482
-
4483
- ### Utilities.formatItem(thisItem, thisFormat) ⇒ <code>string</code>
4484
- Allows string substitution from an object
4485
- field names support Dot notation
4486
- field names allow ":" extension for alternate formatting
4487
-
4488
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
4489
-
4490
- | Param | Type | Description |
4491
- | --- | --- | --- |
4492
- | thisItem | <code>object</code> | object to create formated string from |
4493
- | thisFormat | <code>string</code> | string describing formatted output - fieldname wrapped in {} will be substituted. DOT notation allowed for fields. |
4494
-
4495
- <a name="module_Utilities.compare"></a>
4496
-
4497
- ### Utilities.compare(thisItem, anotherItem, sort) ⇒ <code>string</code>
4498
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
4499
-
4500
- | Param | Type | Description |
4501
- | --- | --- | --- |
4502
- | thisItem | <code>object</code> | one of two objects being compared |
4503
- | anotherItem | <code>object</code> | the other of two objects being compared |
4504
- | sort | <code>string</code> | string describing sort - format "fieldName:sortType" - sort Type is "string, "date" or "number" (default) |
4505
-
4506
- <a name="module_Utilities.anyInAny"></a>
4507
-
4508
- ### Utilities.anyInAny(findFrom, findIn) ⇒ <code>boolean</code>
4509
- An array based compare function - is any entry of findFrom present in findIn
4510
-
4511
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
4512
-
4513
- | Param | Type |
4514
- | --- | --- |
4515
- | findFrom | <code>Array.any</code> |
4516
- | findIn | <code>Array.any</code> |
4517
-
4518
- <a name="module_Utilities.lesserOf"></a>
4519
-
4520
- ### Utilities.lesserOf(args) ⇒ <code>number</code>
4521
- A convenience function for legibility
4522
-
4523
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
4524
- **Returns**: <code>number</code> - the least of any of the arguments
4525
- b
4526
-
4527
- | Param | Type | Description |
4528
- | --- | --- | --- |
4529
- | args | <code>any</code> | unbounded list of arguments |
4530
-
4531
- <a name="module_Utilities.largerOf"></a>
4532
-
4533
- ### Utilities.largerOf(args) ⇒ <code>number</code>
4534
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
4535
- **Returns**: <code>number</code> - the largest of any of the arguments
4536
-
4537
- | Param | Type | Description |
4538
- | --- | --- | --- |
4539
- | args | <code>any</code> | unbounded list of arguments |
4540
-
4541
- <a name="module_Utilities.archiveRecord"></a>
4542
-
4543
- ### Utilities.archiveRecord(record) ⇒ <code>Promise</code>
4544
- "Moves" a record from our standard tree structureto a parallel archival
4545
- structure, by prepending a "_" to the collection names in the path
4546
- This prevents the archived record from appearing in collectionGroup queries
4547
-
4548
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
4549
-
4550
- | Param | Type |
4551
- | --- | --- |
4552
- | record | <code>RecordDocument</code> |
4553
- | record.refPath | <code>string</code> |
4554
-
4555
- <a name="module_Utilities.refPathToBaseRecord"></a>
4556
-
4557
- ### Utilities.refPathToBaseRecord(refPath) ⇒ <code>RecordDocument</code>
4558
- uses a passed refPath to create the most basic document record form
4559
-
4560
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
4561
-
4562
- | Param | Type | Description |
4563
- | --- | --- | --- |
4564
- | refPath | <code>string</code> | "/" separated document path reference |
4565
-
4566
- <a name="module_Utilities.bound"></a>
4567
-
4568
- ### Utilities.bound(value, lowerBound, upperBound) ⇒ <code>number</code>
4569
- clips value to given bounds
4570
-
4571
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
4572
-
4573
- | Param | Type |
4574
- | --- | --- |
4575
- | value | <code>number</code> |
4576
- | lowerBound | <code>number</code> |
4577
- | upperBound | <code>number</code> |
4578
-
4579
- <a name="module_Utilities.blindPush"></a>
4580
-
4581
- ### Utilities.blindPush(targetArray, newObject)
4582
- function to push an element to an array which may not be initialized
4583
-
4584
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
4585
-
4586
- | Param | Type |
4587
- | --- | --- |
4588
- | targetArray | <code>Array.object</code> |
4589
- | newObject | <code>object</code> |
4590
-
4591
- <a name="module_Utilities.addToArrayObject"></a>
4592
-
4593
- ### Utilities.addToArrayObject(arrayObject, key, object)
4594
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
4595
-
4596
- | Param | Type | Description |
4597
- | --- | --- | --- |
4598
- | arrayObject | <code>Array.Array.object</code> | |
4599
- | key | <code>string</code> | key or index to choose which Array.object to add *this* object to |
4600
- | object | <code>object</code> | |
4601
-
4602
- <a name="module_Utilities.makeHexAsNeeded"></a>
4603
-
4604
- ### Utilities.makeHexAsNeeded(color) ⇒ <code>string</code>
4605
- **Kind**: static method of [<code>Utilities</code>](#module_Utilities)
4606
- **Returns**: <code>string</code> - hex value of named color
4607
-
4608
- | Param | Type | Description |
4609
- | --- | --- | --- |
4610
- | color | <code>string</code> | name of color |
4611
-
4612
3964
  <a name="module_Utilities..stripDocIdFromRefPath"></a>
4613
3965
 
4614
3966
  ### Utilities~stripDocIdFromRefPath(refPath) ⇒ <code>string</code>
@@ -5,8 +5,6 @@
5
5
  //////////////////////////////////////////////////////////////////////
6
6
  // Constants
7
7
 
8
- import { index, string } from "mathjs";
9
-
10
8
  /**
11
9
  * @typedef {string} SKU
12
10
  */
@@ -334,6 +334,3 @@ export function choicesForm(fieldname) {
334
334
  ? Forms.Choices[fieldname]
335
335
  : {};
336
336
  }
337
-
338
- export * from "./other.js";
339
- export * from "./promise-queue/index.js";