@olympeio/runtime-node 9.12.0 → 9.12.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"rootTag":"100000000000000000dd","operations":[{"o":1,"t":"100000000000000000dd","p":{"017869c7d2833c9492c1":"@olympeio/runtime","017869c80bb9929c76d0":"9.12.
|
|
1
|
+
{"rootTag":"100000000000000000dd","operations":[{"o":1,"t":"100000000000000000dd","p":{"017869c7d2833c9492c1":"@olympeio/runtime","017869c80bb9929c76d0":"9.12.1","ff023000000000000011":"Primordial"}},{"o":1,"t":"00000000000000000060","p":{"ff023000000000000011":"Embedded Graph Database","ff023000000000000060":true,"ff023000000000000063":"hybrid","ff023000000000000065":false}}],"optionalOperations":[{"o":1,"t":"10000000000000000001","p":{"ff023000000000000011":"Olympe Libraries"}},{"o":1,"t":"10000000000000000002","p":{"ff023000000000000011":"Internal"}},{"o":1,"t":"10000000000000000000","p":{"ff023000000000000011":"Home"}}]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"rootTag":"100000000000000000dd","operations":[{"o":2,"t":"014831d95fd7d12b8568","p":{"ff023000000000000001":"admin","ff023000000000000004":"
|
|
1
|
+
{"rootTag":"100000000000000000dd","operations":[{"o":2,"t":"014831d95fd7d12b8568","p":{"ff023000000000000001":"admin","ff023000000000000004":"d841c359f69aba20c1f4a11abe5bab297444b761e077c9b7dc2bb9815b5b54bd","ff023000000000000005":"68c7af7d05392ee3e93e13dc7e654b878667ec97776729b452466b3e5041daffc4dc9c906335959fe5c81132fc5a8f3dd762435a4022ba95b41bc1cee563c499159a8cdba1e9b895fda67f03297d6130755b85c08508768e5fa257e658adc9690e7dd4e56200d603b3d1f661d1b1cca689ffcec5846074dfd866a8f0c1578a1018bc066ced29d8f6f072c92aa50f319d41e423f7a1a22be8a2a34b272adcdce640a7cb4f3a7d0b61e28a8693cc77015613e91d4d0151b36ddeb1a6755b84c6ab5fdcb9f1263d1592be57565657eda8cf28e3b462f815fefc5d543b2b50e6aeec49c07c417a5302e4179b526c85de5e007cbe4145b4350805d9fadc19e71b137f"}},{"o":2,"t":"0163d9653067b6237f62","p":{"ff023000000000000001":"guest","ff023000000000000004":"bbd92d4cc49c43349a6e6dff7b722ed2d0ee48d3c39221e8692ae61e77d01359","ff023000000000000005":"927eddd7d631e635069212ac68118ddcb3ec0ab597de64b099a92b21e468bbc8fddb028290f0193645704df1a9f00f9c10e11843cfbf28d801530c4415e6f3a04b98d0af48dc1f1abe7ab2f3a29632b5822bfcb7a0b8fdbbca93ee939f08c503de96de104672a482a3e113330a29e14b5479f43a2dae59865c33434a505ec8392918b11f3c120dd4409ba25fa8d51518433e8a2fcae4311665c866f66c1af1436647633b7e4bc73d0ef1a6b9ad966ee122352e17a0757de95155723118de15379c1a084cb70e46630071f475b7cee583c63b546b24013ef539319111a97aee6501cebb037a2c9263d14a0534691741ce0287918804fd3bf23fe78e586dcd9953"}}],"optionalOperations":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"rootTag":"100000000000000000dd","operations":[{"o":1,"t":"017a7a9ff057958e5678","p":{"ff023000000000000011":"Enums"}},{"o":1,"t":"017a7a9ff058958e5678","p":{"01703376c4a81c0e9d91":"Allows defining one or more enums.","01703376c4a81c0e9d92":"An enum is an ordered list of entries, with a `Value` and a `Display Name`. The `Value` is the actual value being used within dataflows, while the `Display Name` is the text displayed in DRAW.<br/><br/>Enums are treated as *types* within Olympe, and they can therefore be used in various places:\n- In Functions and Actions, as types of inputs and outputs\n- In Visual Components, as types of properties\n- In Data Models, as types of properties within Data Types\n\n"}},{"o":1,"t":"016cdd861b32d56c8208","p":{"ff023000000000000011":"Enum Item"}},{"o":1,"t":"01645fe6873aeea59e64","p":{"ff023000000000000011":"Config Data Set"}},{"o":1,"t":"017ed8ac775f48d4d589","p":{"ff023000000000000011":"dataRel","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":0,"ff023000000000000037":2,"ff023000000000000137":6,"ff023000000000000237":0,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":0}},{"o":1,"t":"01645fe6873beea59e64","p":{"01703376c4a81c0e9d91":"Set of Config Data Type instances.","01703376c4a81c0e9d92":"Config Data Sets are used to create instances of Config Data Types.\nThey are typically used to create sets of data that can be used by your application as configuration, a bit like enums, with custom properties.<br/><br/>Since that data is part of the definition of applications, it cannot be updated by applications at runtime.\nCompared to instances of regular Data Types, which are created and modified by users at runtime, records inside Config Data Sets are saved during the export of the project, as part of the application data."}},{"o":1,"t":"016324fde11a836f77d3","p":{"ff023000000000000011":"Config Data Type"}},{"o":1,"t":"016324fde11a836088d3","p":{"ff023000000000000011":"Config Data Type -> Project","ff023000000000000030":610,"ff023000000000000031":96,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":5,"ff023000000000000237":8,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":0}},{"o":1,"t":"016324fde11b836f77d3","p":{"01703376c4a81c0e9d91":"A data structure to be used as configuration within bricks and applications.","01703376c4a81c0e9d92":"A Config Data Type let you specify a complex data structure which contains a number of properties an relations.\nThis is very similar to the concept of 'Class' in object-oriented programming languages.\nCompare to regular Data Types, a Config Data Type is defined in a *Config Data Model*, and it must be instantiated in a *Config Data Set*."}},{"o":1,"t":"0163a68ce44f3d1fa95d","p":{"ff023000000000000011":"Config Data Model"}},{"o":1,"t":"0163a68ce4503d1fa95d","p":{"01703376c4a81c0e9d91":"Defines Config Data Types and their relations.","01703376c4a81c0e9d92":"A Config Data Model is where you define the data structures called *Config Data Types*, which can be used within bricks and applications as configuration.<br/><br/>A Config Data Model allows defining complex data structure with multiple config data types, properties and relations.<br/><br/>A project can have multiple Config Data Models."}},{"o":1,"t":"016324fde11a836f76c2","p":{"ff023000000000000011":"Data Type"}},{"o":1,"t":"016324fde11a836087c2","p":{"ff023000000000000011":"Data Type -> Project","ff023000000000000030":610,"ff023000000000000031":96,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":5,"ff023000000000000237":8,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":0}},{"o":1,"t":"016324fde11b836f76c2","p":{"01703376c4a81c0e9d91":"Defines a new type.","01703376c4a81c0e9d92":"A Data Type is very similar to the concept of 'Class' in object-oriented programming languages, or to a table in a relational database. A data type can contain:\n- Properties: values attached to data type instances\n- Relations: these are many-to-many relationships between data type instances.\n\n"}},{"o":1,"t":"0163a68ce44f3d1fa84c","p":{"ff023000000000000011":"Data Model"}},{"o":1,"t":"0163a68ce4503d1fa84c","p":{"01703376c4a81c0e9d91":"Defines data types and relations between them.","01703376c4a81c0e9d92":"A Data Model enables defining the structure of the data that the application and its users will manage.A single Data Model can define multiple Data Types, as well as the relations between them. A project can have multiple Data Models."}},{"o":1,"t":"017b3aa8fae1e3d044dc","p":{"ff023000000000000011":"Business Container"}},{"o":1,"t":"017b3aa8fd1659291b92","p":{"ff023000000000000011":"business container to project","ff023000000000000030":515,"ff023000000000000031":1,"ff023000000000000034":0,"ff023000000000000037":9,"ff023000000000000137":9,"ff023000000000000237":0,"ff023000000000000337":9,"ff023000000000000437":9,"ff023000000000000537":0}},{"o":1,"t":"017b3aa8fe7ec3fd52f2","p":{"ff023000000000000011":"business container to runtime objects","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":0,"ff023000000000000037":0,"ff023000000000000137":6,"ff023000000000000237":2,"ff023000000000000337":0,"ff023000000000000437":0,"ff023000000000000537":0}},{"o":1,"t":"01644b6d4543b344b857","p":{"ff023000000000000011":"Media Library"}},{"o":1,"t":"01644b6d4544b344b857","p":{"01703376c4a81c0e9d91":"A repository for media resources.","01703376c4a81c0e9d92":"A Media Library stores assets like images, videos and fonts that can be used within the project."}},{"o":1,"t":"01644b6297305d62fca2","p":{"ff023000000000000011":"Image File"}},{"o":1,"t":"01644b6297315d62fca2","p":{"01703376c4a81c0e9d91":"A file containing an image.","01703376c4a81c0e9d92":"An Image File contains a binary encoded image. Supported formats are jpeg, png and gif."}},{"o":1,"t":"016eb13ba1388f7bdd71","p":{"ff023000000000000011":"picture_default","ff023000000000000050":"picture_default.svg","ff023000000000000051":{"c":4,"h":12,"m":40,"s":10,"S":419,"z":0,"y":2025,"M":11,"d":6},"ff023000000000000052":"image/svg+xml","ff023000000000000053":"images/picture_default.svg","ff023000000000000054":false,"ff023000000000000055":{"c":4,"h":12,"m":40,"s":10,"S":419,"z":0,"y":2025,"M":11,"d":6}}},{"o":1,"t":"01647e113043c637b541","p":{"fd01647e677f5d1cfbdf42":"normal","fd01647e6780999bf8bd25":300,"ff023000000000000011":"Font File"}},{"o":1,"t":"01647e35ecd24ef0b88d","p":{"ff023000000000000011":"Font Family"}},{"o":1,"t":"01647e677f5d1cfbdf42","p":{"ff023000000000000011":"Font Style"}},{"o":1,"t":"01647e6780999bf8bd25","p":{"ff023000000000000011":"Font Weight"}},{"o":1,"t":"01647e113044c637b541","p":{"01703376c4a81c0e9d91":"A file containing a font definition.","01703376c4a81c0e9d92":"A Font File contains a set of graphically related used to display strings on the screen.\n Supported formats are: woff & woff2"}},{"o":1,"t":"0164643c432146a71d5c","p":{"ff023000000000000011":"Video File"}},{"o":1,"t":"0164643c432246a71d5c","p":{"01703376c4a81c0e9d91":"A file containing a video recording.","01703376c4a81c0e9d92":"A Video File contains a binary encoded video. Supported formats are mp4, mpeg and avi."}},{"o":1,"t":"0163c9ae01f2d6e9ca49","p":{"ff023000000000000011":"ObjectRef"}},{"o":1,"t":"0163c9ae0401d21eb0c3","p":{"ff023000000000000011":"objectTag"}},{"o":1,"t":"0169b5a8a33144fb0b49","p":{"ff023000000000000011":"reference","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":9,"ff023000000000000237":2,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":2}},{"o":1,"t":"016421bb3797e22d1c4e","p":{"ff023000000000000011":"Video Stream"}},{"o":1,"t":"0162f672366be5ca7a86","p":{"ff023000000000000011":"Type"}},{"o":1,"t":"018119241abce0e5696e","p":{"ff023000000000000011":"Map"}},{"o":1,"t":"018119241abde0e5696e","p":{"01703376c4a81c0e9d91":"An ordered collection of key-value pairs.","01703376c4a81c0e9d92":"A Map is a collection of values. Each value has a unique key and can be accessed through that key."}},{"o":1,"t":"01631aacd8276ea98490","p":{"ff023000000000000011":"List"}},{"o":1,"t":"01631aacd8286ea98490","p":{"01703376c4a81c0e9d91":"An ordered collection of objects.","01703376c4a81c0e9d92":"A List is a collection of objects of the same type (e.g. a list of strings). It can be accessed sequentially (one entry after the other) or directly by specifying the rank of the entry (e.g. the 3rd entry).\nThis is similar to arrays in programming languages."}},{"o":1,"t":"016cfca73e63f9ab5ba4","p":{"ff023000000000000011":"Text"}},{"o":1,"t":"01631aacd8276ea98491","p":{"ff023000000000000011":"Array"}},{"o":1,"t":"01631aacd8286ea98491","p":{"01703376c4a81c0e9d91":"A mutable ordered collection of objects.","01703376c4a81c0e9d92":"An Array is a collection of objects of the same type (e.g. a list of strings). It can be accessed sequentially (one entry after the other) or directly by specifying the rank of the entry (e.g. the 3rd entry).<br/><br/>This is similar to arrays in programming languages."}},{"o":1,"t":"01631aacd8276ea98492","p":{"ff023000000000000011":"Query Result"}},{"o":1,"t":"01631aacd8286ea98492","p":{"01703376c4a81c0e9d91":"An ordered collection of objects.","01703376c4a81c0e9d92":"A **QueryResult** is a collection of object tuples produced by the execution of a Query. It can be accessed sequentially (one entry after the other) or directly by specifying the rank of the entry (e.g. the 3rd entry).<br/><br/>This is similar to arrays in programming languages."}},{"o":1,"t":"01631aacd8276ea98493","p":{"ff023000000000000011":"Query"}},{"o":1,"t":"01631aacd8286ea98493","p":{"01703376c4a81c0e9d91":"TODO","01703376c4a81c0e9d92":"TODO"}},{"o":1,"t":"01631aacd8276ea98494","p":{"ff023000000000000011":"Filter Type"}},{"o":1,"t":"01631aacd8286ea98494","p":{"01703376c4a81c0e9d91":"TODO","01703376c4a81c0e9d92":"TODO"}},{"o":1,"t":"01631aacd8276ea98495","p":{"ff023000000000000011":"Sort Direction"}},{"o":1,"t":"01631aacd8286ea98495","p":{"01703376c4a81c0e9d91":"TODO","01703376c4a81c0e9d92":"TODO"}},{"o":1,"t":"01631aacd8276ea98496","p":{"017a7690c915975ea995":0,"ff023000000000000011":"equals","ff023000000000000026":"equals"}},{"o":1,"t":"01631aacd8276ea98497","p":{"017a7690c915975ea995":1,"ff023000000000000011":"different","ff023000000000000026":"different"}},{"o":1,"t":"01631aacd8276ea98498","p":{"017a7690c915975ea995":2,"ff023000000000000011":"contains","ff023000000000000026":"contains"}},{"o":1,"t":"01631aacd8276ea98499","p":{"017a7690c915975ea995":3,"ff023000000000000011":"greater than","ff023000000000000026":"greater than"}},{"o":1,"t":"01631aacd8276ea9849a","p":{"017a7690c915975ea995":4,"ff023000000000000011":"greater or equals","ff023000000000000026":"greater or equals"}},{"o":1,"t":"01631aacd8276ea9849b","p":{"017a7690c915975ea995":5,"ff023000000000000011":"smaller than","ff023000000000000026":"smaller than"}},{"o":1,"t":"01631aacd8276ea9849c","p":{"017a7690c915975ea995":6,"ff023000000000000011":"smaller or equals","ff023000000000000026":"smaller or equals"}},{"o":1,"t":"01631aacd8276ea9849d","p":{"017a7690c915975ea995":7,"ff023000000000000011":"regexp","ff023000000000000026":"regexp"}},{"o":1,"t":"01631aacd8276ea9849e","p":{"017a7690c915975ea995":0,"ff023000000000000011":"ascending","ff023000000000000026":"ascending"}},{"o":1,"t":"01631aacd8276ea9849f","p":{"017a7690c915975ea995":1,"ff023000000000000011":"descending","ff023000000000000026":"descending"}},{"o":1,"t":"018312ceeb3e93618a85","p":{"ff023000000000000011":"Context"}},{"o":1,"t":"018312ceeb3f93618a85","p":{"01703376c4a81c0e9d91":"Context of a brick","01703376c4a81c0e9d92":"A Context is a placeholder to store some key/value related to a specific part (context) of the application"}},{"o":1,"t":"01621fb84e320000cf00","p":{"ff023000000000000011":"Control Flow"}},{"o":1,"t":"016eeb5ede9f3094d8f0","p":{"ff023000000000000011":"Error Flow"}},{"o":1,"t":"016ac4f59ee8ea2081ba","p":{"ff023000000000000011":"Predefined IO","ff023000000000000012":true}},{"o":1,"t":"017bc044aeacce7ffc8f","p":{"ff023000000000000011":"Predefined IO Rank"}},{"o":1,"t":"016ac4f5a0091c4790e2","p":{"ff023000000000000011":"Predefined Type IO","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":9,"ff023000000000000237":1,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":2}},{"o":1,"t":"016ac4f59c592b862457","p":{"ff023000000000000011":"Predefined Input"}},{"o":1,"t":"016ac4f59dd99f5df3e1","p":{"ff023000000000000011":"Predefined Output"}},{"o":1,"t":"0168a431d25001540000","p":{"ff023000000000000011":"Runnable IO","ff023000000000000012":true}},{"o":1,"t":"01740c5d4ae4b520dd01","p":{"ff023000000000000011":"IO Rank"}},{"o":1,"t":"0168a431d3b9b7438424","p":{"ff023000000000000011":"Type IO","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":9,"ff023000000000000237":1,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":2}},{"o":1,"t":"0168a431d25001540001","p":{"ff023000000000000011":"Runnable Input"}},{"o":1,"t":"01740c5d4ae4b520dd02","p":{"ff023000000000000011":"Default Value"}},{"o":1,"t":"0168a431d25001540002","p":{"ff023000000000000011":"Runnable Output"}},{"o":1,"t":"011100000000000adef0","p":{"ff023000000000000011":"Function Signature"}},{"o":1,"t":"016ac4f59a2917fdef01","p":{"ff023000000000000011":"Predefined Inputs rel","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":0,"ff023000000000000037":2,"ff023000000000000137":6,"ff023000000000000237":2,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":2}},{"o":1,"t":"016ac4f59a2917fdef02","p":{"ff023000000000000011":"Predefined Outputs rel","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":0,"ff023000000000000037":2,"ff023000000000000137":6,"ff023000000000000237":2,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":2}},{"o":1,"t":"011100000001000adef0","p":{"01703376c4a81c0e9d91":"A signature for functions","01703376c4a81c0e9d92":"A Function Signature defines the inputs and outputs, with names and types, of a function, but does not provide an implementation.Function Signatures can be used to define as types within the inputs or outputs of Functions and Actions, as well as within properties of Visual Components.<br/><br/>A Function Signature is analogous to an <a href=\"https://en.wikipedia.org/wiki/Interface_(object-oriented_programming)\" targer=\"_blank\">interface</a> in object-oriented programming."}},{"o":1,"t":"0112000000000000def0","p":{"fd01692aa71f3108454479":false,"ff023000000000000011":"Runnable Definition"}},{"o":1,"t":"01692aa71f3108454479","p":{"ff023000000000000011":"hardcoded"}},{"o":1,"t":"0166446c1f128ebc903a","p":{"ff023000000000000011":"On Load"}},{"o":1,"t":"0166446c1f128ebc904e","p":{"ff023000000000000011":"On Error"}},{"o":1,"t":"01621fb84e320000f00a","p":{"ff023000000000000011":"Inputs","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":0,"ff023000000000000037":2,"ff023000000000000137":6,"ff023000000000000237":2,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":2}},{"o":1,"t":"01621fb84e320000f00b","p":{"ff023000000000000011":"Outputs","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":0,"ff023000000000000037":2,"ff023000000000000137":6,"ff023000000000000237":2,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":2}},{"o":1,"t":"0171838bcfed0000e00e","p":{"ff023000000000000011":"Super Definition","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":5,"ff023000000000000237":2,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":0}},{"o":1,"t":"0171838bcfed0000a00a","p":{"ff023000000000000011":"Auxiliary model","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":5,"ff023000000000000237":2,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":0}},{"o":1,"t":"01130000000000ca1100","p":{"ff023000000000000011":"Runnable","ff023000000000000012":true}},{"o":1,"t":"01692a4af82e8984742b","p":{"ff023000000000000011":"Definition of runnable","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":9,"ff023000000000000237":2,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":2}},{"o":1,"t":"01756a18d4921c103111","p":{"ff023000000000000011":"Anonymous definition","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":0,"ff023000000000000037":10,"ff023000000000000137":10,"ff023000000000000237":1,"ff023000000000000337":10,"ff023000000000000437":10,"ff023000000000000537":10}},{"o":1,"t":"01692a4af82e8984742c","p":{"ff023000000000000011":"Calls Runnable","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":4,"ff023000000000000037":2,"ff023000000000000137":6,"ff023000000000000237":2,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":2}},{"o":1,"t":"01692a4af82e8984742d","p":{"ff023000000000000011":"Conditional Calls Runnable","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":4,"ff023000000000000037":2,"ff023000000000000137":6,"ff023000000000000237":1,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":2}},{"o":1,"t":"01692a4af82e8984742e","p":{"ff023000000000000011":"Extra Calls Runnable","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":4,"ff023000000000000037":4,"ff023000000000000137":6,"ff023000000000000237":2,"ff023000000000000337":4,"ff023000000000000437":4,"ff023000000000000537":2}},{"o":1,"t":"0195482b9cead0df5157","p":{"ff023000000000000011":"Disabled Runnable","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":4,"ff023000000000000037":2,"ff023000000000000137":6,"ff023000000000000237":2,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":2}},{"o":1,"t":"016c2d996d9ca27fa9d8","p":{"ff023000000000000011":"Delegate","ff023000000000000012":true}},{"o":1,"t":"016c3cb7742ec9309e0b","p":{"ff023000000000000011":"Delegator Relation","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":5,"ff023000000000000237":1,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":0}},{"o":1,"t":"016c42d3454636f90533","p":{"ff023000000000000011":"Delegated Properties","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":5,"ff023000000000000237":1,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":0}},{"o":1,"t":"016d3f37610ae4fc3962","p":{"ff023000000000000011":"SizeDelegator"}},{"o":1,"t":"01621fb84e320000f000","p":{"ff023000000000000011":"Function"}},{"o":1,"t":"0162f15740c36629dc57","p":{"ff023000000000000011":"description"}},{"o":1,"t":"01621fb84e330000f000","p":{"01703376c4a81c0e9d91":"A Function takes inputs and produces outputs.","01703376c4a81c0e9d92":"A Function is the basic logic brick. It takes one or several inputs and produces one or several outputs.\nFor instance `Plus` is a Function that takes 2 numbers as inputs an produces, as output, a number that is the sum of these 2 inputs.<br/><br/>A Function can be reused within other Functions, Actions and Visual Components.<br/><br/>By default, a Function is triggered once each one of its inputs has been defined, and then everytime one of its inputs changes."}},{"o":1,"t":"01621fb84e320000f011","p":{"ff023000000000000011":"Coded Function"}},{"o":1,"t":"01621fb84e330000f011","p":{"01703376c4a81c0e9d91":"A Function implemented using code.","01703376c4a81c0e9d92":"A Coded Function is a function implemented using code, such as JavaScript or TypeScript.<br/><br/>Coded Functions are typically used to add new functionalities within applications, or to implement more complex logic."}},{"o":1,"t":"0168c6f020f2a96f0000","p":{"ff023000000000000011":"Function Call","ff023000000000000012":true}},{"o":1,"t":"0168a431d91f25780000","p":{"ff023000000000000011":"Pipe"}},{"o":1,"t":"0168a431d91f25780001","p":{"ff023000000000000011":"Source Value"}},{"o":1,"t":"0168a431d91f25780002","p":{"ff023000000000000011":"Source Scope","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":9,"ff023000000000000237":2,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":8}},{"o":1,"t":"0168a431d91f25780003","p":{"ff023000000000000011":"Source Output","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":9,"ff023000000000000237":2,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":8}},{"o":1,"t":"0168a431d91f25780004","p":{"ff023000000000000011":"Source Property","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":9,"ff023000000000000237":2,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":8}},{"o":1,"t":"0168a431d91f2578000a","p":{"ff023000000000000011":"Destination Scope","ff023000000000000030":994,"ff023000000000000031":992,"ff023000000000000034":0,"ff023000000000000037":9,"ff023000000000000137":9,"ff023000000000000237":10,"ff023000000000000337":9,"ff023000000000000437":9,"ff023000000000000537":8}},{"o":1,"t":"0168a431d91f2578000b","p":{"ff023000000000000011":"Destination Input","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":9,"ff023000000000000237":2,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":8}},{"o":1,"t":"0168a431d91f2578000c","p":{"ff023000000000000011":"Destination Property","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":9,"ff023000000000000237":2,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":8}},{"o":1,"t":"01621fb84e32000000a0","p":{"01621fb84e320000f001":"private","ff023000000000000011":"Ascender"}},{"o":1,"t":"01621fb84e32000000a1","p":{"ff023000000000000011":"Input","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":0,"ff023000000000000037":2,"ff023000000000000137":10,"ff023000000000000237":2,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":0}},{"o":1,"t":"01621fb84e32000000a2","p":{"ff023000000000000011":"Upward","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":2,"ff023000000000000137":10,"ff023000000000000237":1,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":0}},{"o":1,"t":"01621fb84e32000000d0","p":{"01621fb84e320000f001":"private","ff023000000000000011":"Descender"}},{"o":1,"t":"01621fb84e32000000d1","p":{"ff023000000000000011":"Downward","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":2,"ff023000000000000137":10,"ff023000000000000237":1,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":0}},{"o":1,"t":"01621fb84e32000000d2","p":{"ff023000000000000011":"Output","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":0,"ff023000000000000037":2,"ff023000000000000137":10,"ff023000000000000237":2,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":0}},{"o":1,"t":"01621fb84e320000a000","p":{"ff023000000000000011":"Action"}},{"o":1,"t":"016ac63229782039429f","p":{"017bc044aeacce7ffc8f":0,"ff023000000000000011":"Control Flow"}},{"o":1,"t":"016ac6322acf67eebfe7","p":{"017bc044aeacce7ffc8f":0,"ff023000000000000011":"Control Flow"}},{"o":1,"t":"01621fb84e330000a000","p":{"01703376c4a81c0e9d91":"A function takes inputs and produces outputs.","01703376c4a81c0e9d92":"An Action is the other basic logic brick. It also takes one or several inputs and produces one or several outputs.\nAdditionally, an Action has an input and output *control flows*. The Action is executed when the input control flow is triggered, and it defines all outputs before the output control flow is triggered.<br/><br/>By default, an action is triggered everytime the control flow is triggered, regardless of the value of the other inputs.<br/><br/>An Action can be reused within other Functions, Actions and Visual Components."}},{"o":1,"t":"01621fb84e320000f012","p":{"ff023000000000000011":"Coded Action"}},{"o":1,"t":"01621fb84e330000f012","p":{"01703376c4a81c0e9d91":"An Action implemented using code.","01703376c4a81c0e9d92":"A Coded Action is an Action implemented using code, such as JavaScript or TypeScript.<br/><br/>Coded Actions are typically used to add new functionalities within applications, or to implement more complex logic."}},{"o":1,"t":"0168c6f020f2a96a0000","p":{"ff023000000000000011":"Action Call","ff023000000000000012":true}},{"o":1,"t":"016a9766c230916ea5ec","p":{"ff023000000000000011":"Service"}},{"o":1,"t":"016ac63c5b3ed0562740","p":{"017bc044aeacce7ffc8f":0,"ff023000000000000011":"Control Flow"}},{"o":1,"t":"016a9766c231916ea5ec","p":{"01703376c4a81c0e9d91":"A long running action to be run in a Service Application.","01703376c4a81c0e9d92":"A Service is an Action meant to be run inside a Service App. The Service is triggered when the Service App starts, and runs until the Service App stops.<br/><br/>A Service has no input, and its configuration is therefore generally read from configuration files, APIs or other external sources.<br/><br/>Typical uses of Services are to run batch jobs, expose web services, or listen to outside events such as incoming emails."}},{"o":1,"t":"0169b6876a03f139d50a","p":{"ff023000000000000011":"Interaction Event Definition"}},{"o":1,"t":"016ac63808535703691c","p":{"017bc044aeacce7ffc8f":0,"ff023000000000000011":"Control Flow"}},{"o":1,"t":"0169b6876a03f14ae61b","p":{"ff023000000000000011":"Error Handler Definition"}},{"o":1,"t":"016ac638085357047a2d","p":{"017bc044aeacce7ffc8f":0,"ff023000000000000011":"Error Flow"}},{"o":1,"t":"017a7b07a948e30508fa","p":{"ff023000000000000011":"Remote Action"}},{"o":1,"t":"017a7b07b09e3b22c8b4","p":{"017bc044aeacce7ffc8f":0,"ff023000000000000011":"Control Flow"}},{"o":1,"t":"017a7b07ba05807a74b0","p":{"017bc044aeacce7ffc8f":1,"ff023000000000000011":"User"}},{"o":1,"t":"017a7b0818c12388d731","p":{"017bc044aeacce7ffc8f":0,"ff023000000000000011":"Control Flow"}},{"o":1,"t":"017a7b085146d5e69aec","p":{"017bc044aeacce7ffc8f":1,"ff023000000000000011":"Error Flow"}},{"o":1,"t":"017a7b07a949e30508fa","p":{"01703376c4a81c0e9d91":"An action running remotely in a Service App.","01703376c4a81c0e9d92":"A Remote Action is an Action which is running within a Service App. It behaves and it is used like an action, but it runs remotely. The Remote Action takes care of serializing the inputs, send them to the Service App, executes the content of the Remote Action, and serializes the outputs back to the caller.<br/><br/>Remote Actions are typically used to call APIs, databases, send emails and perform other back-end operations.<br/><br/>A remote action is synchronous, and can therefore be subject to timeouts if running for too long. The timeout value is configurable per environment."}},{"o":1,"t":"017a7b0c5dcbd8964c5d","p":{"fd017a7b0c62a02a89444f":false,"ff023000000000000011":"Remote Action Call","ff023000000000000012":true}},{"o":1,"t":"017a7b0c62a02a89444f","p":{"ff023000000000000011":"listener"}},{"o":1,"t":"011203300000000adf00","p":{"fd011203300000000adf01":0,"fd011203300000000adf02":20000,"ff023000000000000011":"System Information"}},{"o":1,"t":"011203300000000adf01","p":{"ff023000000000000011":"appController timestamp"}},{"o":1,"t":"011203300000000adf02","p":{"ff023000000000000011":"appController heart rate"}},{"o":1,"t":"011203300000000adf0f","p":{}},{"o":1,"t":"01120300000000adef00","p":{"ff023000000000000011":"Application Definition","ff023000000000000012":true}},{"o":1,"t":"0171bc1f15da96dfdb89","p":{"ff023000000000000011":"app project import","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":5,"ff023000000000000237":2,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":0}},{"o":1,"t":"0171bc1f15da96dfdb90","p":{"ff023000000000000011":"deploy data source","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":0,"ff023000000000000037":2,"ff023000000000000137":6,"ff023000000000000237":2,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":2}},{"o":1,"t":"011203300000000adef5","p":{"fd011203300000000adef6":false,"fd011203300000000adef7":false,"fd011203300000000adef8":0,"ff023000000000000011":"Deployment Info"}},{"o":1,"t":"011203300000000adef6","p":{"ff023000000000000011":"activated"}},{"o":1,"t":"011203300000000adef7","p":{"ff023000000000000011":"rebuild"}},{"o":1,"t":"011203300000000adef8","p":{"ff023000000000000011":"status"}},{"o":1,"t":"011203300000000adef9","p":{"ff023000000000000011":"last error"}},{"o":1,"t":"011203300000000adefa","p":{"ff023000000000000011":"project URL"}},{"o":1,"t":"011203300000000adefb","p":{"ff023000000000000011":"project branch"}},{"o":1,"t":"011203300000000adefc","p":{"ff023000000000000011":"build command"}},{"o":1,"t":"011203300000000adefd","p":{"ff023000000000000011":"project config"}},{"o":1,"t":"011203300000000adefe","p":{"ff023000000000000011":"logs"}},{"o":1,"t":"011203300000000adeff","p":{"ff023000000000000011":"port mappings"}},{"o":1,"t":"011203300000000adee0","p":{"ff023000000000000011":"dependencies"}},{"o":1,"t":"011203300000000adef3","p":{"ff023000000000000011":"Service App"}},{"o":1,"t":"011203300000000adef4","p":{"ff023000000000000011":"Deployment Info","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":0,"ff023000000000000037":2,"ff023000000000000137":6,"ff023000000000000237":2,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":0}},{"o":1,"t":"011203300001000adef3","p":{"01703376c4a81c0e9d91":"A headless (with no UI) application.","01703376c4a81c0e9d92":"Service Apps are back-end applications that are meant to be run on servers or on any edge or IoT device that does not have a screen. They run in the background and are typically used to capture data from a third party, process data, perform data input validation, etc."}},{"o":1,"t":"017dc8d6c8fd8c8bd2ff","p":{"ff023000000000000011":"Data Connector"}},{"o":1,"t":"0113030000000aca1100","p":{"ff023000000000000011":"Application","ff023000000000000012":true}},{"o":1,"t":"0113032000000aca1102","p":{"ff023000000000000011":"Headless Application","ff023000000000000012":true}},{"o":1,"t":"017ffdc010e5bcc9c971","p":{"fd017ffdc010e5bcc9c972":false,"ff023000000000000011":"Workflow"}},{"o":1,"t":"017ffdc010e5bcc9c972","p":{"ff023000000000000011":"Serialization Enabled"}},{"o":1,"t":"017ffdc010e5bcc9c973","p":{"ff023000000000000011":"Data Type","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":5,"ff023000000000000237":1,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":2}},{"o":1,"t":"017ffdc010e5bcc9c974","p":{"ff023000000000000011":"States","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":0,"ff023000000000000037":6,"ff023000000000000137":6,"ff023000000000000237":2,"ff023000000000000337":6,"ff023000000000000437":6,"ff023000000000000537":0}},{"o":1,"t":"017ffdc010e5bcc9c975","p":{"ff023000000000000011":"Initial State","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":5,"ff023000000000000237":1,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":0}},{"o":1,"t":"017ffdc010e6bcc9c971","p":{"01703376c4a81c0e9d91":"Defines states and transitions between states.","01703376c4a81c0e9d92":"A Workflow defines a set of *states* through which the instances of a Data Type can go through, as well as the transitions allows between those states.<br/><br/>A Workflow can therefore be seen as a state machine. Each transition can have an optional *Process Function*, which can embed any custom logic to:\n- Add predefined processing within a transition\n- Add additional verification logic to allow or deny the transition to happen\n\nEach Workflow is assigned to a Data Type, and can then be used to control the possible states of the instances of that Data Type."}},{"o":1,"t":"017ffdc2dda51d46b430","p":{"ff023000000000000011":"Workflow State"}},{"o":1,"t":"017ffdc2dda61d46b430","p":{"01703376c4a81c0e9d91":"A single state of a workflow sequence.","01703376c4a81c0e9d92":"A Workflow State represents a single state in a workflow."}},{"o":1,"t":"017ffde21f5fe0f704ce","p":{"ff023000000000000011":"Workflow Process Function Definition"}},{"o":1,"t":"017ffe02381f9fac5060","p":{"017bc044aeacce7ffc8f":0,"ff023000000000000011":"Control Flow"}},{"o":1,"t":"017ffe02381f9fac5061","p":{"017bc044aeacce7ffc8f":1,"ff023000000000000011":"Object"}},{"o":1,"t":"017ffe02381f9fac5062","p":{"017bc044aeacce7ffc8f":2,"ff023000000000000011":"User"}},{"o":1,"t":"017ffe02381f9fac5065","p":{"017bc044aeacce7ffc8f":3,"ff023000000000000011":"Data Map"}},{"o":1,"t":"017ffe02381f9fac5063","p":{"017bc044aeacce7ffc8f":0,"ff023000000000000011":"Control Flow"}},{"o":1,"t":"017ffe02381f9fac5064","p":{"017bc044aeacce7ffc8f":1,"ff023000000000000011":"Error Flow"}},{"o":1,"t":"017ffdc633219f16beea","p":{"ff023000000000000011":"Workflow Transition"}},{"o":1,"t":"017ffdc633219f16beec","p":{"ff023000000000000011":"Process"}},{"o":1,"t":"017ffdc2dda51d46b431","p":{"ff023000000000000011":"From State","ff023000000000000030":994,"ff023000000000000031":992,"ff023000000000000034":0,"ff023000000000000037":8,"ff023000000000000137":9,"ff023000000000000237":8,"ff023000000000000337":8,"ff023000000000000437":8,"ff023000000000000537":0}},{"o":1,"t":"017ffdc633219f16beeb","p":{"ff023000000000000011":"To State","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":8,"ff023000000000000137":9,"ff023000000000000237":1,"ff023000000000000337":8,"ff023000000000000437":8,"ff023000000000000537":0}}],"optionalOperations":[]}
|
|
1
|
+
{"rootTag":"100000000000000000dd","operations":[{"o":1,"t":"017a7a9ff057958e5678","p":{"ff023000000000000011":"Enums"}},{"o":1,"t":"017a7a9ff058958e5678","p":{"01703376c4a81c0e9d91":"Allows defining one or more enums.","01703376c4a81c0e9d92":"An enum is an ordered list of entries, with a `Value` and a `Display Name`. The `Value` is the actual value being used within dataflows, while the `Display Name` is the text displayed in DRAW.<br/><br/>Enums are treated as *types* within Olympe, and they can therefore be used in various places:\n- In Functions and Actions, as types of inputs and outputs\n- In Visual Components, as types of properties\n- In Data Models, as types of properties within Data Types\n\n"}},{"o":1,"t":"016cdd861b32d56c8208","p":{"ff023000000000000011":"Enum Item"}},{"o":1,"t":"01645fe6873aeea59e64","p":{"ff023000000000000011":"Config Data Set"}},{"o":1,"t":"017ed8ac775f48d4d589","p":{"ff023000000000000011":"dataRel","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":0,"ff023000000000000037":2,"ff023000000000000137":6,"ff023000000000000237":0,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":0}},{"o":1,"t":"01645fe6873beea59e64","p":{"01703376c4a81c0e9d91":"Set of Config Data Type instances.","01703376c4a81c0e9d92":"Config Data Sets are used to create instances of Config Data Types.\nThey are typically used to create sets of data that can be used by your application as configuration, a bit like enums, with custom properties.<br/><br/>Since that data is part of the definition of applications, it cannot be updated by applications at runtime.\nCompared to instances of regular Data Types, which are created and modified by users at runtime, records inside Config Data Sets are saved during the export of the project, as part of the application data."}},{"o":1,"t":"016324fde11a836f77d3","p":{"ff023000000000000011":"Config Data Type"}},{"o":1,"t":"016324fde11a836088d3","p":{"ff023000000000000011":"Config Data Type -> Project","ff023000000000000030":610,"ff023000000000000031":96,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":5,"ff023000000000000237":8,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":0}},{"o":1,"t":"016324fde11b836f77d3","p":{"01703376c4a81c0e9d91":"A data structure to be used as configuration within bricks and applications.","01703376c4a81c0e9d92":"A Config Data Type let you specify a complex data structure which contains a number of properties an relations.\nThis is very similar to the concept of 'Class' in object-oriented programming languages.\nCompare to regular Data Types, a Config Data Type is defined in a *Config Data Model*, and it must be instantiated in a *Config Data Set*."}},{"o":1,"t":"0163a68ce44f3d1fa95d","p":{"ff023000000000000011":"Config Data Model"}},{"o":1,"t":"0163a68ce4503d1fa95d","p":{"01703376c4a81c0e9d91":"Defines Config Data Types and their relations.","01703376c4a81c0e9d92":"A Config Data Model is where you define the data structures called *Config Data Types*, which can be used within bricks and applications as configuration.<br/><br/>A Config Data Model allows defining complex data structure with multiple config data types, properties and relations.<br/><br/>A project can have multiple Config Data Models."}},{"o":1,"t":"016324fde11a836f76c2","p":{"ff023000000000000011":"Data Type"}},{"o":1,"t":"016324fde11a836087c2","p":{"ff023000000000000011":"Data Type -> Project","ff023000000000000030":610,"ff023000000000000031":96,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":5,"ff023000000000000237":8,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":0}},{"o":1,"t":"016324fde11b836f76c2","p":{"01703376c4a81c0e9d91":"Defines a new type.","01703376c4a81c0e9d92":"A Data Type is very similar to the concept of 'Class' in object-oriented programming languages, or to a table in a relational database. A data type can contain:\n- Properties: values attached to data type instances\n- Relations: these are many-to-many relationships between data type instances.\n\n"}},{"o":1,"t":"0163a68ce44f3d1fa84c","p":{"ff023000000000000011":"Data Model"}},{"o":1,"t":"0163a68ce4503d1fa84c","p":{"01703376c4a81c0e9d91":"Defines data types and relations between them.","01703376c4a81c0e9d92":"A Data Model enables defining the structure of the data that the application and its users will manage.A single Data Model can define multiple Data Types, as well as the relations between them. A project can have multiple Data Models."}},{"o":1,"t":"017b3aa8fae1e3d044dc","p":{"ff023000000000000011":"Business Container"}},{"o":1,"t":"017b3aa8fd1659291b92","p":{"ff023000000000000011":"business container to project","ff023000000000000030":515,"ff023000000000000031":1,"ff023000000000000034":0,"ff023000000000000037":9,"ff023000000000000137":9,"ff023000000000000237":0,"ff023000000000000337":9,"ff023000000000000437":9,"ff023000000000000537":0}},{"o":1,"t":"017b3aa8fe7ec3fd52f2","p":{"ff023000000000000011":"business container to runtime objects","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":0,"ff023000000000000037":0,"ff023000000000000137":6,"ff023000000000000237":2,"ff023000000000000337":0,"ff023000000000000437":0,"ff023000000000000537":0}},{"o":1,"t":"01644b6d4543b344b857","p":{"ff023000000000000011":"Media Library"}},{"o":1,"t":"01644b6d4544b344b857","p":{"01703376c4a81c0e9d91":"A repository for media resources.","01703376c4a81c0e9d92":"A Media Library stores assets like images, videos and fonts that can be used within the project."}},{"o":1,"t":"01644b6297305d62fca2","p":{"ff023000000000000011":"Image File"}},{"o":1,"t":"01644b6297315d62fca2","p":{"01703376c4a81c0e9d91":"A file containing an image.","01703376c4a81c0e9d92":"An Image File contains a binary encoded image. Supported formats are jpeg, png and gif."}},{"o":1,"t":"016eb13ba1388f7bdd71","p":{"ff023000000000000011":"picture_default","ff023000000000000050":"picture_default.svg","ff023000000000000051":{"c":4,"h":9,"m":7,"s":46,"S":748,"z":0,"y":2025,"M":12,"d":16},"ff023000000000000052":"image/svg+xml","ff023000000000000053":"images/picture_default.svg","ff023000000000000054":false,"ff023000000000000055":{"c":4,"h":9,"m":7,"s":46,"S":748,"z":0,"y":2025,"M":12,"d":16}}},{"o":1,"t":"01647e113043c637b541","p":{"fd01647e677f5d1cfbdf42":"normal","fd01647e6780999bf8bd25":300,"ff023000000000000011":"Font File"}},{"o":1,"t":"01647e35ecd24ef0b88d","p":{"ff023000000000000011":"Font Family"}},{"o":1,"t":"01647e677f5d1cfbdf42","p":{"ff023000000000000011":"Font Style"}},{"o":1,"t":"01647e6780999bf8bd25","p":{"ff023000000000000011":"Font Weight"}},{"o":1,"t":"01647e113044c637b541","p":{"01703376c4a81c0e9d91":"A file containing a font definition.","01703376c4a81c0e9d92":"A Font File contains a set of graphically related used to display strings on the screen.\n Supported formats are: woff & woff2"}},{"o":1,"t":"0164643c432146a71d5c","p":{"ff023000000000000011":"Video File"}},{"o":1,"t":"0164643c432246a71d5c","p":{"01703376c4a81c0e9d91":"A file containing a video recording.","01703376c4a81c0e9d92":"A Video File contains a binary encoded video. Supported formats are mp4, mpeg and avi."}},{"o":1,"t":"0163c9ae01f2d6e9ca49","p":{"ff023000000000000011":"ObjectRef"}},{"o":1,"t":"0163c9ae0401d21eb0c3","p":{"ff023000000000000011":"objectTag"}},{"o":1,"t":"0169b5a8a33144fb0b49","p":{"ff023000000000000011":"reference","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":9,"ff023000000000000237":2,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":2}},{"o":1,"t":"016421bb3797e22d1c4e","p":{"ff023000000000000011":"Video Stream"}},{"o":1,"t":"0162f672366be5ca7a86","p":{"ff023000000000000011":"Type"}},{"o":1,"t":"018119241abce0e5696e","p":{"ff023000000000000011":"Map"}},{"o":1,"t":"018119241abde0e5696e","p":{"01703376c4a81c0e9d91":"An ordered collection of key-value pairs.","01703376c4a81c0e9d92":"A Map is a collection of values. Each value has a unique key and can be accessed through that key."}},{"o":1,"t":"01631aacd8276ea98490","p":{"ff023000000000000011":"List"}},{"o":1,"t":"01631aacd8286ea98490","p":{"01703376c4a81c0e9d91":"An ordered collection of objects.","01703376c4a81c0e9d92":"A List is a collection of objects of the same type (e.g. a list of strings). It can be accessed sequentially (one entry after the other) or directly by specifying the rank of the entry (e.g. the 3rd entry).\nThis is similar to arrays in programming languages."}},{"o":1,"t":"016cfca73e63f9ab5ba4","p":{"ff023000000000000011":"Text"}},{"o":1,"t":"01631aacd8276ea98491","p":{"ff023000000000000011":"Array"}},{"o":1,"t":"01631aacd8286ea98491","p":{"01703376c4a81c0e9d91":"A mutable ordered collection of objects.","01703376c4a81c0e9d92":"An Array is a collection of objects of the same type (e.g. a list of strings). It can be accessed sequentially (one entry after the other) or directly by specifying the rank of the entry (e.g. the 3rd entry).<br/><br/>This is similar to arrays in programming languages."}},{"o":1,"t":"01631aacd8276ea98492","p":{"ff023000000000000011":"Query Result"}},{"o":1,"t":"01631aacd8286ea98492","p":{"01703376c4a81c0e9d91":"An ordered collection of objects.","01703376c4a81c0e9d92":"A **QueryResult** is a collection of object tuples produced by the execution of a Query. It can be accessed sequentially (one entry after the other) or directly by specifying the rank of the entry (e.g. the 3rd entry).<br/><br/>This is similar to arrays in programming languages."}},{"o":1,"t":"01631aacd8276ea98493","p":{"ff023000000000000011":"Query"}},{"o":1,"t":"01631aacd8286ea98493","p":{"01703376c4a81c0e9d91":"TODO","01703376c4a81c0e9d92":"TODO"}},{"o":1,"t":"01631aacd8276ea98494","p":{"ff023000000000000011":"Filter Type"}},{"o":1,"t":"01631aacd8286ea98494","p":{"01703376c4a81c0e9d91":"TODO","01703376c4a81c0e9d92":"TODO"}},{"o":1,"t":"01631aacd8276ea98495","p":{"ff023000000000000011":"Sort Direction"}},{"o":1,"t":"01631aacd8286ea98495","p":{"01703376c4a81c0e9d91":"TODO","01703376c4a81c0e9d92":"TODO"}},{"o":1,"t":"01631aacd8276ea98496","p":{"017a7690c915975ea995":0,"ff023000000000000011":"equals","ff023000000000000026":"equals"}},{"o":1,"t":"01631aacd8276ea98497","p":{"017a7690c915975ea995":1,"ff023000000000000011":"different","ff023000000000000026":"different"}},{"o":1,"t":"01631aacd8276ea98498","p":{"017a7690c915975ea995":2,"ff023000000000000011":"contains","ff023000000000000026":"contains"}},{"o":1,"t":"01631aacd8276ea98499","p":{"017a7690c915975ea995":3,"ff023000000000000011":"greater than","ff023000000000000026":"greater than"}},{"o":1,"t":"01631aacd8276ea9849a","p":{"017a7690c915975ea995":4,"ff023000000000000011":"greater or equals","ff023000000000000026":"greater or equals"}},{"o":1,"t":"01631aacd8276ea9849b","p":{"017a7690c915975ea995":5,"ff023000000000000011":"smaller than","ff023000000000000026":"smaller than"}},{"o":1,"t":"01631aacd8276ea9849c","p":{"017a7690c915975ea995":6,"ff023000000000000011":"smaller or equals","ff023000000000000026":"smaller or equals"}},{"o":1,"t":"01631aacd8276ea9849d","p":{"017a7690c915975ea995":7,"ff023000000000000011":"regexp","ff023000000000000026":"regexp"}},{"o":1,"t":"01631aacd8276ea9849e","p":{"017a7690c915975ea995":0,"ff023000000000000011":"ascending","ff023000000000000026":"ascending"}},{"o":1,"t":"01631aacd8276ea9849f","p":{"017a7690c915975ea995":1,"ff023000000000000011":"descending","ff023000000000000026":"descending"}},{"o":1,"t":"018312ceeb3e93618a85","p":{"ff023000000000000011":"Context"}},{"o":1,"t":"018312ceeb3f93618a85","p":{"01703376c4a81c0e9d91":"Context of a brick","01703376c4a81c0e9d92":"A Context is a placeholder to store some key/value related to a specific part (context) of the application"}},{"o":1,"t":"01621fb84e320000cf00","p":{"ff023000000000000011":"Control Flow"}},{"o":1,"t":"016eeb5ede9f3094d8f0","p":{"ff023000000000000011":"Error Flow"}},{"o":1,"t":"016ac4f59ee8ea2081ba","p":{"ff023000000000000011":"Predefined IO","ff023000000000000012":true}},{"o":1,"t":"017bc044aeacce7ffc8f","p":{"ff023000000000000011":"Predefined IO Rank"}},{"o":1,"t":"016ac4f5a0091c4790e2","p":{"ff023000000000000011":"Predefined Type IO","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":9,"ff023000000000000237":1,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":2}},{"o":1,"t":"016ac4f59c592b862457","p":{"ff023000000000000011":"Predefined Input"}},{"o":1,"t":"016ac4f59dd99f5df3e1","p":{"ff023000000000000011":"Predefined Output"}},{"o":1,"t":"0168a431d25001540000","p":{"ff023000000000000011":"Runnable IO","ff023000000000000012":true}},{"o":1,"t":"01740c5d4ae4b520dd01","p":{"ff023000000000000011":"IO Rank"}},{"o":1,"t":"0168a431d3b9b7438424","p":{"ff023000000000000011":"Type IO","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":9,"ff023000000000000237":1,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":2}},{"o":1,"t":"0168a431d25001540001","p":{"ff023000000000000011":"Runnable Input"}},{"o":1,"t":"01740c5d4ae4b520dd02","p":{"ff023000000000000011":"Default Value"}},{"o":1,"t":"0168a431d25001540002","p":{"ff023000000000000011":"Runnable Output"}},{"o":1,"t":"011100000000000adef0","p":{"ff023000000000000011":"Function Signature"}},{"o":1,"t":"016ac4f59a2917fdef01","p":{"ff023000000000000011":"Predefined Inputs rel","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":0,"ff023000000000000037":2,"ff023000000000000137":6,"ff023000000000000237":2,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":2}},{"o":1,"t":"016ac4f59a2917fdef02","p":{"ff023000000000000011":"Predefined Outputs rel","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":0,"ff023000000000000037":2,"ff023000000000000137":6,"ff023000000000000237":2,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":2}},{"o":1,"t":"011100000001000adef0","p":{"01703376c4a81c0e9d91":"A signature for functions","01703376c4a81c0e9d92":"A Function Signature defines the inputs and outputs, with names and types, of a function, but does not provide an implementation.Function Signatures can be used to define as types within the inputs or outputs of Functions and Actions, as well as within properties of Visual Components.<br/><br/>A Function Signature is analogous to an <a href=\"https://en.wikipedia.org/wiki/Interface_(object-oriented_programming)\" targer=\"_blank\">interface</a> in object-oriented programming."}},{"o":1,"t":"0112000000000000def0","p":{"fd01692aa71f3108454479":false,"ff023000000000000011":"Runnable Definition"}},{"o":1,"t":"01692aa71f3108454479","p":{"ff023000000000000011":"hardcoded"}},{"o":1,"t":"0166446c1f128ebc903a","p":{"ff023000000000000011":"On Load"}},{"o":1,"t":"0166446c1f128ebc904e","p":{"ff023000000000000011":"On Error"}},{"o":1,"t":"01621fb84e320000f00a","p":{"ff023000000000000011":"Inputs","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":0,"ff023000000000000037":2,"ff023000000000000137":6,"ff023000000000000237":2,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":2}},{"o":1,"t":"01621fb84e320000f00b","p":{"ff023000000000000011":"Outputs","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":0,"ff023000000000000037":2,"ff023000000000000137":6,"ff023000000000000237":2,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":2}},{"o":1,"t":"0171838bcfed0000e00e","p":{"ff023000000000000011":"Super Definition","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":5,"ff023000000000000237":2,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":0}},{"o":1,"t":"0171838bcfed0000a00a","p":{"ff023000000000000011":"Auxiliary model","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":5,"ff023000000000000237":2,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":0}},{"o":1,"t":"01130000000000ca1100","p":{"ff023000000000000011":"Runnable","ff023000000000000012":true}},{"o":1,"t":"01692a4af82e8984742b","p":{"ff023000000000000011":"Definition of runnable","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":9,"ff023000000000000237":2,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":2}},{"o":1,"t":"01756a18d4921c103111","p":{"ff023000000000000011":"Anonymous definition","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":0,"ff023000000000000037":10,"ff023000000000000137":10,"ff023000000000000237":1,"ff023000000000000337":10,"ff023000000000000437":10,"ff023000000000000537":10}},{"o":1,"t":"01692a4af82e8984742c","p":{"ff023000000000000011":"Calls Runnable","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":4,"ff023000000000000037":2,"ff023000000000000137":6,"ff023000000000000237":2,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":2}},{"o":1,"t":"01692a4af82e8984742d","p":{"ff023000000000000011":"Conditional Calls Runnable","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":4,"ff023000000000000037":2,"ff023000000000000137":6,"ff023000000000000237":1,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":2}},{"o":1,"t":"01692a4af82e8984742e","p":{"ff023000000000000011":"Extra Calls Runnable","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":4,"ff023000000000000037":4,"ff023000000000000137":6,"ff023000000000000237":2,"ff023000000000000337":4,"ff023000000000000437":4,"ff023000000000000537":2}},{"o":1,"t":"0195482b9cead0df5157","p":{"ff023000000000000011":"Disabled Runnable","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":4,"ff023000000000000037":2,"ff023000000000000137":6,"ff023000000000000237":2,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":2}},{"o":1,"t":"016c2d996d9ca27fa9d8","p":{"ff023000000000000011":"Delegate","ff023000000000000012":true}},{"o":1,"t":"016c3cb7742ec9309e0b","p":{"ff023000000000000011":"Delegator Relation","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":5,"ff023000000000000237":1,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":0}},{"o":1,"t":"016c42d3454636f90533","p":{"ff023000000000000011":"Delegated Properties","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":5,"ff023000000000000237":1,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":0}},{"o":1,"t":"016d3f37610ae4fc3962","p":{"ff023000000000000011":"SizeDelegator"}},{"o":1,"t":"01621fb84e320000f000","p":{"ff023000000000000011":"Function"}},{"o":1,"t":"0162f15740c36629dc57","p":{"ff023000000000000011":"description"}},{"o":1,"t":"01621fb84e330000f000","p":{"01703376c4a81c0e9d91":"A Function takes inputs and produces outputs.","01703376c4a81c0e9d92":"A Function is the basic logic brick. It takes one or several inputs and produces one or several outputs.\nFor instance `Plus` is a Function that takes 2 numbers as inputs an produces, as output, a number that is the sum of these 2 inputs.<br/><br/>A Function can be reused within other Functions, Actions and Visual Components.<br/><br/>By default, a Function is triggered once each one of its inputs has been defined, and then everytime one of its inputs changes."}},{"o":1,"t":"01621fb84e320000f011","p":{"ff023000000000000011":"Coded Function"}},{"o":1,"t":"01621fb84e330000f011","p":{"01703376c4a81c0e9d91":"A Function implemented using code.","01703376c4a81c0e9d92":"A Coded Function is a function implemented using code, such as JavaScript or TypeScript.<br/><br/>Coded Functions are typically used to add new functionalities within applications, or to implement more complex logic."}},{"o":1,"t":"0168c6f020f2a96f0000","p":{"ff023000000000000011":"Function Call","ff023000000000000012":true}},{"o":1,"t":"0168a431d91f25780000","p":{"ff023000000000000011":"Pipe"}},{"o":1,"t":"0168a431d91f25780001","p":{"ff023000000000000011":"Source Value"}},{"o":1,"t":"0168a431d91f25780002","p":{"ff023000000000000011":"Source Scope","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":9,"ff023000000000000237":2,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":8}},{"o":1,"t":"0168a431d91f25780003","p":{"ff023000000000000011":"Source Output","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":9,"ff023000000000000237":2,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":8}},{"o":1,"t":"0168a431d91f25780004","p":{"ff023000000000000011":"Source Property","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":9,"ff023000000000000237":2,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":8}},{"o":1,"t":"0168a431d91f2578000a","p":{"ff023000000000000011":"Destination Scope","ff023000000000000030":994,"ff023000000000000031":992,"ff023000000000000034":0,"ff023000000000000037":9,"ff023000000000000137":9,"ff023000000000000237":10,"ff023000000000000337":9,"ff023000000000000437":9,"ff023000000000000537":8}},{"o":1,"t":"0168a431d91f2578000b","p":{"ff023000000000000011":"Destination Input","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":9,"ff023000000000000237":2,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":8}},{"o":1,"t":"0168a431d91f2578000c","p":{"ff023000000000000011":"Destination Property","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":9,"ff023000000000000237":2,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":8}},{"o":1,"t":"01621fb84e32000000a0","p":{"01621fb84e320000f001":"private","ff023000000000000011":"Ascender"}},{"o":1,"t":"01621fb84e32000000a1","p":{"ff023000000000000011":"Input","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":0,"ff023000000000000037":2,"ff023000000000000137":10,"ff023000000000000237":2,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":0}},{"o":1,"t":"01621fb84e32000000a2","p":{"ff023000000000000011":"Upward","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":2,"ff023000000000000137":10,"ff023000000000000237":1,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":0}},{"o":1,"t":"01621fb84e32000000d0","p":{"01621fb84e320000f001":"private","ff023000000000000011":"Descender"}},{"o":1,"t":"01621fb84e32000000d1","p":{"ff023000000000000011":"Downward","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":2,"ff023000000000000137":10,"ff023000000000000237":1,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":0}},{"o":1,"t":"01621fb84e32000000d2","p":{"ff023000000000000011":"Output","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":0,"ff023000000000000037":2,"ff023000000000000137":10,"ff023000000000000237":2,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":0}},{"o":1,"t":"01621fb84e320000a000","p":{"ff023000000000000011":"Action"}},{"o":1,"t":"016ac63229782039429f","p":{"017bc044aeacce7ffc8f":0,"ff023000000000000011":"Control Flow"}},{"o":1,"t":"016ac6322acf67eebfe7","p":{"017bc044aeacce7ffc8f":0,"ff023000000000000011":"Control Flow"}},{"o":1,"t":"01621fb84e330000a000","p":{"01703376c4a81c0e9d91":"A function takes inputs and produces outputs.","01703376c4a81c0e9d92":"An Action is the other basic logic brick. It also takes one or several inputs and produces one or several outputs.\nAdditionally, an Action has an input and output *control flows*. The Action is executed when the input control flow is triggered, and it defines all outputs before the output control flow is triggered.<br/><br/>By default, an action is triggered everytime the control flow is triggered, regardless of the value of the other inputs.<br/><br/>An Action can be reused within other Functions, Actions and Visual Components."}},{"o":1,"t":"01621fb84e320000f012","p":{"ff023000000000000011":"Coded Action"}},{"o":1,"t":"01621fb84e330000f012","p":{"01703376c4a81c0e9d91":"An Action implemented using code.","01703376c4a81c0e9d92":"A Coded Action is an Action implemented using code, such as JavaScript or TypeScript.<br/><br/>Coded Actions are typically used to add new functionalities within applications, or to implement more complex logic."}},{"o":1,"t":"0168c6f020f2a96a0000","p":{"ff023000000000000011":"Action Call","ff023000000000000012":true}},{"o":1,"t":"016a9766c230916ea5ec","p":{"ff023000000000000011":"Service"}},{"o":1,"t":"016ac63c5b3ed0562740","p":{"017bc044aeacce7ffc8f":0,"ff023000000000000011":"Control Flow"}},{"o":1,"t":"016a9766c231916ea5ec","p":{"01703376c4a81c0e9d91":"A long running action to be run in a Service Application.","01703376c4a81c0e9d92":"A Service is an Action meant to be run inside a Service App. The Service is triggered when the Service App starts, and runs until the Service App stops.<br/><br/>A Service has no input, and its configuration is therefore generally read from configuration files, APIs or other external sources.<br/><br/>Typical uses of Services are to run batch jobs, expose web services, or listen to outside events such as incoming emails."}},{"o":1,"t":"0169b6876a03f139d50a","p":{"ff023000000000000011":"Interaction Event Definition"}},{"o":1,"t":"016ac63808535703691c","p":{"017bc044aeacce7ffc8f":0,"ff023000000000000011":"Control Flow"}},{"o":1,"t":"0169b6876a03f14ae61b","p":{"ff023000000000000011":"Error Handler Definition"}},{"o":1,"t":"016ac638085357047a2d","p":{"017bc044aeacce7ffc8f":0,"ff023000000000000011":"Error Flow"}},{"o":1,"t":"017a7b07a948e30508fa","p":{"ff023000000000000011":"Remote Action"}},{"o":1,"t":"017a7b07b09e3b22c8b4","p":{"017bc044aeacce7ffc8f":0,"ff023000000000000011":"Control Flow"}},{"o":1,"t":"017a7b07ba05807a74b0","p":{"017bc044aeacce7ffc8f":1,"ff023000000000000011":"User"}},{"o":1,"t":"017a7b0818c12388d731","p":{"017bc044aeacce7ffc8f":0,"ff023000000000000011":"Control Flow"}},{"o":1,"t":"017a7b085146d5e69aec","p":{"017bc044aeacce7ffc8f":1,"ff023000000000000011":"Error Flow"}},{"o":1,"t":"017a7b07a949e30508fa","p":{"01703376c4a81c0e9d91":"An action running remotely in a Service App.","01703376c4a81c0e9d92":"A Remote Action is an Action which is running within a Service App. It behaves and it is used like an action, but it runs remotely. The Remote Action takes care of serializing the inputs, send them to the Service App, executes the content of the Remote Action, and serializes the outputs back to the caller.<br/><br/>Remote Actions are typically used to call APIs, databases, send emails and perform other back-end operations.<br/><br/>A remote action is synchronous, and can therefore be subject to timeouts if running for too long. The timeout value is configurable per environment."}},{"o":1,"t":"017a7b0c5dcbd8964c5d","p":{"fd017a7b0c62a02a89444f":false,"ff023000000000000011":"Remote Action Call","ff023000000000000012":true}},{"o":1,"t":"017a7b0c62a02a89444f","p":{"ff023000000000000011":"listener"}},{"o":1,"t":"011203300000000adf00","p":{"fd011203300000000adf01":0,"fd011203300000000adf02":20000,"ff023000000000000011":"System Information"}},{"o":1,"t":"011203300000000adf01","p":{"ff023000000000000011":"appController timestamp"}},{"o":1,"t":"011203300000000adf02","p":{"ff023000000000000011":"appController heart rate"}},{"o":1,"t":"011203300000000adf0f","p":{}},{"o":1,"t":"01120300000000adef00","p":{"ff023000000000000011":"Application Definition","ff023000000000000012":true}},{"o":1,"t":"0171bc1f15da96dfdb89","p":{"ff023000000000000011":"app project import","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":5,"ff023000000000000237":2,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":0}},{"o":1,"t":"0171bc1f15da96dfdb90","p":{"ff023000000000000011":"deploy data source","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":0,"ff023000000000000037":2,"ff023000000000000137":6,"ff023000000000000237":2,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":2}},{"o":1,"t":"011203300000000adef5","p":{"fd011203300000000adef6":false,"fd011203300000000adef7":false,"fd011203300000000adef8":0,"ff023000000000000011":"Deployment Info"}},{"o":1,"t":"011203300000000adef6","p":{"ff023000000000000011":"activated"}},{"o":1,"t":"011203300000000adef7","p":{"ff023000000000000011":"rebuild"}},{"o":1,"t":"011203300000000adef8","p":{"ff023000000000000011":"status"}},{"o":1,"t":"011203300000000adef9","p":{"ff023000000000000011":"last error"}},{"o":1,"t":"011203300000000adefa","p":{"ff023000000000000011":"project URL"}},{"o":1,"t":"011203300000000adefb","p":{"ff023000000000000011":"project branch"}},{"o":1,"t":"011203300000000adefc","p":{"ff023000000000000011":"build command"}},{"o":1,"t":"011203300000000adefd","p":{"ff023000000000000011":"project config"}},{"o":1,"t":"011203300000000adefe","p":{"ff023000000000000011":"logs"}},{"o":1,"t":"011203300000000adeff","p":{"ff023000000000000011":"port mappings"}},{"o":1,"t":"011203300000000adee0","p":{"ff023000000000000011":"dependencies"}},{"o":1,"t":"011203300000000adef3","p":{"ff023000000000000011":"Service App"}},{"o":1,"t":"011203300000000adef4","p":{"ff023000000000000011":"Deployment Info","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":0,"ff023000000000000037":2,"ff023000000000000137":6,"ff023000000000000237":2,"ff023000000000000337":2,"ff023000000000000437":2,"ff023000000000000537":0}},{"o":1,"t":"011203300001000adef3","p":{"01703376c4a81c0e9d91":"A headless (with no UI) application.","01703376c4a81c0e9d92":"Service Apps are back-end applications that are meant to be run on servers or on any edge or IoT device that does not have a screen. They run in the background and are typically used to capture data from a third party, process data, perform data input validation, etc."}},{"o":1,"t":"017dc8d6c8fd8c8bd2ff","p":{"ff023000000000000011":"Data Connector"}},{"o":1,"t":"0113030000000aca1100","p":{"ff023000000000000011":"Application","ff023000000000000012":true}},{"o":1,"t":"0113032000000aca1102","p":{"ff023000000000000011":"Headless Application","ff023000000000000012":true}},{"o":1,"t":"017ffdc010e5bcc9c971","p":{"fd017ffdc010e5bcc9c972":false,"ff023000000000000011":"Workflow"}},{"o":1,"t":"017ffdc010e5bcc9c972","p":{"ff023000000000000011":"Serialization Enabled"}},{"o":1,"t":"017ffdc010e5bcc9c973","p":{"ff023000000000000011":"Data Type","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":5,"ff023000000000000237":1,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":2}},{"o":1,"t":"017ffdc010e5bcc9c974","p":{"ff023000000000000011":"States","ff023000000000000030":543,"ff023000000000000031":31,"ff023000000000000034":0,"ff023000000000000037":6,"ff023000000000000137":6,"ff023000000000000237":2,"ff023000000000000337":6,"ff023000000000000437":6,"ff023000000000000537":0}},{"o":1,"t":"017ffdc010e5bcc9c975","p":{"ff023000000000000011":"Initial State","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":1,"ff023000000000000137":5,"ff023000000000000237":1,"ff023000000000000337":1,"ff023000000000000437":1,"ff023000000000000537":0}},{"o":1,"t":"017ffdc010e6bcc9c971","p":{"01703376c4a81c0e9d91":"Defines states and transitions between states.","01703376c4a81c0e9d92":"A Workflow defines a set of *states* through which the instances of a Data Type can go through, as well as the transitions allows between those states.<br/><br/>A Workflow can therefore be seen as a state machine. Each transition can have an optional *Process Function*, which can embed any custom logic to:\n- Add predefined processing within a transition\n- Add additional verification logic to allow or deny the transition to happen\n\nEach Workflow is assigned to a Data Type, and can then be used to control the possible states of the instances of that Data Type."}},{"o":1,"t":"017ffdc2dda51d46b430","p":{"ff023000000000000011":"Workflow State"}},{"o":1,"t":"017ffdc2dda61d46b430","p":{"01703376c4a81c0e9d91":"A single state of a workflow sequence.","01703376c4a81c0e9d92":"A Workflow State represents a single state in a workflow."}},{"o":1,"t":"017ffde21f5fe0f704ce","p":{"ff023000000000000011":"Workflow Process Function Definition"}},{"o":1,"t":"017ffe02381f9fac5060","p":{"017bc044aeacce7ffc8f":0,"ff023000000000000011":"Control Flow"}},{"o":1,"t":"017ffe02381f9fac5061","p":{"017bc044aeacce7ffc8f":1,"ff023000000000000011":"Object"}},{"o":1,"t":"017ffe02381f9fac5062","p":{"017bc044aeacce7ffc8f":2,"ff023000000000000011":"User"}},{"o":1,"t":"017ffe02381f9fac5065","p":{"017bc044aeacce7ffc8f":3,"ff023000000000000011":"Data Map"}},{"o":1,"t":"017ffe02381f9fac5063","p":{"017bc044aeacce7ffc8f":0,"ff023000000000000011":"Control Flow"}},{"o":1,"t":"017ffe02381f9fac5064","p":{"017bc044aeacce7ffc8f":1,"ff023000000000000011":"Error Flow"}},{"o":1,"t":"017ffdc633219f16beea","p":{"ff023000000000000011":"Workflow Transition"}},{"o":1,"t":"017ffdc633219f16beec","p":{"ff023000000000000011":"Process"}},{"o":1,"t":"017ffdc2dda51d46b431","p":{"ff023000000000000011":"From State","ff023000000000000030":994,"ff023000000000000031":992,"ff023000000000000034":0,"ff023000000000000037":8,"ff023000000000000137":9,"ff023000000000000237":8,"ff023000000000000337":8,"ff023000000000000437":8,"ff023000000000000537":0}},{"o":1,"t":"017ffdc633219f16beeb","p":{"ff023000000000000011":"To State","ff023000000000000030":514,"ff023000000000000031":0,"ff023000000000000034":0,"ff023000000000000037":8,"ff023000000000000137":9,"ff023000000000000237":1,"ff023000000000000337":8,"ff023000000000000437":8,"ff023000000000000537":0}}],"optionalOperations":[]}
|
package/index.js
CHANGED
|
@@ -488,7 +488,7 @@ olympe.async.Mk=class extends olympe.async.Mp{constructor(a,b){super(a,b);this.R
|
|
|
488
488
|
0<this.D.length){this.R=this.D.length;for(const a of this.D)this.run(a)}else this.complete(!0)}};olympe.Eb={};olympe.Eb.Gv=class{Ob(){return u(function*(){})}ba(){}X(){}D(){}Z(){}forEach(){}has(){}get(){}set(){}remove(){}F(){}N(){}H(){}clear(){}R(){}};olympe.Eb.Hv=class{D(){}};olympe.Eb.Storage=class{open(){}write(){}close(){}};olympe.Eb.Qv=class{get(){return null}set(){return this}delete(){}};olympe.Eb.P={zk:'localStorage.KeyValueDatabaseManager',mj:'localStorage.Storage',iB:'localStorage.DatacloudStorage',Pm:'localStorage.LocalStorage',Ca:'localStorage.Logger',ih:'localStorage.prefix'};olympe.V.config(function(a){Ya(a,olympe.Eb.P.zk);D(a,olympe.Eb.P.ih,[],()=>'olympe');D(a,olympe.Eb.P.Ca,[olympe.ha.P.Ea],b=>b.hd('localstorage'));C(a,olympe.Eb.P.Pm,olympe.Eb.Qv)},'olympe.localstorage');olympe.L={};olympe.L.Sb={qk:'urls.FileSvc',Jo:'urls.BackupSvc',Qr:'urls.RestoreBackupSvc',Rg:'urls.GetContext',cq:'urls.GraphDef',Xo:'urls.StaticGraphDef',TRANSACTION:'urls.Transaction',Es:'urls.UserTagFromToken',nx:'urls.UserNameFromTag',mx:'urls.UserRoles',xw:'urls.RoleMembers',Fk:'urls.OpenIDSvc',Hp:'urls.EventMonitor'};
|
|
489
489
|
olympe.V.config(a=>{E(a,olympe.L.Sb.qk,'rest/filesvc');E(a,olympe.L.Sb.Jo,'rest/backupsvc');E(a,olympe.L.Sb.Qr,'rest/backupsvc/restore');E(a,olympe.L.Sb.Fk,'rest/openid');E(a,olympe.L.Sb.Rg,'rest/initialData');E(a,olympe.L.Sb.cq,'rest/querysvc/graphDef');E(a,olympe.L.Sb.Xo,'rest/querysvc/graphDef/static');E(a,olympe.L.Sb.TRANSACTION,'rest/transaction');E(a,olympe.L.Sb.Es,'rest/token');E(a,olympe.L.Sb.nx,'rest/authorization/getUserTag');E(a,olympe.L.Sb.mx,'rest/authorization/getUserRoles');E(a,olympe.L.Sb.xw,
|
|
490
490
|
'rest/authorization/roleMembers');E(a,olympe.L.Sb.Hp,'rest/backend/event')});function sd(a,b){a.validate=b.ack.bind(b);a.N=b.reject.bind(b);a.H=b.Ai();return a}
|
|
491
|
-
olympe.L.pa=class{constructor(a,b,c,d,e,f){this.fe=c;this.D=a;this.source=b;this.j=d;this.messageType=e;this.F=null!=f?f:null;this.H=!1;this.validate=()=>u(function*(){});this.N=()=>u(function*(){})}static H(a,b,c){const d=olympe.L.pa.D.an,e=a.lc();let f;var g=olympe.L.pa,h=e[olympe.L.pa.D.DESTINATION],k=e[olympe.L.pa.D.hh],l=e[olympe.L.pa.D.Vk],n=e[olympe.L.pa.D.tg],p=e[olympe.L.pa.D.TYPE];b.R=c;return sd(new g(h,k,l,n,p,b.N(null!=(f=e[d])?f:null)),a)}Ai(){return this.H}
|
|
491
|
+
olympe.L.pa=class{constructor(a,b,c,d,e,f){this.fe=c;this.D=a;this.source=b;this.j=d;this.messageType=e;this.F=null!=f?f:null;this.H=!1;this.validate=()=>u(function*(){});this.N=()=>u(function*(){})}static H(a,b,c){const d=olympe.L.pa.D.an,e=a.lc();let f;var g=olympe.L.pa,h=e[olympe.L.pa.D.DESTINATION],k=e[olympe.L.pa.D.hh],l=e[olympe.L.pa.D.Vk],n=e[olympe.L.pa.D.tg],p=e[olympe.L.pa.D.TYPE];b.R=c;return sd(new g(h,k,l,n,p,b.N(null!=(f=e[d])?f:null)),a)}Ai(){return this.H}kc(){return this.D}lb(){return this.source}getType(){return this.messageType}lc(){return this.F}ack(){return this.validate()}reject(){return this.N()}ga(a,
|
|
492
492
|
b){const c=olympe.L.pa.D.an,d={[olympe.L.pa.D.DESTINATION]:this.D,[olympe.L.pa.D.hh]:this.source,[olympe.L.pa.D.Vk]:this.fe,[olympe.L.pa.D.tg]:this.j,[olympe.L.pa.D.TYPE]:this.messageType};null!==this.F&&(a.X=b,d[c]=a.ga(this.F));return d}toString(){return`Message(dest: ${this.D}, src: ${this.source}, seqId: ${this.fe}, topic: ${this.j}, type: ${this.messageType}, payload: ${this.F})`}};olympe.L.pa.D={DESTINATION:'d',hh:'s',Vk:'i',tg:'tp',TYPE:'t',an:'p',Of:'tk'};
|
|
493
493
|
olympe.L.pa.j={SEND:0,GET:1,SUBSCRIBE:2,PUBLISH:3,hl:4,qe:5,tg:6,Bb:7,es:10,ys:11,og:12,Bs:13,nn:14,Yp:15};olympe.L.pa.F={ij:'__hc_i',dn:'__hc_o'};olympe.L.qn=class extends olympe.L.pa{constructor(a,b,c,d,e,f,g){super(a,b,d,e,f,g);this.jd=c}static H(a,b,c){const d=olympe.L.pa.D.an,e=a.lc();let f;var g=olympe.L.qn,h=e[olympe.L.pa.D.DESTINATION],k=e[olympe.L.pa.D.hh],l=e[olympe.L.pa.D.Of],n=e[olympe.L.pa.D.Vk],p=e[olympe.L.pa.D.tg],q=e[olympe.L.pa.D.TYPE];b.R=c;b=new g(h,k,l,n,p,q,b.N(null!=(f=e[d])?f:null));sd(b,a);return b}ye(){return this.jd}ga(a,b){return Object.assign(super.ga(a,b),{[olympe.L.pa.D.Of]:this.jd})}toString(){return`SignedMessage{dest: ${this.D}, src: ${this.source}, seqId: ${this.fe}, topic: ${this.j}, type: ${this.messageType}, token: ${this.jd}, payload: ${this.F}}`}};const td=olympe.L.pa.j.SEND,ud=olympe.L.pa.j.GET,vd=olympe.L.pa.j.SUBSCRIBE,wd=olympe.L.pa.j.og,xd=olympe.L.pa.j.es,yd=olympe.L.pa.j.Bb,zd=olympe.L.pa.j.hl,Ad=olympe.L.pa.j.tg,Bd=olympe.L.pa.j.ys;
|
|
494
494
|
olympe.L.Lc=class{constructor(a,b,c){this.j=a;this.D=b;this.F=c;this.user=null;Object.defineProperties(this,{D:{enumerable:!1},F:{enumerable:!1}})}Fi(){return null!==this.user?Promise.resolve(this.user):Cd(this.D,this.j).then(a=>this.user=a)}Ai(){return this.j.Ai()}Gt(){return this.j.getType()}source(){return this.j.lb()}body(){return this.j.lc()}ack(){const a=this;return u(function*(){if(a.j.getType()!==td)throw Error('Should only call `ack` on SEND requests');yield a.j.ack();yield a.D.Rc(a.j,xd)})}Rc(a){const b=
|
|
@@ -516,8 +516,8 @@ a.G.error(`Received ${k.length} PING-PONG responses -> error for ${q} -> ${r}`);
|
|
|
516
516
|
olympe.L.em=class{constructor(a,b,c,d,e,f,g,h){this.G=olympe.ha.Va('bus');this.X=olympe.ha.Va('communication');this.Ga=b;this.R=c;this.jb=d;this.kf=e;this.jf=f;this.va=new Map;this.j=`${'olympe-runtime'}-${olympe.U.Pc()}`;this.gd=g.get('requestTimeout');this.oh=g.get('subscriptionsRefreshRate');this.Yd=g.get('allowGuest');b=rxjs.combineLatest([g.get('connection'),this.R.jd.ub().asObservable(),this.Ga.uf().asObservable()]).pipe(rxjs.operators.map(([k,l,n])=>n.valueOf()?Object.assign({},k,{user:l.Dc(),
|
|
517
517
|
jd:l.Bd()}):null)).pipe(rxjs.operators.distinctUntilChanged((k,l)=>[...Object.keys(null!=l?l:{})].every(n=>(null!=k?k:{})[n]===(null!=l?l:{})[n])));this.D=a.N(b,this.j);Od(this);this.H='';Sd(this,g.get('topicPrefix'));this.Fl=this.vb=0;this.F=null;this.Z=!1;this.ba=[];this.ia=new Map;this.N=new Set;this.zc=new Map;this.Xa=new olympe.U.di(this.gd);this.ge='';this.Xc=0;this.Ac=h;this.Vf='';this.Nb=this.kd=!1}connect(){return new Promise((a,b)=>{const c=d=>{b(d);this.ba.forEach(e=>e(d));this.ba=[]};
|
|
518
518
|
Ld(this)?a():this.Z||this.kd?this.ba.push(d=>d?b(d):a()):Nd(this.Ga)?(this.kd=!0,olympe.C.Dt([this.R.Dl()],d=>{Wd(this);this.kd=!1;d.valueOf()||this.Yd?(this.Yd||he(this.R,()=>this.disconnect().then()),this.Z=!0,this.ba.push(e=>e?b(e):a()),this.D.connect().catch(e=>{this.Z=!1;c(e)}),this.Vf=this.jb.Ga(()=>this.disconnect(),'Bus websocket')):c(Error('Guest user is not allowed to connect to RabbitMQ, you can allow guest with the bus.allowGuest oConfig parameter!'))})):c(Error('Cannot connect to the bus if working offline'))})}disconnect(){const a=
|
|
519
|
-
this;return u(function*(){a.G.debug('Disconnecting from bus');a.R.R.delete('busLogoutCallback');a.jb.D(a.ge);a.jb.F(a.Vf);yield a.D.disconnect()})}qd(a,b=!1){const c=this;return u(function*(){if(!c.Z||a.getType()!==olympe.L.pa.j.og){Ld(c)||(yield c.connect());var d=a.D.startsWith('olympe-runtime'),e=d?a.
|
|
520
|
-
}var g=Md.has(a.getType());yield c.D.qd(a.fe,e,f,{mandatory:g,Rt:!(d||b)});Yd(c,a.fe.toString(),'publish',(new Map).set('destination',a.
|
|
519
|
+
this;return u(function*(){a.G.debug('Disconnecting from bus');a.R.R.delete('busLogoutCallback');a.jb.D(a.ge);a.jb.F(a.Vf);yield a.D.disconnect()})}qd(a,b=!1){const c=this;return u(function*(){if(!c.Z||a.getType()!==olympe.L.pa.j.og){Ld(c)||(yield c.connect());var d=a.D.startsWith('olympe-runtime'),e=d?a.kc():Vd(c,a.kc(),!0);try{Yd(c,a.fe.toString(),'serialize');var f=a.ga(c.kf,c.Bl.bind(c,a.j,a.fe));c.X.j()&&c.X.j()&&c.X.debug(`BUS > #${e}:`,JSON.stringify(f))}catch(h){throw Error(`An error occurred while serializing the message (seqId=${a.fe}): ${h}`);
|
|
520
|
+
}var g=Md.has(a.getType());yield c.D.qd(a.fe,e,f,{mandatory:g,Rt:!(d||b)});Yd(c,a.fe.toString(),'publish',(new Map).set('destination',a.kc()).set('messageType',a.getType().toString()))}})}Bl(a,b,c){const d=this.Fl++;(()=>{const e=this;return u(function*(){let f;try{f=yield be(e,a,b)}catch(p){e.G.error(`Error to get the destSessionId for the stream ${d}: ${p}`);return}const g=p=>e.qd(new olympe.L.pa(f,e.j,b,a,olympe.L.pa.j.qe,p)),h=olympe.L.Re.Og,k=olympe.L.Re.Kh,l=olympe.L.Re.Bb;let n=0;try{for(const p=
|
|
521
521
|
ia(c);;){const q=yield p.next();if(q.done)break;const r=q.value;yield g({id:d,i:n++,e:h,c:r})}yield g({id:d,s:n,e:k})}catch(p){yield g({id:d,e:l,reason:`Error to complete the stream: ${p}`})}})})();return d}Rc(a,b,c){return this.send(a.fe,a.lb(),a.lb(),b,c)}send(a,b,c,d,e){return this.qd(new olympe.L.pa(c,this.j,a,b,d,e))}request(a,b,c,d,e,f){const g=ce(this,a,b,c,d);return c===olympe.L.pa.j.PUBLISH?this.qd(g,e):new Promise((h,k)=>{ee(this,g,h,null!=f?f:this.gd);this.qd(g,e).catch(k)})}zl(a,b){const c=
|
|
522
522
|
olympe.L.pa.D.hh;a=olympe.L.pa.D.Vk;var d=olympe.L.pa.D.Of;const e=b.lc();this.X.j()&&this.X.debug(`BUS < #${b.N}:`,JSON.stringify(e));Yd(this,e[a],'consumed');a=void 0===e[d]?olympe.L.pa.H:olympe.L.qn.H;d=null;let f=!1;try{d=a.call(null,b,this.kf,h=>{f=!0;return $d(this,e[c],h).stream}),Md.has(d.getType())||b.ack().catch(h=>this.G.error(`Failed to ack message: ${h}`))}catch(h){this.G.error(`An error occurred while trying to deserialize the message: ${JSON.stringify(e)} with error ${h}`);b.reject().catch(k=>
|
|
523
523
|
this.G.error(`Failed to reject message: ${k}`));return}const g=d;b=g.fe;Yd(this,b.toString(),'deserialized',(new Map).set('source',g.lb()).set('messageType',g.getType().toString()));switch(g.getType()){case olympe.L.pa.j.qe:ae(this,g);break;case olympe.L.pa.j.Yp:this.Rc(g,olympe.L.pa.j.nn).catch(k=>this.G.error(`Failed to reply to get session message: ${k}`));break;case olympe.L.pa.j.nn:let h;null==(h=this.zc.get(b))||h.forEach(k=>k(g.lb()));break;default:f&&this.Rc(g,olympe.L.pa.j.nn).catch(k=>this.G.error(`Failed to send session id for stream publishing: ${k}`));
|
|
@@ -617,34 +617,34 @@ function Kf(a){var b=Lf;console.debug(`Start watching config files for changes:
|
|
|
617
617
|
function Mf(){console.log('The node process received a signal for graceful shutdown');let a,b,c,d;(null!=(d=null==(b=(a=olympe.Wa.node.host).wl)?void 0:null==(c=b.call(a))?void 0:dd(c))?d:Promise.resolve()).then(()=>console.log('The node backend has stopped successfully')).catch(e=>console.warn(e)).finally(()=>process.exit(0))}process.on('SIGTERM',Mf);process.on('SIGINT',Mf);process.on('SIGBREAK',Mf);process.on('SIGHUP',Mf);
|
|
618
618
|
process.on('uncaughtException',a=>{console.error('Uncaught Exception:',a);Mf()});const Lf=['oConfig.json','conf.d/oConfig.json','version.json'];If&&Lf.push(If);
|
|
619
619
|
olympe.U.yt(Lf).then(a=>{try{const b=Object.create(null),c=process.argv;for(let f=2;f<c.length;f++){const g=/([^?&=]+)(=?([^?&=]+))?/g.exec(c[f]);!Array.isArray(g)||4>g.length?console.warn(`Malformed config parameter "${c[f]}" ignored. It should of the form 'a=b'`):b[g[1]]=olympe.U.Rs(g[3])}const d=new olympe.V.su(a,b);Ma(d);const e=d.compile();Oa(e);Kf(e)}catch(b){console.error(`Failed to start Olympe: ${b}`),process.exit(1)}}).catch(a=>{console.error(`Failed to load config files: ${a.message}.`);
|
|
620
|
-
setInterval(()=>{},1073741824)});olympe.dc={};olympe.dc.ua={ORIGIN:'<',DESTINATION:'>'};w('olympe.dc.Direction',olympe.dc.ua);olympe.dc.
|
|
621
|
-
olympe.dc.Hb={NONE:null,wp:'ff023000000000000037',Jc:'ff023000000000000137',qg:'ff023000000000000237',Mw:'ff023000000000000337',zu:'ff023000000000000437',lx:'ff023000000000000537',nC:olympe.dc.oe.ng+'ff023000000000000037',oC:olympe.dc.oe.ng+'ff023000000000000237',mC:olympe.dc.oe.ng+'ff023000000000000437',xE:olympe.dc.oe.ng+'ff023000000000000537'};olympe.dc.sr=class extends Error{constructor(a){var b=olympe.dc.fa(),c=olympe.dc.le(),d=b.model(a);d=`\n- model: ${d} (${d?b.name(d):'no name'})`;b=b.source(a);c=`\n- source: ${b} (${b?c.lb(b).name():'no name'})`;super(`Trying to use a CloudObject that does not exist:\n- tag: ${a}${d}${c}${''}`)}};olympe.dc.jr=class extends Error{constructor(){var a=Nf();super('Try to access a resource not available yet: BusinessContainer, wait for it to be ready');this.j=a}};olympe.dc.Writable=class{Yc(){}dd(){}D(){}La(){}
|
|
620
|
+
setInterval(()=>{},1073741824)});olympe.dc={};olympe.dc.ua={ORIGIN:'<',DESTINATION:'>'};w('olympe.dc.Direction',olympe.dc.ua);olympe.dc.hc={ed:'ff022000000000000000',Pi:'ff02200000000000000e',fk:'ff02200000000000000f'};olympe.dc.Fq={VERSION:'@v',hh:'@s'};olympe.dc.oe={af:'?',ng:'~'};olympe.dc.HD={fj:'online',Jf:'offline',lC:'invalidate'};olympe.dc.Ia={SELF:'self',SERVER:'server',cf:'remote'};
|
|
621
|
+
olympe.dc.Hb={NONE:null,wp:'ff023000000000000037',Jc:'ff023000000000000137',qg:'ff023000000000000237',Mw:'ff023000000000000337',zu:'ff023000000000000437',lx:'ff023000000000000537',nC:olympe.dc.oe.ng+'ff023000000000000037',oC:olympe.dc.oe.ng+'ff023000000000000237',mC:olympe.dc.oe.ng+'ff023000000000000437',xE:olympe.dc.oe.ng+'ff023000000000000537'};olympe.dc.sr=class extends Error{constructor(a){var b=olympe.dc.fa(),c=olympe.dc.le(),d=b.model(a);d=`\n- model: ${d} (${d?b.name(d):'no name'})`;b=b.source(a);c=`\n- source: ${b} (${b?c.lb(b).name():'no name'})`;super(`Trying to use a CloudObject that does not exist:\n- tag: ${a}${d}${c}${''}`)}};olympe.dc.jr=class extends Error{constructor(){var a=Nf();super('Try to access a resource not available yet: BusinessContainer, wait for it to be ready');this.j=a}};olympe.dc.Writable=class{Yc(){}dd(){}D(){}La(){}jc(){}};olympe.dc.Dr=class{ic(){}T(){}H(){}};olympe.dc.rc=class{constructor(a){this.tag='string'===typeof a?a:a.W()}W(){return this.tag}Fa(a){return a instanceof olympe.dc.rc&&this.tag===a.tag}};olympe.dc.rc.ya=[olympe.dc.bf];olympe.dc.rc.prototype.Fa.K=olympe.C.J.j;olympe.dc.Ju=class a{constructor(b,c,d,e,f,g){this.G=b;this.Z=c;this.db=c.view;this.ba=d;this.Lb=e;this.D=f;this.N=g;this.j=new Map;this.F=ib(new olympe.U.di(6E5),(h,k)=>{URL.revokeObjectURL(k);Of(this.db,h,a.j(h))})}ia(b,c,d,e,f){this.Xa(c).then(g=>{this.jb(b,g,d,!!this.N,e,f)}).catch(g=>this.G.error(g))}H(b){const c=this;return u(function*(){const d=f=>{f=`Failed to download file ${b.W()}: ${f}`;c.G.error(f);throw Error(f);},e=b.W();if(gb(c.F.j,e)){const f=c.F.get(e);return c.D.F(f).then(g=>g.arrayBuffer()).then(g=>
|
|
622
622
|
new Uint8Array(g,0,g.byteLength)).catch(d)}return c.downloadFileContent(b).then(f=>c.D.H(f)).then(f=>{if(c.N){let g;const h=null!=(g=b.get(olympe.dm.File.mimeTypeProp))?g:'application/data';c.R(e,new Blob([f],{type:h}))}return f}).catch(d)})}downloadFileContent(b){var c=b.W(),d=b.get(olympe.dm.File.j);const e=b.get(olympe.dm.File.urlProp);if(e.startsWith('stream:'))return this.X(c).then(()=>this.downloadFileContent(b));if(e.startsWith('blob:'))return this.D.F(e).then(f=>f.arrayBuffer()).then(f=>new Uint8Array(f,
|
|
623
623
|
0,f.byteLength));if(d)return d=this.db.model(b),c=new olympe.dc.Request(olympe.dc.Request.j.kg,olympe.dc.le().ue(b),{tag:c,model:d,url:e.valueOf()}),this.Lb.request(c);c=N(e);Gc(c,olympe.net.ra.ResponseType.$l);return Hc(this.ba,c).then(f=>{const g=f.Oc();if(200<=g&&300>g)return f.getData();throw Error(`Failed to download file ${b}. Response code ${g}`);})}va(b,c,d){c=new olympe.dc.Request(olympe.dc.Request.j.ig,d,{tag:b,model:c});return this.Lb.request(c).then(()=>this.G.debug(`Successfully deleted file: ${b}`)).catch(e=>
|
|
624
|
-
{throw Error(`Failed to delete file ${b}: ${e.message}`);})}Ga(b){const c=new olympe.U.stream.sg;this.H(b).then(d=>{eb(d).pipeTo(c).catch(()=>{})});return c}vb(b,c){this.D.H(c).then(d=>{d=URL.createObjectURL(new Blob([d]));const e=new olympe.dc.db.
|
|
624
|
+
{throw Error(`Failed to delete file ${b}: ${e.message}`);})}Ga(b){const c=new olympe.U.stream.sg;this.H(b).then(d=>{eb(d).pipeTo(c).catch(()=>{})});return c}vb(b,c){this.D.H(c).then(d=>{d=URL.createObjectURL(new Blob([d]));const e=new olympe.dc.db.fc;e.dd(b,(new Map).set(olympe.dm.File.urlProp.W(),d));this.Z.sd(Pf(e));let f;null==(f=this.j.get(b))||f.forEach(g=>g(null))}).catch(d=>{let e;null==(e=this.j.get(b))||e.forEach(f=>f(d))}).finally(()=>{this.j.delete(b)})}X(b){return new Promise((c,d)=>{let e;
|
|
625
625
|
const f=null!=(e=this.j.get(b))?e:[];f.push(g=>g?d(g):c());this.j.set(b,f)})}jb(b,c,d,e,f,g){const h=e?k=>{this.R(b,new Blob([c],{type:d}));f(k)}:f;e=this.db.model(b);e=new olympe.dc.Request(olympe.dc.Request.j.ug,olympe.dc.le().ue(b),{tag:b,model:e,content:c,mimeType:d});this.Lb.request(e).then(k=>h(null!=k?k:'')).catch(null!=g?g:this.G.error.bind(this.G))}Xa(b){return u(function*(){var c=b instanceof olympe.C.Ta?b.valueOf():b;return'string'===typeof c?ab(c):c instanceof ArrayBuffer?new Uint8Array(c,
|
|
626
|
-
0,c.byteLength):c instanceof Blob?(c=yield c.arrayBuffer(),new Uint8Array(c,0,c.byteLength)):c})}R(b,c){const d=olympe.dc.ea(b);b=URL.createObjectURL(c);this.F.set(d,b);const e=a.j(d);Qf(this.db,d,f=>{f||(this.F.delete(d),Of(this.db,d,e))},e)}static j(b){return`cacheBinary${b}`}};function Rf(a,b){let c=Sf(b),d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.lf(b);if(null===b)break;c=Sf(b)}let e;return null!=(e=c)?e:null}olympe.dc.av=class{constructor(a,b,c){this.G=a;this.j=b;this.db=b.view;this.D=c;this.Sa=new FinalizationRegistry(d=>{this.G.F()&&this.G.debug(`Collect instance ${d} (${this.db.name(d)||'no name'})`);this.j.detach([d],olympe.dc.db.Instance.j.vq)})}};function Tf(a,b){a.origin=b;return a}function Uf(a,b,c){a.D.set(b,c);return a}function Vf(a){let b;return null!=(b=a.D)?b:new Map}olympe.dc.Request=class{constructor(a,b,c,d){this.type=a;this.origin=olympe.dc.Ia.SELF;this.j=b;this.content=null!=c?c:null;this.user=null!=d?d:de(olympe.auth.we()).ze();this.D=new Map}getType(){return this.type}Dc(){return this.user}
|
|
626
|
+
0,c.byteLength):c instanceof Blob?(c=yield c.arrayBuffer(),new Uint8Array(c,0,c.byteLength)):c})}R(b,c){const d=olympe.dc.ea(b);b=URL.createObjectURL(c);this.F.set(d,b);const e=a.j(d);Qf(this.db,d,f=>{f||(this.F.delete(d),Of(this.db,d,e))},e)}static j(b){return`cacheBinary${b}`}};function Rf(a,b){let c=Sf(b),d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.lf(b);if(null===b)break;c=Sf(b)}let e;return null!=(e=c)?e:null}olympe.dc.av=class{constructor(a,b,c){this.G=a;this.j=b;this.db=b.view;this.D=c;this.Sa=new FinalizationRegistry(d=>{this.G.F()&&this.G.debug(`Collect instance ${d} (${this.db.name(d)||'no name'})`);this.j.detach([d],olympe.dc.db.Instance.j.vq)})}};function Tf(a,b){a.origin=b;return a}function Uf(a,b,c){a.D.set(b,c);return a}function Vf(a){let b;return null!=(b=a.D)?b:new Map}olympe.dc.Request=class{constructor(a,b,c,d){this.type=a;this.origin=olympe.dc.Ia.SELF;this.j=b;this.content=null!=c?c:null;this.user=null!=d?d:de(olympe.auth.we()).ze();this.D=new Map}getType(){return this.type}Dc(){return this.user}kc(){return this.j}toString(){return`Request of type ${this.type}, from ${this.origin} to ${this.j}; content: ${this.content}`}};
|
|
627
627
|
olympe.dc.Request.j={tc:1,Rg:10,Lu:24,eq:25,Mu:28,$g:30,Pk:31,cD:32,hf:40,lh:41,Ko:42,Rr:43,sE:44,Ji:45,Mo:46,rk:47,ug:50,kg:51,ig:52,ix:60,uw:61,Zp:62,eC:63,mu:64,Dh:65,jk:91,Nu:93,Sm:95,QUERY_RESULT:97};function Wf(a,b,c,d,e){const f=olympe.C.rh();a.sources.set(olympe.dc.Ia.SERVER,e.init(a));a.F?a.sources.set(olympe.dc.Ia.cf,d.init(a)):Qf(b,a.j,()=>{a.sources.set(olympe.dc.Ia.cf,d.init(a));const g=new Map;olympe.dc.la.from(a.j,a.j).bb(olympe.dm.DataSource.Tj).filter(olympe.dc.query.za.Fa(olympe.dm.DataSource.li,!0)).observe(f).subscribe(h=>{var k=h.Kj();for(var l of k){const [p,q]=g.get(l);c.D(p);c.F(q);k=a.sources.get(l);a.sources.delete(l);var n=void 0;null==(n=k)||n.destroy()}h=h.Dj();for(const p of h)if(h=
|
|
628
628
|
p.W(),!a.sources.has(h)){const q=new olympe.dc.sources.Pq(a.G,p);a.sources.set(h,q);l=c.j(()=>q.healthCheck(),h,olympe.host.Oe.j.ALL);n=c.H(()=>q.destroy(),`Datasource ${h}`);g.set(h,[l,n]);q.init(a)}});Of(b,a.j,'router',!0)},'router')}function Xf(a,b,c){let d=a.D.get(b);void 0===d&&(d=[],a.D.set(b,d));d.push(c)}
|
|
629
|
-
olympe.dc.zw=class{constructor(a,b,c,d,e,f,g){this.G=a;this.j=f;this.F=g;this.sources=new Map;this.D=new Map;Wf(this,d,e,b,c)}request(a){this.G.debug('Router: sends',a);return this.lb(a.
|
|
629
|
+
olympe.dc.zw=class{constructor(a,b,c,d,e,f,g){this.G=a;this.j=f;this.F=g;this.sources=new Map;this.D=new Map;Wf(this,d,e,b,c)}request(a){this.G.debug('Router: sends',a);return this.lb(a.kc()).request(a)}subscribe(a,b){this.G.debug('Router: subscribes',a);return this.lb(a.kc()).subscribe(a,b)}Rc(a){if(a.kc()!==this.j)this.G.error(`Router: try to reply to a request that is not for this data cloud, ignore it: ${a}`);else{var b;null==(b=this.D.get(a.getType()))||b.forEach(c=>c(a))}}Bi(a){let b;null==
|
|
630
630
|
(b=this.D.get(a.getType()))||b.forEach(c=>c(a));return this.lb(olympe.dc.Ia.cf).Bi(a)}lb(a){let b;return null!=(b=this.sources.get(a))?b:this.sources.get(olympe.dc.Ia.cf)}};function Pf(a,b){b=new olympe.dc.Pg(a.T(),null!=b?b:null);b.j=a;return b}function Yf(a,b,c,d){c=new olympe.dc.Pg(null!=d?d:olympe.U.Pc(),null!=c?c:null);c.D=b;c.Ha=a;return c}
|
|
631
|
-
olympe.dc.Pg=class{constructor(a,b){this.id=a;this.Ha=this.j=this.D=null;this.ol=b}static j(a){return Yf(a.p,a.s,a.t,a.i)}T(){return this.id}
|
|
632
|
-
this.id),this.Ha=null,this.j):new olympe.dc.db.
|
|
631
|
+
olympe.dc.Pg=class{constructor(a,b){this.id=a;this.Ha=this.j=this.D=null;this.ol=b}static j(a){return Yf(a.p,a.s,a.t,a.i)}T(){return this.id}ic(a){return this.j instanceof olympe.dc.db.fc?this.j.ic(a):Array.isArray(this.Ha)?(new olympe.dc.transaction.hj(this.D)).D(this.Ha,a):a}H(){let a,b,c,d;return null!=(d=null!=(c=null==(a=this.Ha)?void 0:a.length)?c:null==(b=this.j)?void 0:b.H())?d:0}ec(){return this.j instanceof olympe.dc.db.fc?this.j:Array.isArray(this.Ha)?(this.j=(new olympe.dc.transaction.hj(this.D)).j(this.Ha,
|
|
632
|
+
this.id),this.Ha=null,this.j):new olympe.dc.db.fc(this.id)}ul(){if(Array.isArray(this.Ha))return this.Ha;if(this.j instanceof olympe.dc.db.fc){const a=new olympe.dc.transaction.Me;this.j.ic(a);return Zf(a)}return[]}ga(){return{p:this.ul(),t:this.ol,s:this.D,i:this.id}}};olympe.dc.Pg.ya=[olympe.dc.Dr];olympe.dc.Sa={};const $f=olympe.dc.ua.ORIGIN,ag=olympe.dc.ua.DESTINATION,bg=new Map,cg=new Map,dg=new Map,eg=new Map;function Sf(a){let b;return null!=(b=bg.get(a))?b:null}function fg(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.uo||[])];return olympe.dc.oa.j(b,c,...a)}function gg(a,b){eg.set(a,b);return a}function hg(a){let b,c;return null!=(c=null==(b=bg.get(a))?void 0:b.D)?c:olympe.dc.CloudObject}
|
|
633
633
|
function ig(a,b,c){const d=a+'@'+(b===ag?$f:ag);if(cg.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);cg.set(d,c)}function jg(a){a=a.W()+'@'+a.Ma();return cg.get(a)||olympe.dc.CloudObject}function Q(a,b){b.NAME=a;dg.set(a,b)}function R(a){let b;return null!=(b=a.NAME)?b:null}
|
|
634
634
|
olympe.dc.oa=class{constructor(){}static j(a,b,...c){if(bg.has(a))throw Error(`Tag: ${a} - overwriting already defined CloudObject class ${bg.get(a).D.name} with ${b.name}`);let d=null;const e=c.length;if(0<e){d=Array(e);for(let f=0;f<e;f++){let g=c[f];d[f]='string'===typeof g?new olympe.V.rb(g):g}}b=new olympe.dc.Sa.Entry(a,b,d);bg.set(a,b);return b.D.entry=b}static Yb(a){let b,c;return null!=(c=null==(b=a.entry)?void 0:b.W())?c:null}};function kg(a,b){a.j=b}function S(a,b){b=b.ac();ig(b.W(),b.Ma(),a.D);return b}function lg(a){a.F=!0;return a}
|
|
635
635
|
olympe.dc.Sa.Entry=class{constructor(a,b,c){this.tag=a;this.D=b;this.uo=c||null;this.j=null;this.F=!1}W(){return this.tag}instantiate(a,b){const c=this.D;if(this.fo()&&b.getParameter(olympe.dc.Config.Fp)){var d=olympe.dc.fa();d=`Trying to instantiate an abstract class ${d.name(this)} (${this.W()}).`+` This may happen when the implementation of another class extending ${d.name(this)} has not been registered`;olympe.ha.Va('dc').error(d)}return this.uo?(a=[void 0,a].concat(Qa(b,this.uo)),new c(...a)):
|
|
636
636
|
new c(void 0,a)}ja(a){return new olympe.dc.Sa.Property(a)}sa(a,b=olympe.dc.ua.DESTINATION){ig(a,b,this.D);return new olympe.dc.aa.df(a,b)}fo(){return this.F}};w('olympe.dc.registry.Entry',olympe.dc.Sa.Entry);olympe.dc.Sa.Entry.prototype.addRelation=olympe.dc.Sa.Entry.prototype.sa;olympe.dc.Sa.Entry.prototype.addProperty=olympe.dc.Sa.Entry.prototype.ja;olympe.dc.Sa.Entry.ya=[olympe.dc.bf];olympe.dc.Sa.Property=class{constructor(a){this.tag=a}W(){return this.tag}toString(){return`Property: ${this.tag}`}};olympe.dc.Sa.Property.prototype.getTag=olympe.dc.Sa.Property.prototype.W;olympe.dc.Sa.Property.ya=[olympe.dc.bf];olympe.dc.Sa.Relation=class{constructor(a,b=olympe.dc.ua.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.ea(a);this.direction=b;this.origin=c;this.H=d}W(){return this.tag}Ma(){return this.direction}type(){return this.H}ac(){return new olympe.dc.Sa.Relation(this.tag,this.direction===olympe.dc.ua.DESTINATION?olympe.dc.ua.ORIGIN:olympe.dc.ua.DESTINATION,this.H,this.origin)}Fa(a){return a instanceof olympe.dc.Sa.Relation?a.W()===this.W()&&a.Ma()===this.Ma():!1}toString(){return`${this.direction}${olympe.dc.fa().name(this.tag)} (${this.tag})`}};
|
|
637
|
-
olympe.dc.Sa.Relation.prototype.getInverse=olympe.dc.Sa.Relation.prototype.ac;olympe.dc.Sa.Relation.prototype.getDirection=olympe.dc.Sa.Relation.prototype.Ma;olympe.dc.Sa.Relation.prototype.getTag=olympe.dc.Sa.Relation.prototype.W;olympe.dc.Sa.Relation.ya=[olympe.dc.bf];olympe.dc.db={};function mg(a,b){const c=a.H,d=olympe.dc.fa(),e=olympe.dc.db.Database.D.jj,f=olympe.dc.db.Database.D.af,g=olympe.dc.db.Database.D.ORIGIN,h=olympe.dc.db.Database.D.DESTINATION,k=new olympe.dc.db.
|
|
638
|
-
y===e?t.set(z,v):y===f?t.set(x,v):y===g?v.forEach((A,K)=>{k.La(z,K,r)}):y===h&&v.forEach((A,K)=>{k.La(z,r,K)})});l=l.source();k.Yc(r,l,t)}else{const r=new Map;for(const t of l.xb().keys()){var q=t[0]===f;const v=q?t.substring(1):t;q=q?og(p,v,!0):p.Oa(v,!0);let x;r.set(t,null!=(x=q)?x:null)}0<r.size&&k.dd(n,r);for(const [t,v,x]of l.Md())x?k.
|
|
637
|
+
olympe.dc.Sa.Relation.prototype.getInverse=olympe.dc.Sa.Relation.prototype.ac;olympe.dc.Sa.Relation.prototype.getDirection=olympe.dc.Sa.Relation.prototype.Ma;olympe.dc.Sa.Relation.prototype.getTag=olympe.dc.Sa.Relation.prototype.W;olympe.dc.Sa.Relation.ya=[olympe.dc.bf];olympe.dc.db={};function mg(a,b){const c=a.H,d=olympe.dc.fa(),e=olympe.dc.db.Database.D.jj,f=olympe.dc.db.Database.D.af,g=olympe.dc.db.Database.D.ORIGIN,h=olympe.dc.db.Database.D.DESTINATION,k=new olympe.dc.db.fc('rev-'+b.T());a.G.debug('Generate the reverse graphLayer of',b.T());b.Cb.forEach((l,n)=>{if(l.D()){k.D(n,olympe.dc.Hb.NONE);for(const [r,t]of l.Md())k.jc(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(l.Dd())for(const r of ng(d,n,l.F())){l=c.get(r);const t=new Map;l.forEach((v,x)=>{const y=x[0],z=x.substring(1);
|
|
638
|
+
y===e?t.set(z,v):y===f?t.set(x,v):y===g?v.forEach((A,K)=>{k.La(z,K,r)}):y===h&&v.forEach((A,K)=>{k.La(z,r,K)})});l=l.source();k.Yc(r,l,t)}else{const r=new Map;for(const t of l.xb().keys()){var q=t[0]===f;const v=q?t.substring(1):t;q=q?og(p,v,!0):p.Oa(v,!0);let x;r.set(t,null!=(x=q)?x:null)}0<r.size&&k.dd(n,r);for(const [t,v,x]of l.Md())x?k.jc(t,n,v):k.La(t,n,v)}}});return k}
|
|
639
639
|
function pg(a,b,c){const d=b.T();if(a.F.has(d))throw Error(`You try to execute the patch ${d} a second times whereas the first execution has not been validated yet.`);const e=new qg(b,mg(a,b));a.D.unshift(d);a.F.set(d,e);a.H.Bl(c);a.write(b,!1,!1)}
|
|
640
640
|
function rg(a,b,c){if(0>=a.N||null===c)return b;var d=a.j.findIndex(h=>h.T()===b.T()),e=a.j[d];-1<d&&a.j.splice(d,1);d=0<a.j.length?a.j.findIndex(h=>c>=h.D):0;d=-1<d?d:a.j.length;const f=a.j.slice(0,d).reduce((h,k)=>k.sd(h),b);let g;e=null!=(g=null==e?void 0:e.update(f,c))?g:new sg(f,c,a.j,a.N);a.j.splice(d,0,e);a.G.F()&&a.G.debug('CommitController buffer:\n',a.j.map(h=>`${h.T()} at ${h.D}`).join('\n'));return f}
|
|
641
641
|
function tg(a,b,c){return a.D.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>{let f;return null!=(f=null==e?void 0:e.sd(d))?f:d},b)}function ug(a,b,c,d=!1){return u(function*(){const e=new olympe.dc.db.yn(a.G,a.H,a.fa,c);e.open(d);for(const f=ia(b);;){const g=yield f.next();if(g.done)break;e.write(g.value,a.R)}e.close()})}
|
|
642
|
-
function vg(a,b,c,d){b=b.pipeThrough(olympe.U.stream.tap(e=>{0<a.D.length&&rg(a,tg(a,e.
|
|
643
|
-
olympe.dc.db.qu=class{constructor(a,b,c,d){this.G=a;this.H=b;this.fa=c;let e;this.R=null!=(e=d.get('debug'))?e:!1;let f;this.N=null!=(f=d.get('bufferTimeout'))?f:0;this.D=[];this.F=new Map;this.j=[];b.addEventListener(olympe.dc.db.Database.j.Vp,g=>{this.j.forEach(h=>{for(const k of g)h.j.j(k)})})}sd(a,b,c){const d=a.T(),e=a.ol;this.F.has(d)?this.push(d,e):(a=rg(this,tg(this,a.
|
|
642
|
+
function vg(a,b,c,d){b=b.pipeThrough(olympe.U.stream.tap(e=>{0<a.D.length&&rg(a,tg(a,e.ec(),a.D.length),e.ol)}));return ug(a,b,c,d).then(()=>a.G.debug('Rebase stream completed')).catch(e=>a.G.error('Rebase stream failed:',e))}
|
|
643
|
+
olympe.dc.db.qu=class{constructor(a,b,c,d){this.G=a;this.H=b;this.fa=c;let e;this.R=null!=(e=d.get('debug'))?e:!1;let f;this.N=null!=(f=d.get('bufferTimeout'))?f:0;this.D=[];this.F=new Map;this.j=[];b.addEventListener(olympe.dc.db.Database.j.Vp,g=>{this.j.forEach(h=>{for(const k of g)h.j.j(k)})})}sd(a,b,c){const d=a.T(),e=a.ol;this.F.has(d)?this.push(d,e):(a=rg(this,tg(this,a.ec(),this.D.length),e),this.write(a,b,c))}push(a,b){const c=this.D.indexOf(a);if(-1<c){const d=this.F.get(a);this.D.splice(c,
|
|
644
644
|
1);rg(this,tg(this,d.D,c),b);this.F.delete(a)}}write(a,b,c=!1){b=new olympe.dc.db.yn(this.G,this.H,this.fa,b);b.open(c);b.write(a,this.R);b.close()}};class wg{T(){}sd(){}}function xg(a,b,c,d){const e=olympe.dc.ua.DESTINATION;c=c.tag();const f=a.j.$c(c);b.xb().forEach((g,h)=>{f.ja(h,g);b.Z(h)});for(const [g,h,k,l]of b.ba()){if(!l)continue;const n=h===e?c:k,p=h===e?k:c;a.j.La(g,n,p);d.N(g,n,p)}}
|
|
645
645
|
function yg(a,b,c,d){const e=olympe.dc.ua.DESTINATION,f=c.tag(),g=a.j.$c(f);b.xb().forEach((h,k)=>{void 0!==c.Oa(k)&&(g.ja(k,h),b.Z(k))});for(const [h,k,l]of b.Md()){const n=c.jb(h,e,k);void 0!==n&&(d.N(h,f,k),n===l&&a.j.N(h,f,k))}}
|
|
646
646
|
class qg extends wg{constructor(a,b){super();this.D=a;this.j=b;this.db=olympe.dc.fa()}T(){return this.D.T()}sd(a){for(const [b,c]of this.D.ba(a)){const d=b.tag();c.Dd()?b.D()?a.j(d,b.F()):(this.D.j(d,c.F()),this.j.j(d,c.F())):b.Dd()?(xg(this,c,b,a),a.j(d,b.F())):yg(this,c,b,a)}return a}}function zg(a){clearTimeout(a.F);a.F=setTimeout(()=>{a.buffer.splice(a.buffer.indexOf(a),1)},a.H)}
|
|
647
|
-
class sg extends wg{constructor(a,b,c,d){super();this.j=a;this.D=b;this.buffer=c;this.H=d;this.F=null;zg(this)}T(){return this.j.T()}sd(a){return a.R(this.j)}update(a,b){this.D=b;a.
|
|
647
|
+
class sg extends wg{constructor(a,b,c,d){super();this.j=a;this.D=b;this.buffer=c;this.H=d;this.F=null;zg(this)}T(){return this.j.T()}sd(a){return a.R(this.j)}update(a,b){this.D=b;a.ic(this.j);zg(this);return this}};const Ag=olympe.dc.hc.ed,Bg=olympe.dc.hc.Pi,Cg=olympe.dc.ua.ORIGIN,Dg=olympe.dc.ua.DESTINATION;let Eg=0;
|
|
648
648
|
olympe.dc.db.Database=class a extends Map{constructor(b,c,d){super();let e;this.id=null!=(e=d.get('selfTag'))?e:olympe.dc.Ia.SELF;this.G=b;this.Xc=olympe.C.Za();this.state=olympe.dc.db.Database.F.IDLE;this.ia=new Map;this.Nb=[];this.X=new Map;this.H=null;this.ba=new Set;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.Ff.j.vm;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.gd=new olympe.dc.db.Ff(c,this,b,f);d.get('debug')&&this.zl()}T(){return this.id}getState(){return this.state}Va(){return this.G}create(b,
|
|
649
649
|
c,d,e=!1){var f=this.N(b,!0);if(!f.e&&null!==c&&(null===f.H||f.H===c)){f.H=c;let g;(null==(g=f.model())?0:g.e)&&f.db.Z(f,!0)}e&&f.persist();this.state===a.F.Zl&&Fg(f,!0);d&&this.Ac(f,d);this.D(a.j.wq,b)}update(b,c){c&&(b=this.N(b,!0),this.Ac(b,c))}va(b){const c=this.get(b);void 0!==c&&(this.Z(c,!1),this.D(a.j.xq,b))}link(b,c,d){c=this.N(c,!0);d=this.N(d,!0);switch(b){case Ag:Gg(c,d);break;case Bg:Hg(c,d);break;default:c.link(b,d)}}unlink(b,c,d){c=this.get(c);d=this.get(d);if(void 0!==c&&void 0!==
|
|
650
650
|
d)switch(b){case Ag:Ig(c,d);break;case Bg:Jg(c,d);break;default:c.unlink(b,d)}}kf(b,c){for(const d of b)this.N(d).te(c)}oh(b,c){for(const d of b)(b=this.get(d))&&b.detach(c)}Qj(...b){for(const c of b)null!=(b=this.get(c))&&(b.e=!1)}Bl(b){b.forEach(c=>{this.N(c).persist()})}kd(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.D(a.j.Dp,b))}N(b,c=!1){let d;return null!=(d=this.get(b))?d:this.Yc(b,c)}Yc(b,c){const d=new olympe.dc.db.Instance(b,this);this.set(b,d);this.D(a.j.Cp,b);c&&
|
|
@@ -677,14 +677,14 @@ function Fh(a,b,...c){b.forEach((d,e)=>{Kg(a,e,d.bind(null,...c))})}function Gh(
|
|
|
677
677
|
function Ih(a){a.X.run(()=>{const b=a.j;for(const [c,d]of a.buffer){let e,f,g;null==(e=b.get(c))||null==(g=(f=e)[d])||g.call(f)}});a.j.clear();a.buffer.length=0}function Jh(a,b,c){const d=b+c;let e=a.N.get(d);if(!e){const f=a.D.get(b);e=new Map;Eh.forEach(g=>{const h=g[0]===olympe.dc.oe.ng;var k=h?g.substring(1):g;let l;k=null!=(l=null==f?void 0:f.get(zh+k))?l:0;k=h?((k&3)<<2)+((k&12)>>2):k;(c===yh?12:3)&k&&e.set(g,!!((c===yh?8:2)&k))});a.N.set(d,e)}return e}
|
|
678
678
|
olympe.dc.db.Eu=class{constructor(a,b,c){this.id=a;this.D=b;this.X=c;this.H=new Map;this.F=new Map;this.R=new Set;this.j=new Map;this.N=new Map;this.buffer=[]}T(){return this.id}};function Qg(a){if(!a.F&&0<a.D.size)switch(a.mode){case olympe.dc.db.Ff.j.zo:a.F=!0;setTimeout(()=>{a.j.getState()===olympe.dc.db.Database.F.IDLE&&a.run()},a.delay);break;case olympe.dc.db.Ff.j.Ow:a.F=!0,a.run()}}
|
|
679
679
|
olympe.dc.db.Ff=class{constructor(a,b,c,d){this.G=a;this.j=b;this.D=new Set;this.mode=c;this.delay=d;this.F=!1;c!==olympe.dc.db.Ff.j.vm&&this.init()}run(){const a=this.j;this.G.debug('Start garbage collector with',this.D.size,'instances to check');const b=[];for(const c of this.D){const d=a.get(c);!d||0<d.c||(this.G.debug('Remove unused instance',c,'from database'),a.kd(c),b.push(c))}this.D.clear();this.j.Ga(olympe.dc.db.Database.j.Vp,b);this.F=!1}init(){const a=olympe.dc.db.Database.j.Ds,b=olympe.dc.db.Database.j.xq,
|
|
680
|
-
c=olympe.dc.db.Database.j.Kr,d=olympe.dc.db.Database.F.IDLE,e=f=>{this.D.add(f);this.j.getState()===d&&Qg(this)};this.j.j(olympe.dc.db.Database.j.xn,e.bind(this));this.j.j(b,e.bind(this));this.j.j(a,f=>{this.D.delete(f)});this.j.addEventListener(olympe.dc.db.Database.j.ax,()=>{this.run()});this.j.j(c,(f,...g)=>{this.G.error(g[0])})}};olympe.dc.db.Ff.j={vm:0,Ow:1,zo:2};olympe.dc.db.Ff.D=5E3;olympe.dc.db.
|
|
681
|
-
l?a.La(h,f,k,g,e.Xb()):a.
|
|
682
|
-
c);this.F(c,e).vb(a,b)}
|
|
680
|
+
c=olympe.dc.db.Database.j.Kr,d=olympe.dc.db.Database.F.IDLE,e=f=>{this.D.add(f);this.j.getState()===d&&Qg(this)};this.j.j(olympe.dc.db.Database.j.xn,e.bind(this));this.j.j(b,e.bind(this));this.j.j(a,f=>{this.D.delete(f)});this.j.addEventListener(olympe.dc.db.Database.j.ax,()=>{this.run()});this.j.j(c,(f,...g)=>{this.G.error(g[0])})}};olympe.dc.db.Ff.j={vm:0,Ow:1,zo:2};olympe.dc.db.Ff.D=5E3;olympe.dc.db.fc=class{constructor(a){this.id=null!=a?a:olympe.U.nf();this.Cb=new Map}T(){return this.id}ic(a){const b=olympe.dc.db.Ph.j.Rm,c=olympe.dc.db.Ph.j.Jc,d=olympe.dc.db.Ph.j.gl;this.Cb.forEach((e,f)=>{const g=e.Xb();switch(e.getState()){case b:const h=e.lb();if(null===h)throw Error(`GraphPatch: try to create the instance ${f} with no source`);const k=e.N()?e.xb():void 0;a.Yc(f,h,k,g);break;case d:e.N()&&a.dd(f,e.xb(),g);break;case c:a.D(f,e.F(),g)}for(const [h,k,l]of e.Md())e=this.Cb.get(k),
|
|
681
|
+
l?a.La(h,f,k,g,e.Xb()):a.jc(h,f,k,g,e.Xb())});return a}sf(){return 0===this.Cb.size}H(){let a=0;this.Cb.forEach(b=>{a+=b.Xc()});return a}Yc(a,b,c,d=null){b=this.F(a).create(b);'string'===typeof d&&this.La(olympe.dc.hc.ed,a,d,d,null);c&&b.Fn(c)}dd(a,b,c=null){b&&this.F(a,c).Fn(b)}D(a,b=olympe.dc.Hb.NONE,c=null){const d=this.Cb.get(a);if(d&&d.D())this.j(a,b);else{this.F(a,c).delete(b);for(const e of this.Ij(a,b,!1))this.Cb.get(e).xb().clear(),this.X(e,!0)}}La(a,b,c,d=null,e=null){this.F(b,d).link(a,
|
|
682
|
+
c);this.F(c,e).vb(a,b)}jc(a,b,c,d=null,e=null){this.F(b,d).unlink(a,c);this.F(c,e).zc(a,b)}Z(a){var b=olympe.dc.Hb.NONE;const c=olympe.dc.fa(),d=new Set,e=(f,g)=>{if(c.Ja(f)){var h=c.model(f),k=c.source(f);const l=c.xb(f,!0);uh(c,f).forEach((n,p)=>{l.set(`${olympe.dc.oe.af}${p}`,n)});this.Yc(f,k,l,h);(h=c.lf(f))&&this.La(olympe.dc.hc.Pi,f,h);l.forEach(n=>{n instanceof olympe.dc.rc&&this.Z(n.W())});if(g!==olympe.dc.Hb.NONE){d.add(f);h=olympe.dc.ua.ORIGIN;k=olympe.dc.ua.DESTINATION;for(const [n,p,q,
|
|
683
683
|
r]of c.Ij(f,g))q===h?this.La(p,n,f):q===k&&this.La(p,f,n),r&&!d.has(n)&&e(n,g)}}return this};e(a,b)}Cc(){return function*(a){for(const b of a.values())if(b.D()||b.Dd()||b.N())yield b}(this.Cb)}$c(a){let b;return null!=(b=this.Cb.get(olympe.dc.ea(a)))?b:null}j(a,b=olympe.dc.Hb.NONE){a=this.Ij(a,b);for(const c of a)this.X(c,!1),this.Cb.delete(c)}Md(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.Md((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.Cb.values())}th(a,b,c=(d,e)=>
|
|
684
684
|
[d,e]){return this.ia(a,b,c)}*ia(a,b,c,d=[]){d.push(a);a=this.$c(a);for(const [e,f]of a.cb(b))d.includes(e)||(yield*this.ia(e,b,c,d),yield c(e,f))}N(a,b,c){const d=this.Cb.get(b),e=this.Cb.get(c);d&&d.H(a,olympe.dc.ua.DESTINATION,c);e&&e.H(a,olympe.dc.ua.ORIGIN,b)}X(a,b){const c=olympe.dc.ua.ORIGIN,d=olympe.dc.ua.DESTINATION,e=this.Cb.get(a);for(const [g,h,k]of e.Md())if(k||!b){e.H(g,d,h);var f=this.Cb.get(h);f&&f.H(g,c,a)}for(const [g,h,k]of e.Xa())if(k||!b)e.H(g,c,h),(f=this.Cb.get(h))&&f.H(g,d,
|
|
685
685
|
a)}*lt(a){let b;for(const [c,d]of(null==(b=this.$c(a))?void 0:b.cb(olympe.dc.CloudObject.instancesRel))||[])d&&(a=this.Cb.get(c),a.Dd()||(yield a))}Ij(a,b,c=!0){const d=olympe.dm.Relation.j.Tr,e=olympe.dm.Relation.j.As,f=olympe.dc.ua.ORIGIN,g=olympe.dc.fa();a=new Set([a]);const h=new Set;for(const l of a){var k=this.Cb.get(l);if(void 0!==k){for(const [n,p,q]of k.Md())q&&rh(g,n,b)&e?a.add(p):c||q||h.add(`${l}.${n}.${p}`);for(const [n,p,q]of k.Xa())q&&rh(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${l}`)}for(const [n,
|
|
686
686
|
p,q]of vh(g,l))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${l}`:`${l}.${n}.${q}`)&&rh(g,n,b)&k&&a.add(q)}return Array.from(a).filter(l=>this.Cb.has(l))}F(a,b){let c=this.Cb.get(a);void 0===c&&(c=new olympe.dc.db.Ph(a),this.Cb.set(a,c));return b?c.va(b):c}R(a){const b=olympe.dc.ua.DESTINATION;for(const [c,d]of this.ba(a))if(a=c.tag(),d.Dd())this.j(a,d.F());else if(c.Dd())d.D()&&this.j(a,c.F());else{c.xb().forEach((e,f)=>{void 0!==d.Oa(f)&&c.Z(f)});for(const [e,f,g]of c.Md()){const h=d.jb(e,b,f);void 0!==
|
|
687
|
-
h&&g!==h&&this.N(e,a,f)}}return this}*ba(a){var b=this.Cb;const c=a.Cb,d=(a=a.H()>this.H())?c:b;b=a?b:c;for(const [e,f]of b)b=d.get(e),void 0!==b&&(yield[a?f:b,a?b:f])}};olympe.dc.db.
|
|
687
|
+
h&&g!==h&&this.N(e,a,f)}}return this}*ba(a){var b=this.Cb;const c=a.Cb,d=(a=a.H()>this.H())?c:b;b=a?b:c;for(const [e,f]of b)b=d.get(e),void 0!==b&&(yield[a?f:b,a?b:f])}};olympe.dc.db.fc.ya=[olympe.dc.Writable,olympe.dc.Dr];const Kh=olympe.dc.db.Database.j,Lh=olympe.dc.db.Database.D.jj,Mh=olympe.dc.db.Database.D.Xu,Nh=olympe.dc.db.Database.D.af,Oh=olympe.dc.db.Database.D.Tl,Ph=olympe.dc.db.Database.D.Li,V=olympe.dc.ua.ORIGIN,W=olympe.dc.ua.DESTINATION,Qh=olympe.dc.hc.ed,Rh=olympe.dc.hc.Pi;function og(a,b,c=!1){const d=a.get(Nh+b);return c||void 0!==d?d:a.get(Mh+b)}function Fg(a,b){const c=a.e!==b;c&&(b?(a.e=b,Sh(a)):(Th(a),a.e=b),a.db.D(b?Kh.ym:Kh.Jc,a.j));return c}
|
|
688
688
|
function Gg(a,b){const c=a.model();if(null!==c){if(c===b)return;a.unlink(Qh,c)}a.link(Qh,b);b.forEach((d,e)=>{if(e[0]===Nh||e[0]===Mh)e=e.substring(1),Uh(a,e,d)});null===a.H||!b.e&&b!==a||a.db.Z(a,!0)}function Hg(a,b){const c=a.lf();if(null!==c){if(c===b)return;a.unlink(Rh,c)}a.link(Rh,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===Nh||f[0]===Mh)f=f.substring(1),a.has(Nh+f)||(a.set(Mh+f,e),d.set(f,e))});Vh(a,d)}
|
|
689
689
|
function Ig(a,b){a.unlink(Qh,b);a.forEach((c,d)=>{c=d.substring(1);Uh(a,c,null)});a.db.Z(a,!1)}function Jg(a,b){a.unlink(Rh,b);const c=new Map;a.forEach((d,e)=>{e[0]===Mh&&(a.delete(e),d=e.substring(1),c.set(d,null))});Vh(a,c)}
|
|
690
690
|
function Rg(a,b,c){const d=Nh+b;var e=a.get(d);e=void 0===e?null:e;if(!Wh(e,c))if(Xh(a,b,e,c,!0),e=Mh+b,null===c){a.delete(d);let f;c=null==(f=a.lf())?void 0:og(f,b);c=void 0===c?null:c;null!==c&&a.set(e,c);Vh(a,(new Map).set(b,c))}else void 0!==a.get(e)&&a.delete(e),a.set(d,c),Vh(a,(new Map).set(b,c))}function hh(a,b,c,d){const e=Yh(a,Ph+b);return e.has(c)?!1:(e.set(c,d),a.te(olympe.dc.db.Instance.j.Li+b),a.db.D(Kh.Zo,a.j,b,c),!0)}
|
|
@@ -700,28 +700,28 @@ a,d,b,!1),d=Oh+a,null===b){this.delete(c);let e;b=null==(e=this.model())?void 0:
|
|
|
700
700
|
a,W,b.j),this.db.D(Kh.kn,b.j,a,V,this.j),this.e&&b.e&&(bi(this,a,W,b,!1),bi(b,a,V,this,!1)))}persist(){this.N=!0;return this}te(){this.c++;1===this.c&&this.db.D(Kh.Ds,this.j)}detach(){0<this.c?--this.c:this.db.D(Kh.Kr,this.j,`Try to decrease references on instance ${this.j} but the reference counter is already 0.\n`+'It happens when you try to remove a callback from an instance multiple times.\nThis counter reference is used for garbage collection of instances in the database.');0===this.c&&this.db.D(Kh.xn,
|
|
701
701
|
this.j)}clear(){this.forEach((a,b)=>{const c=b[0];if(c===V||c===W){const d=b.substring(1),e=c===V?W:V;a.forEach(f=>{const g=f.get(e+d);g.delete(this.j);0===g.size&&f.delete(e+d)})}c===Lh&&a instanceof olympe.dc.rc&&$h(this.db.get(a.W()))});void 0!==this.D&&this.db.get(this.D.tag).delete(Lh+this.D.Da)}create(a){const b=new Map;this.set(a,b);return b}};olympe.dc.db.Instance.j={vq:'instance',ww:'rel',Li:'cb',kj:'ref',TRANSACTION:'tx'};olympe.dc.db.Ph=class a{constructor(b){this.Ac=b;this.R=this.Ga=null;this.Tb=olympe.dc.Hb.NONE;this.state=a.j.gl;this.j=this.hb=this.Nb=this.X=this.properties=null}tag(){return this.Ac}Xb(){return this.R}lb(){return this.Ga}getState(){return this.state}va(b){if(null===this.R)this.R=b;else if(this.R!==b)throw Error(`Try to set a model relation with another model ${b} than the one set initially ${this.R}`);return this}F(){return this.state===a.j.Jc?this.Tb:olympe.dc.Hb.NONE}create(b){this.state=a.j.Rm;
|
|
702
702
|
this.Ga=null!=b?b:null;return this}delete(b=olympe.dc.Hb.NONE){this.state=a.j.Jc;this.Tb=b;this.properties=null;return this}ja(b,c){if(this.state===a.j.Jc)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}Fn(b){this.state!==a.j.Jc&&(this.properties||(this.properties=new Map),b.forEach((c,d)=>{this.properties.set(d,c)}))}kd(b,c){if(null!==this.X&&this.X!==b)throw Error('An instance should never be set as complex property of multiple instances');this.X=b;this.Nb=
|
|
703
|
-
c}Z(b){let c;null==(c=this.properties)||c.delete(b);0===this.properties.size&&(this.properties=null)}link(b,c){null===this.hb&&(this.hb=new Map);b===olympe.dc.
|
|
703
|
+
c}Z(b){let c;null==(c=this.properties)||c.delete(b);0===this.properties.size&&(this.properties=null)}link(b,c){null===this.hb&&(this.hb=new Map);b===olympe.dc.hc.ed&&this.va(c);this.sa(this.hb,b,c,!0);return this}unlink(b,c){null===this.hb&&(this.hb=new Map);b===olympe.dc.hc.ed&&this.va(c);this.sa(this.hb,b,c,!1);return this}vb(b,c){null===this.j&&(this.j=new Map);this.sa(this.j,b,c,!0)}zc(b,c){null===this.j&&(this.j=new Map);this.sa(this.j,b,c,!1)}jb(b,c,d){if(c=c===olympe.dc.ua.ORIGIN?this.j:this.hb)return(b=
|
|
704
704
|
c.get(b))&&b.get(d)}H(b,c,d){const e=(c=c===olympe.dc.ua.ORIGIN?this.j:this.hb)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}D(){return this.state===a.j.Rm}Dd(){return this.state===a.j.Jc}Xc(){let b=this.properties?this.properties.size:0,c;null==(c=this.hb)||c.forEach(d=>{b+=d.size});return b}N(){return null!==this.properties}gd(){return null!==this.hb||null!==this.j}xb(){let b;return null!=(b=this.properties)?b:new Map}Oa(b){if(this.properties)return this.properties.get(b)}cb(b,c=(d,e)=>[d,
|
|
705
705
|
e]){return function*(d){if(d=d&&d.get(b.W()))for(const [e,f]of d)yield c(e,f)}(b.Ma()===olympe.dc.ua.ORIGIN?this.j:this.hb)}Kb(b){const c=b.Ma()===olympe.dc.ua.ORIGIN?this.j:this.hb;return(b=c&&c.get(b.W()))&&0!==b.size?Array.from(b.keys())[0]:null}Md(b=(c,d,e)=>[c,d,e]){return this.ia(this.hb,b)}Xa(b=(c,d,e)=>[c,d,e]){return this.ia(this.j,b)}ba(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.ua.ORIGIN,d=olympe.dc.ua.DESTINATION;return function*(e,f,g){yield*e(f,(h,k,l)=>b(h,d,k,l));yield*e(g,(h,k,l)=>
|
|
706
706
|
b(h,c,k,l))}(this.ia.bind(this),this.hb,this.j)}sa(b,c,d,e){if(this.state!==a.j.Jc||!e){var f=b.get(c);if(void 0===f)f=new Map,b.set(c,f);else if(b=f.get(d),void 0!==b&&b!==e){f.delete(d);return}f.set(d,e)}}*ia(b,c){if(null!==b)for(const [d,e]of b){b=e.entries();for(const [f,g]of b)yield c(d,f,g)}}};olympe.dc.db.Ph.j={Rm:0,gl:1,Jc:2};olympe.dc.db.Wv=class{constructor(a,b,c,d){this.G=a;this.view=b;this.j=c;(this.active=d.get('active'))&&this.init()}debug(a){const b=olympe.dc.ea(a);if(this.j.has(b)){var c=this.j.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Ja()){const d=[];for(;null!==c&&!d.includes(c.tag());)d.push(c.tag()),c=c.model();c=this.j.get(d[d.length-1]);const e=olympe.dc.db.Database.D.jj+olympe.dc.CloudObject.nameProp.W();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+
|
|
707
707
|
' (name: '+c.get(e)+') has no model.\nList: '+d.join(' --M--\x3e ')}this.G.info(a)}else this.G.info('[DATABASE] Instance',b,'has never been created or referred by the database')}init(){const a=olympe.dc.db.Database.j.Dp,b=olympe.dc.db.Database.j.ym,c=olympe.dc.db.Database.j.Jc,d=olympe.dc.db.Database.j.Rk,e=olympe.dc.db.Database.j.kn,f=olympe.dc.db.Database.j.Zo,g=olympe.dc.db.Database.j.$o,h=()=>{};this.j.j(olympe.dc.db.Database.j.Cp,()=>{});this.j.j(a,()=>{});this.j.j(b,k=>{this.j.vb(()=>{oh(this.view,
|
|
708
|
-
k,h,`monitorRelations${k}`)})});this.j.j(c,k=>{this.j.vb(()=>{ph(this.view,k,`monitorRelations${k}`)})});this.j.j(d,()=>{});this.j.j(e,()=>{});this.j.j(f,()=>{});this.j.j(g,()=>{})}};olympe.dc.db.yn=class{constructor(a,b,c,d){this.G=a;this.j=b;this.fa=c;this.F=d;this.transactionId=null}open(a){if(null!==this.transactionId)throw Error('A transaction is already open');this.transactionId=this.j.Vf(a);this.G.debug(`DB Writer: transaction ${this.transactionId} opened`)}write(a,b){b&&(b=new ci(this.fa),a.
|
|
709
|
-
this.transactionId);this.j.Fl(this.transactionId,()=>a.
|
|
708
|
+
k,h,`monitorRelations${k}`)})});this.j.j(c,k=>{this.j.vb(()=>{ph(this.view,k,`monitorRelations${k}`)})});this.j.j(d,()=>{});this.j.j(e,()=>{});this.j.j(f,()=>{});this.j.j(g,()=>{})}};olympe.dc.db.yn=class{constructor(a,b,c,d){this.G=a;this.j=b;this.fa=c;this.F=d;this.transactionId=null}open(a){if(null!==this.transactionId)throw Error('A transaction is already open');this.transactionId=this.j.Vf(a);this.G.debug(`DB Writer: transaction ${this.transactionId} opened`)}write(a,b){b&&(b=new ci(this.fa),a.ic(b),this.G.info(b.flush()));if(null===this.transactionId)throw Error('You must first open a transaction before to write');this.G.debug('DB Writer: writing patch',a.T(),'for transaction',
|
|
709
|
+
this.transactionId);this.j.Fl(this.transactionId,()=>a.ic(this))}close(){if(null===this.transactionId)throw Error('No transaction is open');this.j.Yd(this.transactionId);this.G.debug(`DB Writer: transaction ${this.transactionId} committed`);this.transactionId=null}Yc(a,b,c,d){this.j.create(a,b,c,this.F);d&&this.j.link(olympe.dc.hc.ed,a,d)}dd(a,b){this.j.update(a,b)}D(a,b=olympe.dc.Hb.NONE){for(const c of ng(this.fa,a,b))this.j.va(c)}La(a,b,c){this.j.link(a,b,c)}jc(a,b,c){this.j.unlink(a,b,c)}};
|
|
710
710
|
function di(a,b,c){if(!b)return'';let d='';if(c&&1<c)return'...';for(const [e,f]of b)if(d+=(d?', "':'"')+e+'":',!f)d+=JSON.stringify(f);else if(f instanceof olympe.dc.rc||f instanceof olympe.dc.CloudObject)d+='Reference("'+f.W()+'")';else if(f instanceof olympe.C.Color)d+='Color("'+f.Fg()+','+f.Eg()+','+f.Cg()+','+f.Bg()+'")';else if(f.constructor&&Object.prototype.hasOwnProperty.call(f.constructor.prototype,'toString'))d+=JSON.stringify(f.toString());else if('object'===typeof f){let g;d+=di(a,f,
|
|
711
|
-
(null!=(g=c)?g:0)+1)}return'{'+(d?d:'')+'}'}function ei(a,b){let c;return'string'===typeof b?null!=(c=a.db.name(b))?c:b:''}function fi(a,b){let c;return b===olympe.dc.
|
|
712
|
-
class ci{constructor(a){this.db=a;this.output='Applying patch on the local database'}flush(){const a=this.output;this.output='';return a}log(a,b){this.output+=`\ndb.${a};${b?`// ${b}`:''}`}Yc(a,b,c,d){this.log(`createInstance(tag: ${a}, source: ${b}, ${di(this,c)})`,ei(this,d))}dd(a,b,c){this.log(`updateInstance(tag: ${a}, ${di(this,b)})`,ei(this,c))}D(a,b,c){this.log(`deleteInstance("${a}", rule: ${b})`,ei(this,c))}La(a,b,c){this.log(`createRelation("${a}", "${b}", "${c}")`,fi(this,a))}
|
|
711
|
+
(null!=(g=c)?g:0)+1)}return'{'+(d?d:'')+'}'}function ei(a,b){let c;return'string'===typeof b?null!=(c=a.db.name(b))?c:b:''}function fi(a,b){let c;return b===olympe.dc.hc.ed?'Model':null!=(c=a.db.name(b))?c:b}
|
|
712
|
+
class ci{constructor(a){this.db=a;this.output='Applying patch on the local database'}flush(){const a=this.output;this.output='';return a}log(a,b){this.output+=`\ndb.${a};${b?`// ${b}`:''}`}Yc(a,b,c,d){this.log(`createInstance(tag: ${a}, source: ${b}, ${di(this,c)})`,ei(this,d))}dd(a,b,c){this.log(`updateInstance(tag: ${a}, ${di(this,b)})`,ei(this,c))}D(a,b,c){this.log(`deleteInstance("${a}", rule: ${b})`,ei(this,c))}La(a,b,c){this.log(`createRelation("${a}", "${b}", "${c}")`,fi(this,a))}jc(a,b,c){this.log(`deleteRelation("${a}", "${b}", "${c}")`,
|
|
713
713
|
fi(this,a))}}olympe.dc.db.yn.ya=[olympe.dc.Writable,olympe.dc.Writable];olympe.dc.db.P={Ca:'dc.db.Logger',Dm:'dc.db.gc.Logger',Ea:'dc.db.DatabaseManager',ik:'dc.db.Database',qm:'dc.db.DBView',fC:'dc.db.Graph',hB:'dc.db.DatabaseWriter',VC:'dc.db.PermissionProcessor',aj:'dc.db.GraphMonitor'};olympe.dc.db.Config={Wp:'db.garbageCollector',Xp:'db.garbageCollectorDelay',im:'db.commitBufferTimeout',aj:'db.monitor',Vv:'db.monitorCounters',Uv:'db.monitorCallbacks',up:'db.debug'};
|
|
714
714
|
olympe.V.config(function(a){E(a,olympe.dc.db.Config.Wp,olympe.dc.db.Ff.j.zo);E(a,olympe.dc.db.Config.Xp,5E3);E(a,olympe.dc.db.Config.im,3E4);E(a,olympe.dc.db.Config.aj,!1);E(a,olympe.dc.db.Config.up,!1);D(a,olympe.dc.db.P.Ca,[olympe.ha.P.Ea],b=>b.hd('db'));D(a,olympe.dc.db.P.Dm,[olympe.ha.P.Ea],b=>b.hd('gc'));D(a,olympe.dc.db.P.ik,[olympe.dc.db.P.Ca,olympe.dc.db.P.Dm,new olympe.V.ma(olympe.dc.Config.fh),new olympe.V.ma(olympe.dc.db.Config.Wp),new olympe.V.ma(olympe.dc.db.Config.Xp),new olympe.V.ma(olympe.dc.Config.ci),
|
|
715
715
|
new olympe.V.ma(olympe.dc.db.Config.up)],(b,c,d,e,f,g,h)=>{e=g?olympe.dc.db.Ff.j.vm:e;d=(new Map).set('selfTag',d).set('garbageCollector',e).set('garbageCollectorDelay',f).set('debug',h);return new olympe.dc.db.Database(b,c,d)});C(a,olympe.dc.db.P.qm,olympe.dc.mb,olympe.dc.db.P.Ca,olympe.dc.db.P.ik);D(a,olympe.dc.db.P.aj,[olympe.dc.db.P.Ea],b=>b.Pz);D(a,olympe.dc.db.P.Ea,[olympe.dc.db.P.Ca,olympe.dc.db.P.ik,olympe.dc.db.P.qm,new olympe.V.ma(olympe.dc.Config.hg),new olympe.V.ma(olympe.dc.db.Config.im),
|
|
716
716
|
new olympe.V.ma(olympe.dc.db.Config.aj),new olympe.V.ma(olympe.dc.db.Config.Vv),new olympe.V.ma(olympe.dc.db.Config.Uv)],(b,c,d,e,f,g,h,k)=>{g=(new Map).set('active',g).set('counters',h).set('callbacks',k);e=(new Map).set('debug',e).set('bufferTimeout',f);return new olympe.dc.db.Au(b,c,d,e,g)})},'olympe.dc.db');olympe.V.run([olympe.dc.db.P.ik,olympe.dc.db.P.aj],(a,b)=>{olympe.ke().db=a;olympe.ke().dbMonitor=b},'DC.DB debug service injection');olympe.dc.query={};function gi(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
|
|
717
717
|
olympe.dc.query.Cf=class{constructor(a,b,c){this.db=olympe.dc.fa();this.j=a;this.Da=b;this.Zi=c}ga(){return{p:this.Da.W(),o:this.Zi}}toString(){return'sortByQueryPart-'+this.Zi+this.Da.W()}qh(){const a=this.db.Kb(this.Da,olympe.dm.Property.typeRel),b=olympe.dc.ea;if(this.db.ag(a,olympe.dm.String))return gi((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return gi((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return gi((c,d)=>c.getTime()-d.getTime());if(a===b(olympe.dm.Color))return gi((c,
|
|
718
|
-
d)=>c.compare(d));olympe.ha.Va('dc.query').warn(`No comparator found for type with tag ${a}`);return gi(()=>-1)}Oa(){return this.Da}};olympe.dc.bf=class{W(){}};olympe.dc.bf.prototype.getTag=olympe.dc.bf.prototype.W;olympe.dc.iC=olympe.dc.bf;function hi(a){let b;if(null==(b=a.j)?0:b.sf())if(a=a.N,!a.N){let c;null==(c=a.R)||c.call(a)}}function ii(a,b,c,d,e){hi(a);let f,g;b?null==(f=a.j)||f.La(c,d,e):null==(g=a.j)||g.
|
|
718
|
+
d)=>c.compare(d));olympe.ha.Va('dc.query').warn(`No comparator found for type with tag ${a}`);return gi(()=>-1)}Oa(){return this.Da}};olympe.dc.bf=class{W(){}};olympe.dc.bf.prototype.getTag=olympe.dc.bf.prototype.W;olympe.dc.iC=olympe.dc.bf;function hi(a){let b;if(null==(b=a.j)?0:b.sf())if(a=a.N,!a.N){let c;null==(c=a.R)||c.call(a)}}function ii(a,b,c,d,e){hi(a);let f,g;b?null==(f=a.j)||f.La(c,d,e):null==(g=a.j)||g.jc(c,d,e)}function ji(a){let b;const c=!(null==(b=a.j)?0:b.sf());a.F=c?a.j:null;a.H.forEach(d=>d());a.H=[];c&&(a.j=new olympe.dc.db.fc,a.G.j()&&a.G.debug(`Commit notification with ${a.F.H()} operations for query ${a.D}`))}
|
|
719
719
|
olympe.dc.query.bw=class{constructor(a,b,c,d){this.G=a;this.source=b;this.D=c;this.N=d;this.j=this.F=null;this.db=olympe.dc.fa();this.H=[]}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.D}:${a}:notif`;Qf(this.db,a,(d,e)=>{if(d){hi(this);let f;null==(f=this.j)||f.Z(e)}else if(b&&lh(this.db,e,c),!this.db.Ja(e)){hi(this);let f;null==(f=this.j)||f.D(e,olympe.dc.Hb.NONE)}},c);b&&kh(this.db,a,(d,e,f)=>{hi(this);let g;f||null!=(g=this.j)&&g.dd(a,new Map([[d,e]]))},c)}}stop(a){this.H.push(()=>
|
|
720
720
|
Of(this.db,a,`${this.D}:${a}:notif`))}};olympe.dc.query.Kk={ASC:'ASC',DESC:'DESC'};function ki(a){const b=li(a.query),c=new Map;for(let e=b.length;0<=e;e--){const f=0<e?b[e-1].T():a.F,g=0<e?b[e-1].j:'root',h=0<e&&b[e-1].R(),k=a.j.get(f),l=new Set(k.Cc()),n=new Map,p=a.H.has(f);let q=p?';':'';if(c.has(f)){const [r,t,v]=c.get(f);c.delete(f);q+=v;r.forEach((x,y)=>{for(const z of k.j(y)){let A;n.set(z,Array.from(x).map(K=>p?`${y};${K}`:K).reduce((K,aa)=>K.add(aa),null!=(A=n.get(z))?A:new Set))}l.delete(y)});t&&l.forEach(x=>{const y=p?`${x};${v}`:v;for(const z of k.j(x)){let A;n.set(z,
|
|
721
721
|
(null!=(A=n.get(z))?A:new Set).add(y))}})}else l.forEach(r=>{const t=p?`${r};`:'';for(const v of k.j(r))n.has(v)?n.get(v).add(t):n.set(v,(new Set).add(t))});if(0<e&&c.has(g)){const [r,t,v]=c.get(g),x=new Map;n.forEach((y,z)=>{let A;null==(A=r.get(z))||A.forEach(K=>{let aa;const za=null!=(aa=x.get(z))?aa:new Set;y.forEach(bb=>za.add(bb+K));x.set(z,za)});n.delete(z);r.delete(z)});t&&n.forEach((y,z)=>{x.set(z,new Set(Array.from(y).map(A=>A+v)))});b[e-1].R()&&r.forEach((y,z)=>{x.set(z,new Set(Array.from(y).map(A=>
|
|
722
722
|
q+A)))});c.set(g,[x,t&&h,q+v])}else c.set(g,[n,h,q])}let d;a=null==(d=c.get('root'))?void 0:d[0].get('root');return Array.from(null!=a?a:[]).map(e=>e.slice(0,-1).split(';'))}function mi(a){if(null===a.D){const b={Jb:a.query.qh(),Qd:a.Qd,max:a.query.j.max,offset:a.query.j.offset};a.D=olympe.dc.Ka.from(a.X,ki(a),b)}return a.D}function ni(a,b){a.R=b}function oi(a){if(!a.N){null!==a.D&&(a.X=a.D);a.D=null;a.N=!0;let b;null==(b=a.R)||b.call(a)}}
|
|
723
723
|
function pi(a,b){let c;return null!=(c=a.j.get(b).Cc())?c:[]}function qi(a,b,c){let d,e;return null!=(e=null==(d=a.j.get(c))?void 0:d.has(b))?e:!1}function ri(a,b,c=a.F,d='root'){const e=a.j.get(c);if(!e)return a.G.error('Try to insert result entry to a higher level than possible'),null;const f=!e.has(b);e.D(b,d)&&oi(a);let g;f&&(null==(g=a.We)||g.watch(b,a.H.has(c)));return f}function si(a,b,c,d,e,f){null!==a.We&&(d===olympe.dc.ua.ORIGIN?ii(a.We,b,c,f,e):ii(a.We,b,c,e,f))}
|
|
724
|
-
function ti(a){a.G.j()&&a.G.debug(`Start sending notifications for query ${a.query.T()}`);const b=new olympe.dc.query.bw(a.G,a.query.lb(),a.query.T(),a);a.j.forEach((c,d)=>{for(const e of c.Cc())b.watch(e,a.H.has(d))});null!=b.j||(b.j=new olympe.dc.db.
|
|
724
|
+
function ti(a){a.G.j()&&a.G.debug(`Start sending notifications for query ${a.query.T()}`);const b=new olympe.dc.query.bw(a.G,a.query.lb(),a.query.T(),a);a.j.forEach((c,d)=>{for(const e of c.Cc())b.watch(e,a.H.has(d))});null!=b.j||(b.j=new olympe.dc.db.fc);a.We=b}function ui(a){null!==a.We&&(a.G.j()&&a.G.debug(`Stop sending notifications for query ${a.query.T()}`),a.j.forEach(b=>{for(const c of b.Cc())a.We.stop(c)}),a.We=null)}function vi(a){a.N=!1;let b;null==(b=a.We)||ji(b)}
|
|
725
725
|
olympe.dc.query.Br=class{constructor(a,b){this.G=a;this.query=b;this.F=olympe.U.sb(b.D);this.na=new Map;this.j=(new Map).set(this.F,new olympe.dc.query.na.rn);this.H=new Set(b.F);this.Qd=-1;this.N=!1;this.R=null;this.X=olympe.dc.Ka.empty();this.We=this.D=null;a=li(b);a.forEach(c=>{const d=c.T();this.na.set(d,c.N());this.j.set(d,c.ia())});b=b.qh();if(null!==b){b=b.j;let c=-1;for(const d of[this.F].concat(a.map(e=>e.T())))if(c+=this.H.has(d)?1:0,b===d){this.Qd=c;break}}}remove(a,b=this.F,c='root'){b=
|
|
726
726
|
this.j.get(b);if(null==b?0:b.remove(a,c))if(oi(this),!b.has(a)){let d;null==(d=this.We)||d.stop(a);return!0}return!1}Mc(a){const b=a.D,c=olympe.U.sb(b);a=li(a);const d=[];for(const [f,g]of this.j){if(g.H(b))return!0;g.has(b)&&d.push(f)}const e=(new Map).set(c,d);return 0<d.length&&a.every(f=>{let g;const h=(null!=(g=e.get(f.j))?g:[]).flatMap(k=>f.Z(k,this.na.get(k))).filter(k=>{let l,n;return null!=(n=null==(l=this.na.get(k))?void 0:l.Mc(f))?n:!1});e.set(f.T(),h);return 0<h.length})}};function wi(a){if(!olympe.dc.fa().Qb(a,olympe.dm.Property))throw new olympe.dc.query.Id(`The specified property while trying to build a query predicate is invalid: ${a}`);}
|
|
727
727
|
function xi(a){var b=olympe.dc.query.za.j.ws;const c=olympe.dc.query.za.j.Ep,d=olympe.dc.query.za.j.fk,e=olympe.dc.query.za.j.uq,f=olympe.dc.query.za.j.Xq,g=olympe.dc.query.za.j.Lr,h=olympe.dc.query.za.j.xo,k=olympe.dc.query.za.j.qr,l=olympe.dc.query.za.j.tq;switch(a.pr){case b:return new olympe.dc.query.Y.vn(a.t);case c:b=a.v;switch(a.t){case 2:b=new Date(b);break;case 3:b=olympe.dc.CloudObject.get(b);break;case 4:b=olympe.C.Color.create(b.r,b.g,b.b,b.a)}return new olympe.dc.query.Y.Ge(a.p,b,olympe.dc.fa());
|
|
@@ -748,7 +748,7 @@ a;let d;return Ei(olympe.dc.query.xl(),Bi(this),a,olympe.dc.Ia.SELF,c,{ni:null!=
|
|
|
748
748
|
r:Array.from(this.F),s:this.source,e:{m:this.j.max,o:this.j.offset,s:this.j.Qd,rm:null!=(a=this.j.Xe)?a:this.db.model(this.D)}}}toString(){return`Query: ${JSON.stringify(this)}`}toJSON(){return{origin:this.db.Ja(this.D)?olympe.dc.CloudObject.get(this.D):this.D,relations:this.na.map(a=>a.toJSON())}}};olympe.dc.la.prototype.observe=olympe.dc.la.prototype.observe;olympe.dc.la.prototype.executeFromCache=olympe.dc.la.prototype.Ic;olympe.dc.la.prototype.execute=olympe.dc.la.prototype.nb;
|
|
749
749
|
olympe.dc.la.prototype.parse=olympe.dc.la.prototype.parse;olympe.dc.la.prototype.back=olympe.dc.la.prototype.back;olympe.dc.la.prototype.sortBy=olympe.dc.la.prototype.Nl;olympe.dc.la.prototype.limit=olympe.dc.la.prototype.Nj;olympe.dc.la.prototype.cast=olympe.dc.la.prototype.xj;olympe.dc.la.prototype.filter=olympe.dc.la.prototype.filter;olympe.dc.la.prototype.andReturn=olympe.dc.la.prototype.se;olympe.dc.la.prototype.followRecursively=olympe.dc.la.prototype.zg;olympe.dc.la.prototype.follow=olympe.dc.la.prototype.bb;
|
|
750
750
|
olympe.dc.la.followRule=olympe.dc.la.Tb;olympe.dc.la.instancesOf=olympe.dc.la.Cl;olympe.dc.la.fromTag=olympe.dc.la.ue;olympe.dc.la.from=olympe.dc.la.from;olympe.dc.la.qc={Bf:1,Lk:2,Yg:3};olympe.dc.la.j={fm:'cacheBucketName',Bq:'isCacheable'};function Fi(a){null===a.Ha&&null===a.j&&(a.Ha=Zf(a.F))}
|
|
751
|
-
olympe.dc.query.Jd=class extends olympe.dc.Pg{constructor(a){super(a,null);this.F=new olympe.dc.transaction.Me}static Cj(a){const b=new olympe.dc.query.Jd(`DataResult_${a.T()}`);b.D=a.lb();return b}static j(a){const b=new olympe.dc.query.Jd(a.i);let c;b.D=null!=(c=a.s)?c:null;let d;b.ol=null!=(d=a.t)?d:null;let e;b.Ha=null!=(e=a.p)?e:[];return b}
|
|
751
|
+
olympe.dc.query.Jd=class extends olympe.dc.Pg{constructor(a){super(a,null);this.F=new olympe.dc.transaction.Me}static Cj(a){const b=new olympe.dc.query.Jd(`DataResult_${a.T()}`);b.D=a.lb();return b}static j(a){const b=new olympe.dc.query.Jd(a.i);let c;b.D=null!=(c=a.s)?c:null;let d;b.ol=null!=(d=a.t)?d:null;let e;b.Ha=null!=(e=a.p)?e:[];return b}ic(a){Fi(this);return super.ic(a)}ec(){Fi(this);return super.ec()}ul(){Fi(this);return super.ul()}create(a,b,c){this.F.Yc(a,this.D,c,b);return this}La(a,
|
|
752
752
|
b,c){this.F.La(a,b,c,null,null);return this}ga(){return super.ga()}};olympe.dc.query.Jd.prototype.createRelation=olympe.dc.query.Jd.prototype.La;olympe.dc.query.Jd.prototype.create=olympe.dc.query.Jd.prototype.create;olympe.dc.query.Jd.fromQuery=olympe.dc.query.Jd.Cj;function Di(a,b){const c=new olympe.dc.query.Br(a.G,b);if(a.D.view.Ja(b.D)){ri(c,b.D);for(const d of li(b))d.nb(c)}return c}
|
|
753
753
|
function Ei(a,b,c,d,e,f){const g=b.T();let h=a.j.get(g);if(!h){var k=b.lb();a.G.debug(`Create new subscription for query ${g} for subscriber ${d}, to be executed by the data source ${k}`);k=!1===f.Hc||a.H&&k===olympe.dc.Ia.SERVER?[]:Array.from(a.j.values());h=new olympe.dc.query.Jr(a.G,a.D,b,e,a.R.bind(a,e,f));a.j.set(g,h);Gi(h,l=>a.F.add(l));h.start(k)&&(null==f?0:f.ni)&&Hi(a,b,e,f).catch(l=>{a.G.error(`Was not able to get the result of the subscribed query ${g} to add it to the cache: ${l}`)})}return new rxjs.Observable(l=>
|
|
754
754
|
{const n=()=>{p&&c.Ct(p);l.complete();if(q){var r=q;const v=a.j.get(g);a.G.debug(`${d} unsubscribed from ${g}`);if(null==v)r=0;else{var t=v;t.H.delete(r)&&t.G.debug(`Remove subscriber ${d} for query ${t.query.T()}, now have ${t.H.size} subscribers`);d!==olympe.dc.Ia.SELF&&(t.Z--,0===t.Z&&ui(t.j));r=0===t.H.size}r&&(a.G.debug(`No more subscriber to ${g}, remove the subscription`),a.F.delete(g),a.j.delete(g),v.destroy())}},p=c.ae(n),q=Ii(h,d,l);return n})}
|
|
@@ -768,7 +768,7 @@ return{k:this.j,a:this.F,r:this.H}}};olympe.dc.Ka.prototype.getRemoved=olympe.dc
|
|
|
768
768
|
olympe.dc.Ka.prototype.filter=olympe.dc.Ka.prototype.filter;olympe.dc.Ka.prototype.shift=olympe.dc.Ka.prototype.shift;olympe.dc.Ka.prototype.pop=olympe.dc.Ka.prototype.pop;olympe.dc.Ka.prototype.push=olympe.dc.Ka.prototype.push;olympe.dc.Ka.prototype.getAt=olympe.dc.Ka.prototype.ve;olympe.dc.Ka.prototype.getFirst=olympe.dc.Ka.prototype.Nc;olympe.dc.Ka.prototype.get=olympe.dc.Ka.prototype.get;olympe.dc.Ka.prototype.indexOf=olympe.dc.Ka.prototype.indexOf;olympe.dc.Ka.prototype.has=olympe.dc.Ka.prototype.has;
|
|
769
769
|
olympe.dc.Ka.prototype.size=olympe.dc.Ka.prototype.size;olympe.dc.Ka.prototype.toArray=olympe.dc.Ka.prototype.Ye;olympe.dc.Ka.prototype.keys=olympe.dc.Ka.prototype.keys;olympe.dc.Ka.prototype.values=olympe.dc.Ka.prototype.values;olympe.dc.Ka.prototype.entries=olympe.dc.Ka.prototype.entries;olympe.dc.Ka.empty=olympe.dc.Ka.empty;function Ri(a){return 1<a.size()?(olympe.ha.Va('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.Nc()||null}olympe.dc.xd=class{constructor(a){this.query=a}static from(a){return new olympe.dc.xd(olympe.dc.la.from(a))}bb(a){return new olympe.dc.xd(this.query.bb(a))}xj(){return this}nb(a){return this.query.nb(a).then(b=>Ri(b))}Ic(){return Ri(this.query.Ic())}};olympe.dc.xd.prototype.executeFromCache=olympe.dc.xd.prototype.Ic;
|
|
770
770
|
olympe.dc.xd.prototype.execute=olympe.dc.xd.prototype.nb;olympe.dc.xd.prototype.cast=olympe.dc.xd.prototype.xj;olympe.dc.xd.prototype.follow=olympe.dc.xd.prototype.bb;const Si=olympe.dc.ua.ORIGIN,Ti=olympe.dc.ua.DESTINATION;function Gi(a,b){ni(a.j,()=>{a.fb()||null!==a.D||b(a.query.T())})}function Ii(a,b,c){const d=a.ba;a.ba++;a.H.set(d,c);b===olympe.dc.Ia.SELF?a.pd(e=>e?c.error(e):c.next(a.j)):(a.Z++,1===a.Z&&a.pd(()=>ti(a.j)));a.G.debug(`Add subscriber ${b} for query ${a.query.T()}, now have ${a.H.size} subscribers`);return d}
|
|
771
|
-
function Pi(a,b,c){if(a.query.lb()!==b)return!1;c.
|
|
771
|
+
function Pi(a,b,c){if(a.query.lb()!==b)return!1;c.ic(a.ia);(b=a.ia.flush())&&a.G.debug(`Subscription ${a.query.T()} is considered as obsolete after the transaction ${c.T()} applied on DB`);return b}function Ki(a){vi(a.j);a.H.forEach(b=>{b.next(a.j)})}
|
|
772
772
|
function Ui(a,b,c){const d=[];let e=!1;const f=new olympe.async.Mk(olympe.C.rh());for(const g of b)if(g.Mc(a.query)&&(e||(e=!0),f.add(h=>g.pd(k=>{!k&&d.push(g);h()}))),null!==g.D&&Ci(a.query,g.query)){let h;null==(h=a.R)||h.push(g)}qd(f,g=>c(g?d:[]));f.start();return e}
|
|
773
773
|
function Vi(a){const b=a.query.T(),c=new Map,d=q=>{const r=c.get(q);return r?1===r.size?Array.from(r)[0]:(t,v,x,y)=>r.forEach(z=>z(t,v,x,y)):()=>{}},e=li(a.query),f=a.j;for(let q=e.length-1;0<=q;q--){var g=e[q];const r=g.T(),t=g.j;g=g.observe(f,d(r));let v;c.set(t,(null!=(v=c.get(t))?v:new Set).add(g))}const h=a.db,k=a.query.D,l=olympe.U.sb(k),n=Qf(h,k,(q,r)=>{q?ri(f,r):f.remove(r);d(l)(q,r,null,b)});let p;null==(p=a.X)||p.push(()=>{Of(h,k,n)});Wi(a)}
|
|
774
774
|
function Xi(a){const b=a.Ga(a.query,a.Xa.bind(a),()=>{null===a.D||a.fb()||Vi(a)},d=>{a.fb()||(a.G.error(`Error while getting data from data source (${a.query.lb()}) to ensure coverage of the query ${a.query.T()}: ${d}`),Wi(a))});let c;b&&(null==(c=a.X)||c.push(b))}function Yi(a,b){a.N.delete(b);0===a.N.size&&(a.N=null,Promise.resolve().then(()=>{!a.fb()&&Xi(a)}))}function Wi(a){const b=a.D;a.D=null;null==b||b.forEach(c=>c())}
|
|
@@ -777,7 +777,7 @@ olympe.dc.query.Jr=class{constructor(a,b,c,d,e){this.G=a;this.va=b;this.db=b.vie
|
|
|
777
777
|
olympe.dc.la.qc.Yg;if(this.rd===a)return olympe.U.stream.tap(c=>{c=c.ul().filter(e=>e.o===olympe.dc.Vc.j).map(e=>e.t);this.va.te(c,'Batch mode');const d=li(this.query)[0];d instanceof olympe.dc.query.na.Cm&&c.forEach(e=>ri(this.j,e,d.T(),d.j))});let b;if(0<(null==(b=this.R)?void 0:b.length)){const c=this.R.filter(e=>e.rd===a).map(e=>new Promise(f=>e.pd(f))),d=this.R.filter(e=>e.rd!==a).map(e=>new Promise(f=>e.pd(f)));this.R=void 0;return new TransformStream({start:()=>Promise.all(c),flush:()=>Promise.all(d)})}return null}};
|
|
778
778
|
function $i(a,b){return a.F.has(Ti+b)||a.F.has(Si+b)}
|
|
779
779
|
class Zi{constructor(a,b,c,d){this.G=a;this.db=b;this.H=d;this.R=[];this.N=-1<c.j.max||0<c.j.offset;this.F=new Map;this.j=!1;const e=new Map;for(const f of li(c)){a=f.T();this.R.push(a);if(f instanceof olympe.dc.query.na.ai){a=f.relation;a=`${a.Ma()}${a.W()}`;let g;b=null!=(g=this.F.get(a))?g:[];b.push(f);this.F.set(a,b)}aj(f).forEach(g=>{let h;const k=null!=(h=e.get(g))?h:[];k.push(f.T());e.set(g,k)})}this.properties=Array.from(e.entries())}flush(){const a=this.j;this.j=!1;return a}Yc(){}dd(a,b){if(!(this.j||
|
|
780
|
-
!this.N&&this.db.Ja(a))){var c;this.j||(this.j=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&qi(this.H,a,e)))}}D(a){this.j||this.db.Ja(a)&&!this.N||this.j||(this.j=this.R.some(b=>qi(this.H,a,b)))}La(a,b,c){if(!this.j&&$i(this,a)){var d=this.db.Ja(b),e=this.db.Ja(c);if(d&&!e||!d&&e){const f=this.F.get(Ti+a);a=this.F.get(Si+a);this.j||(this.j=d&&(null==f?void 0:f.some(g=>qi(this.H,b,g.j)))||e&&(null==a?void 0:a.some(g=>qi(this.H,c,g.j))))}}}
|
|
780
|
+
!this.N&&this.db.Ja(a))){var c;this.j||(this.j=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&qi(this.H,a,e)))}}D(a){this.j||this.db.Ja(a)&&!this.N||this.j||(this.j=this.R.some(b=>qi(this.H,a,b)))}La(a,b,c){if(!this.j&&$i(this,a)){var d=this.db.Ja(b),e=this.db.Ja(c);if(d&&!e||!d&&e){const f=this.F.get(Ti+a);a=this.F.get(Si+a);this.j||(this.j=d&&(null==f?void 0:f.some(g=>qi(this.H,b,g.j)))||e&&(null==a?void 0:a.some(g=>qi(this.H,c,g.j))))}}}jc(a,b,c){if(!this.j&&this.N&&$i(this,a)&&this.db.xt(b,
|
|
781
781
|
new olympe.dc.Sa.Relation(a),c)){const d=this.F.get(Ti+a);a=this.F.get(Si+a);const e=this.H;this.j||(this.j=(null==d?void 0:d.some(f=>qi(e,b,f.j)&&qi(e,c,f.T())))||(null==a?void 0:a.some(f=>qi(e,c,f.j)&&qi(e,b,f.T()))))}}}olympe.dc.query.Jr.ya=[olympe.dc.Writable];function bj(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
|
|
782
782
|
olympe.dc.query.Relation=class extends olympe.dc.Sa.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.W())+', ';a+='"direction": '+JSON.stringify(this.Ma())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static Fb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.query.Relation(b.tag,b.direction,b.recursive)}static from(a,b){return new olympe.dc.query.Relation(a.W(),a.Ma(),null!=b?b:a instanceof olympe.dc.aa.Pe)}ac(){const a=
|
|
783
783
|
olympe.dc.ua.DESTINATION,b=olympe.dc.ua.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}T(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.P={Ca:'dc.query.Logger',Ok:'dc.query.QueryProcessor'};olympe.V.config(function(a){D(a,olympe.dc.query.P.Ca,[olympe.ha.P.Ea],b=>b.hd('query'));C(a,olympe.dc.query.P.Ok,olympe.dc.query.sw,olympe.dc.query.P.Ca,olympe.dc.db.P.Ea,olympe.dc.transaction.P.Ea,olympe.dc.P.bh,new olympe.V.ma(olympe.dc.Config.ci))});olympe.V.run([olympe.dc.query.P.Ok],a=>{olympe.dc.query.xl=()=>a});olympe.dc.query.Id=class extends Error{};olympe.dc.query.Y={};olympe.dc.query.Y.Rd=class extends olympe.dc.query.za{constructor(...a){super();this.Y=a}compile(){return this.Y.reduce((a,b)=>{const c=[];for(const d of b.compile()){for(const e of a)d.push(...e);c.push(d)}return c},[])}Ed(){return new olympe.dc.query.Y.Ke(...this.Y.map(a=>a.Ed()))}xb(){return this.Y.flatMap(a=>a.xb())}Mc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}nb(a){return this.Y.reduce((b,c)=>b&&c.nb(a),!0)}observe(a,b,c){const d=
|
|
@@ -798,7 +798,7 @@ function fj(a,b){if(null===a.D)return b;let c=!1;const d=a.toString();return(e,f
|
|
|
798
798
|
olympe.dc.query.na.fn=class{constructor(a,b){this.db=olympe.dc.fa();this.j=a;this.optional=b;this.ba=this.Jb=this.D=this.id=null}static j(a){var b=a.i;if('string'===typeof a.f)return new olympe.dc.query.na.Sd(b,a.f);var c=a.o;const d=new olympe.dc.Sa.Relation(a.t,a.d);b='boolean'===typeof a.s?new olympe.dc.query.na.He(b,d,a.s,c):new olympe.dc.query.na.Nh(b,d,c);void 0!==a.p&&(b.D=xi(a.p));void 0!==a.c&&(c=b.T(),a=a.c,a=new olympe.dc.query.Cf(c,new olympe.dc.Sa.Property(a.p),a.o),b.Jb=a);return b}N(){}H(){let a,
|
|
799
799
|
b,c,d;return`${this.j}-${this.optional}${null!=(c=null==(a=this.D)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.Jb)?void 0:b.toString())?d:''}`}Sc(){}toJSON(){}ga(){const a={i:this.j,o:this.optional};null!==this.D&&(a.p=this.D.ga());null!==this.Jb&&(a.c=this.Jb.ga());return a}X(){}ia(){return new olympe.dc.query.na.rn}Z(){}T(){this.id||(this.id=this.X());return this.id}R(){return this.optional}Mc(a){const b=dj(this);if(0===b.length)return!0;a=dj(a);if(0===a.length)return!1;for(const c of a)if(!b.some(d=>
|
|
800
800
|
ej(d,c)))return!1;return!0}filter(a){const b=this.N(),c=b.D;null===c?b.D=a:b.D=c instanceof olympe.dc.query.Y.Rd?new olympe.dc.query.Y.Rd(...Array.from(c.Y),a):new olympe.dc.query.Y.Rd(b.D,a);return b}sort(a,b){const c=this.N();c.Jb=new olympe.dc.query.Cf(this.T(),a,b);return c}qh(){return this.Jb}nb(a){if(null!==this.D){var b=this.T();for(const c of pi(a,b))this.D.nb(c)||a.remove(c,b,null)}}observe(a,b){const c=this.T();return fj(this,gj(this,a,(d,e,f,g)=>{(d?ri(a,e,c,f):a.remove(e,c,f))&&b(d,e,
|
|
801
|
-
f,g)}))}Fa(){}};olympe.dc.query.na.ai=class extends olympe.dc.query.na.fn{constructor(a,b,c){super(a,c);this.relation=b;this.va=null}};olympe.dc.query.na.gn=class{has(){}H(){}j(){}Cc(){}D(){}remove(){}};olympe.dc.query.na.Sd=class extends olympe.dc.query.na.fn{constructor(a,b,c){super(a,!1);this.Tb=b;this.F=null!=c?c:null}N(){return new olympe.dc.query.na.Sd(this.j,this.Tb,this.F)}X(){return olympe.U.sb(this.j+'followRules')}ia(){return new olympe.dc.query.na.Cq(this.db,this.F)}Z(a,b){return b instanceof olympe.dc.query.na.Sd?[a]:[olympe.U.sb(a+'followRules')]}Mc(a){if(a instanceof olympe.dc.query.na.ai){const b=olympe.dc.ua.ORIGIN,c=olympe.dc.ua.DESTINATION,d=olympe.dc.
|
|
801
|
+
f,g)}))}Fa(){}};olympe.dc.query.na.ai=class extends olympe.dc.query.na.fn{constructor(a,b,c){super(a,c);this.relation=b;this.va=null}};olympe.dc.query.na.gn=class{has(){}H(){}j(){}Cc(){}D(){}remove(){}};olympe.dc.query.na.Sd=class extends olympe.dc.query.na.fn{constructor(a,b,c){super(a,!1);this.Tb=b;this.F=null!=c?c:null}N(){return new olympe.dc.query.na.Sd(this.j,this.Tb,this.F)}X(){return olympe.U.sb(this.j+'followRules')}ia(){return new olympe.dc.query.na.Cq(this.db,this.F)}Z(a,b){return b instanceof olympe.dc.query.na.Sd?[a]:[olympe.U.sb(a+'followRules')]}Mc(a){if(a instanceof olympe.dc.query.na.ai){const b=olympe.dc.ua.ORIGIN,c=olympe.dc.ua.DESTINATION,d=olympe.dc.hc.ed,e=olympe.dc.hc.Pi,f=
|
|
802
802
|
olympe.dm.Relation.j.Tr,g=olympe.dm.Relation.j.As;a=a.relation;const h=a.Ma(),k=a.W();return h!==c||k!==d&&k!==e?!!(rh(this.db,a,this.Tb)&(a.Ma()===b?f:g)):!0}return a instanceof olympe.dc.query.na.Sd?this.Tb===a.Tb:!1}nb(a){const b=this.T();for(const c of pi(a,this.j))for(const d of ng(this.db,c,this.Tb))ri(a,d,b,c)}observe(a,b){const c=this.T(),d=(e,f,g,h)=>{const k=`${h}:${g}`;f?sh(this.db,g,this.Tb,(l,n,p,q,r)=>{p&&(p=q?ri(a,r,c,g):a.remove(r,c,g),null!==n&&si(a,q,l,n,g,r),p&&d(e,q,r,h))},k):
|
|
803
803
|
th(this.db,g,this.Tb,k);b(f,g,e,k)};return(e,f,g,h)=>{(e?ri(a,f,c,f):a.remove(f,c,f))&&d(f,e,f,olympe.U.sb(h+f+this.toString()))}}ga(){return Object.assign(super.ga(),{f:this.Tb})}H(){return`followRulePart-${this.Tb}-${super.H()}`}Sc(){throw Error('Try to parse a part of an implicit query. Data connectors do not support those queries.');}toString(){return`FollowRule Part: ${this.db.name(this.Tb)} (${this.Tb})`}Fa(a){return a instanceof olympe.dc.query.na.Sd&&this.Tb===a.Tb}toJSON(){return{type:'follow rule',
|
|
804
804
|
rule:`${this.db.name(this.Tb)} (${this.Tb})`}}R(){return!1}filter(){olympe.ha.Va('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.ha.Va('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.na.Sd.D='followRules';olympe.dc.query.na.Nh=class extends olympe.dc.query.na.ai{constructor(a,b,c){super(a,olympe.dc.query.Relation.from(b,!1),c)}N(){const a=new olympe.dc.query.na.Nh(this.j,this.relation,this.optional);a.D=this.D;a.Jb=this.Jb;return a}X(){return olympe.U.sb(this.j+this.relation.T())}Z(a,b){if(b instanceof olympe.dc.query.na.Sd)return[a];const c=[a+this.relation.T(),a+bj(this.relation).T()+!1,a+bj(this.relation).T()+!0,a+'followRules'].map(d=>olympe.U.sb(d));b instanceof olympe.dc.query.na.He&&b.relation.Fa(this.relation)&&
|
|
@@ -816,50 +816,50 @@ p instanceof Uint8Array&&(aa.content=p);break;default:throw Error(`Data Http req
|
|
|
816
816
|
new olympe.net.vd(`Authorization error: ${r}`,pj,'Forbidden'):new olympe.net.vd(`Internal server error: ${r}`,qj,'Internal server error')}})).catch(c=>a.G.error(`Error while starting the HTTP Service: ${c}`));a.G.debug(`Started HTTP service with path: ${b}`)}function uj(a){a.R.R('_DataSourcesHTTPService').catch(b=>{a.G.error(`An error occurred while stopping the data sources http service: ${b}`)})}function vj(a,b,c){0===a.F.size&&sj(a);a.F.set(b,c);return()=>{a.F.delete(b);0===a.F.size&&uj(a)}}
|
|
817
817
|
function wj(a,b,c){c=b instanceof olympe.dm.DataSource?b.Wf(c):xj(b,c);null===c&&a.G.error(`Impossible to build URL for data source ${b}`);return c}
|
|
818
818
|
function yj(a,b,c){if(b===olympe.dc.Ia.SERVER){var d;return null!=(d=re(a.H,a.ba.get(c)))?d:null}var e=a.N.get(b);if(!e){d=a.Z.lb(b);e=olympe.dc.sources.Config.Oh;const f=olympe.dc.sources.Config.Gf,g=olympe.dc.sources.Config.Ui,h=olympe.dc.sources.Config.Em;let k;e=`${wj(a,null!=d?d:b,g)?'https':'http'}://${wj(a,null!=d?d:b,e)}:${null!=(k=wj(a,null!=d?d:b,f))?k:wj(a,null!=d?d:b,g)?443:80}`+`/${wj(a,null!=d?d:b,h)}/${b}`.replace(/\/+/g,'/').replace(/\/$/,'');a.N.set(b,e)}return`${e}/${c}`}
|
|
819
|
-
function zj(a,b){return b instanceof olympe.net.Wi?te(a.H,b,de(a.X).Bd()):Promise.reject('No http request to send')}function Aj(a,b){var c=yj(a,b.
|
|
820
|
-
function Bj(a,b){var c=yj(a,b.
|
|
819
|
+
function zj(a,b){return b instanceof olympe.net.Wi?te(a.H,b,de(a.X).Bd()):Promise.reject('No http request to send')}function Aj(a,b){var c=yj(a,b.kc(),b.getType());if(!c)return Promise.reject(`No destination URL to send the query to destination: ${b.kc()}`);const d=b.content,e=JSON.stringify(a.D.ga(d));c=N(c,ij,e,olympe.net.ra.ResponseType.JSON);O(c,{['X-Source-Origin']:b.origin,[lj]:'application/json'});return zj(a,c).then(f=>(f=f.getData())?a.D.N(f):olympe.dc.query.Jd.Cj(d))}
|
|
820
|
+
function Bj(a,b){var c=yj(a,b.kc(),b.getType());if(!c)return Promise.reject(`No destination URL to send the transaction to destination: ${b.kc()}`);const d=JSON.stringify(a.D.ga(b.content));c=N(c,ij,d);O(c,{['X-Source-Origin']:b.origin,[lj]:'application/json'});return zj(a,c).then(e=>Number.parseInt(e.getData(),10))}function tj(a,b){return'string'!==typeof b?Promise.reject('Please provide an authorization token.'):new Promise((c,d)=>{a.X.vh(b,(e,f)=>{e?d(e):c(f)})})}
|
|
821
821
|
olympe.dc.sources.Qu=class{constructor(a,b,c,d,e,f){this.G=a;this.R=b;this.H=c;this.X=d;this.Z=e;this.D=f;this.F=new Map;new olympe.C.Zb('Http service of remote data provider');this.N=new Map;this.j=new Map;this.ba=new Map([[olympe.dc.Request.j.Rg,olympe.L.Sb.Rg],[olympe.dc.Request.j.kg,olympe.L.Sb.qk],[olympe.dc.Request.j.ug,olympe.L.Sb.qk],[olympe.dc.Request.j.ig,olympe.L.Sb.qk],[olympe.dc.Request.j.Ko,olympe.L.Sb.Jo],[olympe.dc.Request.j.Rr,olympe.L.Sb.Qr],[olympe.dc.Request.j.eq,olympe.L.Sb.cq],
|
|
822
|
-
[olympe.dc.Request.j.$g,olympe.L.Sb.Xo],[olympe.dc.Request.j.lh,olympe.L.Sb.TRANSACTION]])}Oc(a){var b=yj(this,a.
|
|
823
|
-
const g=N(e===olympe.dc.Ia.SERVER?`${f}/${b}`:`${f}?tag=${b}&model=${c}`,kj,d);O(g,{[lj]:'application/octet-stream'});e!==olympe.dc.Ia.SERVER&&O(g,{['X-Source-Origin']:a.origin});return zj(this,g).then(()=>(new URL(g.j())).pathname)}deleteFileContent(a){const {tag:b,model:c}=a.content,d=a.
|
|
824
|
-
{['X-Source-Origin']:a.origin});return zj(this,e).then(()=>{})}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.
|
|
822
|
+
[olympe.dc.Request.j.$g,olympe.L.Sb.Xo],[olympe.dc.Request.j.lh,olympe.L.Sb.TRANSACTION]])}Oc(a){var b=yj(this,a.kc(),a.getType());if(!b)return Promise.reject(`No destination URL to send the status request to destination: ${a.kc()}`);b=Gc(N(b,hj),olympe.net.ra.ResponseType.JSON);O(b,{['X-Source-Origin']:a.origin});return zj(this,b).then(c=>c.getData())}uploadFileContent(a){const {tag:b,model:c,content:d}=a.content,e=a.kc(),f=yj(this,e,a.getType());if(!f)return Promise.reject(`No destination URL to upload the file. ${b}`);
|
|
823
|
+
const g=N(e===olympe.dc.Ia.SERVER?`${f}/${b}`:`${f}?tag=${b}&model=${c}`,kj,d);O(g,{[lj]:'application/octet-stream'});e!==olympe.dc.Ia.SERVER&&O(g,{['X-Source-Origin']:a.origin});return zj(this,g).then(()=>(new URL(g.j())).pathname)}deleteFileContent(a){const {tag:b,model:c}=a.content,d=a.kc();var e=yj(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to delete the file. ${b}`);e=N(d===olympe.dc.Ia.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,jj,b);d!==olympe.dc.Ia.SERVER&&O(e,
|
|
824
|
+
{['X-Source-Origin']:a.origin});return zj(this,e).then(()=>{})}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.kc();var e=yj(this,d,a.getType());if(!e)return Promise.reject(Error(`No destination URL to download the file. ${b}`));var f;const g=null!=(f=this.j.get(b))?f:[];f=new Promise((h,k)=>{g.push({done:h,si:k})});if(this.j.has(b))return f;this.j.set(b,g);e=N(d===olympe.dc.Ia.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,hj,void 0,olympe.net.ra.ResponseType.ei);d!==olympe.dc.Ia.SERVER&&
|
|
825
825
|
O(e,{['X-Source-Origin']:a.origin});zj(this,e).then(h=>{let k;null==(k=this.j.get(b))||k.forEach(l=>l.done(h.getData()))}).catch(h=>{let k;null==(k=this.j.get(b))||k.forEach(l=>l.si(`${h}`))}).finally(()=>{this.j.delete(b)});return f}};olympe.dc.sources.Aq=class{constructor(a,b){this.G=a;this.Lb=b}};olympe.dc.sources.Aq.Wb={nj:0,lD:1,mD:3,GC:4};const Cj=olympe.dc.Request.j.tc,Dj=olympe.dc.Request.j.$g,Ej=olympe.dc.Request.j.Pk,Fj=olympe.dc.Request.j.ug,Gj=olympe.dc.Request.j.kg,Hj=olympe.dc.Request.j.ig,Ij=olympe.dc.Request.j.Ji,Jj=olympe.dc.Request.j.Dh,Kj=olympe.dc.Request.j.hf,Lj=olympe.dc.Request.j.lh,Mj=olympe.dc.Request.j.jk;
|
|
826
|
-
function Nj(a,b){const c=b.T();null===a.D&&(a.D=new olympe.U.di(6E4),ib(a.D,(f,g)=>{a.applyTransaction(g,!1).catch(h=>{a.G.error(`Error occurred when applying burst transaction ${f} to the data source: ${h}`)})}),jb(a.D,()=>{a.D=null}));let d;const e=null!=(d=a.D.get(c))?d:new olympe.dc.db.
|
|
827
|
-
function Pj(a,b){const c=b.T();let d,e;const f=null!=(e=null==(d=a.D)?void 0:d.get(c))?e:new olympe.dc.db.
|
|
826
|
+
function Nj(a,b){const c=b.T();null===a.D&&(a.D=new olympe.U.di(6E4),ib(a.D,(f,g)=>{a.applyTransaction(g,!1).catch(h=>{a.G.error(`Error occurred when applying burst transaction ${f} to the data source: ${h}`)})}),jb(a.D,()=>{a.D=null}));let d;const e=null!=(d=a.D.get(c))?d:new olympe.dc.db.fc(c);b.ic(e);gb(a.D.j,c)||a.D.set(c,e)}function Oj(a,b){return u(function*(){const c=Tf(new olympe.dc.Request(olympe.dc.Request.j.jk,a.T(),b),olympe.dc.Ia.SELF);let d;yield null==(d=a.Lb)?void 0:d.Bi(c)})}
|
|
827
|
+
function Pj(a,b){const c=b.T();let d,e;const f=null!=(e=null==(d=a.D)?void 0:d.get(c))?e:new olympe.dc.db.fc(c);let g;null==(g=a.D)||g.delete(c);b.ic(f);return a.applyTransaction(f,!1).catch(h=>{a.G.error(`Error occurred when applying burst transaction ${c} to the data source: ${h}`)})}function Qj(a,b){const c=rxjs.defer(()=>a.j.executeQuery(b));return 0<a.N?rxjs.interval(a.N).pipe(rxjs.operators.switchMap(()=>c)):c}
|
|
828
828
|
olympe.dc.sources.Pq=class{constructor(a,b){this.G=a;this.j=b;this.Lb=null;this.H=olympe.dc.query.xl();this.F=new olympe.C.Zb('Context of source '+this.T());let c;this.N=null!=(c=b.Wf(olympe.dc.sources.Config.cn))?c:-1;this.D=null}T(){return this.j.T()}init(a){this.Lb=a;if(this.T()===olympe.dc.Ia.SELF)return this;(new Promise((b,c)=>{let d=!0;Rj(this.j,this.F).subscribe(rxjs.Subscriber.create(e=>{if(this.G.j()){this.G.debug(`Data source ${this.j.name()} has loaded ${e.size()} data types in its cache:`);
|
|
829
829
|
for(const [f,g]of e)this.G.debug(`=> DataType: ${g.name()} (${f})`)}d&&(d=!1,b())},c))})).then(()=>this.j.init(this.F)).catch(b=>{this.G.error(`Error while initialization of DataSource ${this.j.name()} (${this.T()}): ${b}`)});return this}healthCheck(){return this.j.healthCheck().then(()=>`Data source ${this.j.name()} (${this.j.T()}) OK`)}destroy(){this.F.destroy();return this.j.destroy()}request(a){const b=a.content;var c=a.getType();switch(c){case Cj:const d=olympe.dm.DataSource.tc.Bb,e=olympe.dm.DataSource.tc.$h;
|
|
830
|
-
return this.j.healthCheck().then(()=>({s:e})).catch(h=>({s:d,r:String(h)}));case Dj:return this.j.executeQuery(b);case Ij:const f=b.
|
|
831
|
-
error:null}),this.T());let k;null==(k=this.Lb)||k.Rc(h)}});case Jj:return Pj(this,b.
|
|
830
|
+
return this.j.healthCheck().then(()=>({s:e})).catch(h=>({s:d,r:String(h)}));case Dj:return this.j.executeQuery(b);case Ij:const f=b.ec();Nj(this,f);Oj(this,Pf(f)).catch(h=>{this.G.warn(`Error occurred when applying burst transaction ${f.T()} to the data source: ${h}`)});return Promise.resolve();case Kj:case Lj:const g=b.ec();return this.applyTransaction(g,c===Lj).finally(()=>{if(a.origin===olympe.dc.Ia.SELF){var h=g.T();h=Tf(new olympe.dc.Request(olympe.dc.Request.j.rk,olympe.dc.Ia.SELF,{id:h,finalize:olympe.dc.transaction.Pf.j.cj,
|
|
831
|
+
error:null}),this.T());let k;null==(k=this.Lb)||k.Rc(h)}});case Jj:return Pj(this,b.ec());case Fj:return b.content instanceof Uint8Array?this.j.uploadFileContent(b.tag,b.model,b.content).then(()=>`datasource://${b.tag}`):Promise.reject('File content is undefined');case Gj:return this.j.downloadFileContent(b.tag,b.model);case Hj:return this.j.deleteFileContent(b.tag,b.model);case Mj:return c=Tf(new olympe.dc.Request(Mj,olympe.dc.Ia.SELF,b,a.Dc()),this.T()),this.Lb.Rc(c);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}subscribe(a){if(a.getType()===
|
|
832
832
|
Ej){const b=a.content;a=a.origin;return a===olympe.dc.Ia.SELF?Qj(this,b):Ei(this.H,b,this.F,a,olympe.dc.la.qc.Bf,{}).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.We)?void 0:d.F)?e:null}),rxjs.operators.filter(c=>null!==c),rxjs.operators.map(c=>Pf(c,Date.now())))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a,b){const c=this;return u(function*(){var d=Sj(a);yield c.j.applyTransaction(d,{batch:b});d=Date.now();yield Oi(c.H,c.T(),a);const e=
|
|
833
833
|
Pf(a,d);yield Oj(c,e);return d})}};olympe.dc.sources.Pq.ya=[olympe.dc.sources.mk];function Sj(a){const b=olympe.dc.sources.rg.j.nu,c=olympe.dc.sources.rg.j.kx,d=olympe.dc.sources.rg.j.tu,e=olympe.dc.sources.rg.j.ou,f=olympe.dc.sources.rg.j.uu,g=[],h=[],k=[],l=[],n=[];a.Cb.forEach((p,q)=>{const r=p.Xb();p.D()?g.push(Tj(b,q,r,p.N()?p.xb():null)):p.Dd()?k.push(Tj(d,q,r,null,p.F())):p.N()&&h.push(Tj(c,q,r,p.xb()));for(const [t,v,x]of p.Md())p=a.$c(v),x?l.push(new Uj(e,t,q,v,r,p.Xb())):n.push(new Uj(f,t,q,v,r,p.Xb()))});return n.concat(k,g,h,l)}
|
|
834
834
|
function Tj(a,b,c,d,e){if('string'!==typeof c)throw Error(`Patch: model of instance ${b} is missing. It is invalid transaction.`);return new Vj(a,b,c,d,e)}olympe.dc.sources.rg=class{constructor(a){this.type=a}};class Vj extends olympe.dc.sources.rg{constructor(a,b,c,d,e){super(a);this.object=b;this.model=c;this.properties=null!=d?d:null;this.deleteRules=null!=e?e:olympe.dc.Hb.NONE}}
|
|
835
835
|
class Uj extends olympe.dc.sources.rg{constructor(a,b,c,d,e,f){super(a);this.relation=b;this.from=c;this.to=d;this.fromModel=e;this.toModel=f}}olympe.dc.sources.rg.j={nu:'CREATE',kx:'UPDATE',tu:'DELETE',ou:'CREATE_RELATION',uu:'DELETE_RELATION'};function Wj(a,b){b=Tf(new olympe.dc.Request(olympe.dc.Request.j.rk,olympe.dc.Ia.SELF,{id:b,finalize:olympe.dc.transaction.Pf.j.cj,error:null}),a.T());let c;null==(c=a.Lb)||c.Rc(b)}
|
|
836
836
|
olympe.dc.sources.km=class{constructor(a,b){this.G=a;this.D=b;this.Lb=null}T(){}X(){}Z(){}init(a){this.Lb=a;return this}destroy(){return Promise.resolve()}request(a){const b=this;return u(function*(){if(!b.D.j)return b.X(a);var c=olympe.dc.Request.j.tc,d=olympe.dc.Request.j.$g;const e=olympe.dc.Request.j.hf,f=olympe.dc.Request.j.lh;var g=olympe.dc.Request.j.Ji;const h=olympe.dc.Request.j.Dh,k=olympe.dc.Request.j.ug;var l=olympe.dc.Request.j.kg;const n=olympe.dc.Request.j.ig,p=olympe.dc.sources.je(),
|
|
837
|
-
q=a.getType(),r=a.
|
|
838
|
-
x.
|
|
839
|
-
case d:return p.executeQuery(a.content);case e:case f:case h:d=a.content;const t=d.
|
|
840
|
-
b);const c=olympe.dc.sources.je(),d=a.content,e=a.
|
|
841
|
-
throw g;}))))}};olympe.dc.sources.km.ya=[olympe.dc.sources.mk];const bk=olympe.dc.Request.j.tc,ck=olympe.dc.Request.j.$g,dk=olympe.dc.Request.j.Pk,ek=olympe.dc.Request.j.hf,fk=olympe.dc.Request.j.lh,gk=olympe.dc.Request.j.Ji,hk=olympe.dc.Request.j.Dh,ik=olympe.dc.Request.j.ug,jk=olympe.dc.Request.j.kg,kk=olympe.dc.Request.j.ig;function lk(a,b){let c;return(null==(c=a.Ga.lb(b))?void 0:c.Wf(olympe.dc.sources.Config.Ze))!==olympe.dm.DataSource.Ze.kq}
|
|
837
|
+
q=a.getType(),r=a.kc();if(Nd(b.D)){q===d&&(c=a.content,(g=Vf(a).get(olympe.dc.la.j.fm))&&(yield Xj(p,c.T(),g)),b.G.debug(`Data Provider: Query ${c.T()} will be executed with its default Remote or Server provider`));if(q===l&&(l=a.content,'string'===typeof(null==l?void 0:l.url)&&l.url.startsWith('offline://')))return p.downloadFileContent(l.tag);l=yield b.X(a);if(q===d){const t=a.content;if(l instanceof ReadableStream){const v=new olympe.dc.db.fc(`fullResult_${t.T()}`);l=l.pipeThrough(new TransformStream({transform:(x,
|
|
838
|
+
y)=>u(function*(){const z=x.ec();yield Yj(p,z);z.ic(v);b.G.j()&&b.G.debug(`Data Provider: Data result for query ${t.T()}`,z.Cb.size,'instances',Array.from(z.Md()).length,'relations');y.enqueue(x)}),flush:()=>u(function*(){yield Zj(p,t.T(),r,v,!0)})}))}else d=l.ec(),yield Yj(p,d),yield Zj(p,t.T(),r,d,!0)}else if(q===e||q===f||q===h)b.G.debug('Data Provider: Persisting graph patch in offline cache after successful transaction'),yield ak(p,null,r,a.content.ec(),!1);return l}b.G.debug(`Data Provider: Request (type: ${q}) will be sent to the cache data provider: ${a.content}`);
|
|
839
|
+
switch(q){case c:return{s:olympe.dm.DataSource.tc.Jf};case d:return p.executeQuery(a.content);case e:case f:case h:d=a.content;const t=d.ec().T();return p.applyTransaction(d,r).finally(()=>Wj(b,t));case g:return Promise.resolve();case k:return d=a.content,p.uploadFileContent(d.tag,d.content,d.mimeType);case l:return p.downloadFileContent(a.content.tag);case n:return p.deleteFileContent(a.content.tag);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${b.T()}`)}})}subscribe(a,
|
|
840
|
+
b){if(!this.D.j)return this.Z(a,b);const c=olympe.dc.sources.je(),d=a.content,e=a.kc();return rxjs.of(null).pipe(rxjs.operators.switchMap(()=>{if(Nd(this.D)){const f=new rxjs.Observable(h=>{olympe.C.Et([this.D.uf()],()=>{h.error(new olympe.error.hq('Go Offline',d.T()))})}),g=this.Z(a,b);return rxjs.merge(f,g)}return new rxjs.Observable(f=>{olympe.C.Et([this.D.uf()],()=>{f.error(new olympe.error.Wo('Back Online',d.T()))})})})).pipe(rxjs.operators.switchMap(f=>rxjs.from(ak(c,d.T(),e,f.ec()).then(()=>
|
|
841
|
+
f).catch(g=>{this.G.error(`Data Provider: Cache database failed to handle the data result with message: ${g}`);throw g;}))))}};olympe.dc.sources.km.ya=[olympe.dc.sources.mk];const bk=olympe.dc.Request.j.tc,ck=olympe.dc.Request.j.$g,dk=olympe.dc.Request.j.Pk,ek=olympe.dc.Request.j.hf,fk=olympe.dc.Request.j.lh,gk=olympe.dc.Request.j.Ji,hk=olympe.dc.Request.j.Dh,ik=olympe.dc.Request.j.ug,jk=olympe.dc.Request.j.kg,kk=olympe.dc.Request.j.ig;function lk(a,b){let c;return(null==(c=a.Ga.lb(b))?void 0:c.Wf(olympe.dc.sources.Config.Ze))!==olympe.dm.DataSource.Ze.kq}
|
|
842
842
|
function mk(a,b){let c;return(null==(c=a.Ga.lb(b))?void 0:c.Wf(olympe.dc.sources.Config.Ze))!==olympe.dm.DataSource.Ze.No}function nk(a,b,c){const d=c.content.T();let e=a.ba.get(d);e||(e=olympe.L.rb.st(b),a.ba.set(d,e));return e.qd(c)}function ok(a,b){b=b.Dc();if(b!==olympe.dm.User.j&&a.Wf(olympe.dc.sources.Config.ln))throw a=`User ${b} has no right to access the restricted data source ${a.name()} (${a.T()}). Please use an admin account instead.`,new olympe.error.Dk(a);}
|
|
843
|
-
function pk(a,b,c,d,e){return u(function*(){var f=olympe.L.pa.j.SEND,g=olympe.L.pa.j.GET;const h=olympe.L.pa.j.PUBLISH,k=olympe.L.pa.j.SUBSCRIBE,l=d.Gt();var n=d.body();if(e!==n.Dc())throw Error('Access denied: try to impersonate a user');ok(c,n);let p;if(null==(p=a.Lb)||!p.sources.has(n.
|
|
843
|
+
function pk(a,b,c,d,e){return u(function*(){var f=olympe.L.pa.j.SEND,g=olympe.L.pa.j.GET;const h=olympe.L.pa.j.PUBLISH,k=olympe.L.pa.j.SUBSCRIBE,l=d.Gt();var n=d.body();if(e!==n.Dc())throw Error('Access denied: try to impersonate a user');ok(c,n);let p;if(null==(p=a.Lb)||!p.sources.has(n.kc()))throw Error(`Try to process a message with destination data source ${n.kc()} coming from remote but not started here`);if(l===k){if(n.getType()===dk)f=n.content.T();else throw Error('Not supported type of subscription');
|
|
844
844
|
g=yield d.ko(f);a.ia.set(g,f);g=a.N.get(f);g||(g=new qk(a.G,f,b,Tf(n,olympe.dc.Ia.cf)),a.N.set(f,g));g.subscribe()}else l===g?(n=yield b.request(n),void 0!==n?yield d.Rc(n):a.G.warn(`Request from ${d.source()} requires an output value, but got undefined instead.`)):l===f?(yield b.request(n),yield d.ack()):l===h&&(yield b.request(n))})}
|
|
845
|
-
olympe.dc.sources.$r=class extends olympe.dc.sources.km{constructor(a,b,c,d,e,f){super(a,d);this.H=b;this.j=c;this.db=e;this.F=new olympe.C.Zb('Remote Provider Context');this.va=new Map;this.R=new Map;this.N=new Map;this.ia=new Map;this.Ga=f;this.ba=new Map}T(){return olympe.dc.Ia.cf}X(a){var b=olympe.L.rb;const c=a.
|
|
846
|
-
olympe.dm.DataSource.tc.$h;b=lk(this,c)?b.get(c,a):Promise.resolve({s:f});a=mk(this,c)?this.j.Oc(a):Promise.resolve({s:f});return Promise.all([b,a]).then(([k,l])=>{if((null==k?void 0:k.s)===e||(null==l?void 0:l.s)===e){let n,p;return{s:e,r:`${null!=(n=null==k?void 0:k.r)?n:''} ${null!=(p=null==l?void 0:l.r)?p:''}`}}return{s:f}});case ck:return mk(this,c)?Aj(this.j,a):b.get(c,a);case ek:const g=a.content.
|
|
845
|
+
olympe.dc.sources.$r=class extends olympe.dc.sources.km{constructor(a,b,c,d,e,f){super(a,d);this.H=b;this.j=c;this.db=e;this.F=new olympe.C.Zb('Remote Provider Context');this.va=new Map;this.R=new Map;this.N=new Map;this.ia=new Map;this.Ga=f;this.ba=new Map}T(){return olympe.dc.Ia.cf}X(a){var b=olympe.L.rb;const c=a.kc();var d=a.getType();this.G.j()&&this.G.debug(`Request (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);switch(d){case bk:const e=olympe.dm.DataSource.tc.Bb,f=
|
|
846
|
+
olympe.dm.DataSource.tc.$h;b=lk(this,c)?b.get(c,a):Promise.resolve({s:f});a=mk(this,c)?this.j.Oc(a):Promise.resolve({s:f});return Promise.all([b,a]).then(([k,l])=>{if((null==k?void 0:k.s)===e||(null==l?void 0:l.s)===e){let n,p;return{s:e,r:`${null!=(n=null==k?void 0:k.r)?n:''} ${null!=(p=null==l?void 0:l.r)?p:''}`}}return{s:f}});case ck:return mk(this,c)?Aj(this.j,a):b.get(c,a);case ek:const g=a.content.ec().T();return(lk(this,c)?b.get(c,a):Bj(this.j,a)).finally(()=>Wj(this,g));case fk:const h=a.content.ec().T();
|
|
847
847
|
return(mk(this,c)?Bj(this.j,a):b.get(c,a)).finally(()=>Wj(this,h));case gk:return lk(this,c)?nk(this,c,a).catch(k=>{this.G.error(`An error occurred while sending "burst transaction" to the data source ${c}: ${k}`)}):Promise.resolve();case hk:return d=a.content.T(),this.ba.delete(d),lk(this,c)?b.get(c,a):Bj(this.j,a);case ik:return mk(this,c)?this.j.uploadFileContent(a):b.get(c,a);case jk:return mk(this,c)?this.j.downloadFileContent(a):b.get(c,a);case kk:return mk(this,c)?this.j.deleteFileContent(a):
|
|
848
|
-
b.send(c,a);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${this.T()}`)}}Z(a,b){const c=a.
|
|
848
|
+
b.send(c,a);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${this.T()}`)}}Z(a,b){const c=a.kc(),d=a.getType();if(!lk(this,c))return rxjs.throwError(()=>Error(`Subscription request not supported for data source ${this.db.name(c)} (${c}) which uses HTTP only.`));this.G.j()&&this.G.debug(`Subscription (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);return d===dk?olympe.L.rb.observe(c,this.F,a,{onRetry:b}).observable:rxjs.throwError(()=>
|
|
849
849
|
Error(`Do not handle subscription request of type ${d}`))}init(a){super.init(a);if(a.F)return this;olympe.dc.la.from(this.H,this.H).bb(olympe.dm.DataSource.Tj).filter(olympe.dc.query.za.Fa(olympe.dm.DataSource.li,!0)).filter(olympe.dc.query.za.Fa(olympe.dm.DataSource.$s,!0)).observe(this.F).subscribe(b=>{b.Dj().forEach(this.jb.bind(this,a));b.Kj().forEach(c=>{let d;null==(d=this.va.get(c))||d.destroy();this.va.delete(c)})});this.db.Oa(this.H,olympe.dm.DataSource.$s)&&(new olympe.L.rb(this.H,this.F)).listen().subscribe(b=>
|
|
850
850
|
{b=b.body();b instanceof olympe.dc.Request?a.Rc(b):this.G.error('Self source received something else than a data request, ignore it.')});return this}destroy(){return u(function*(){})}jb(a,b){const c=b.W(),d=new olympe.C.Zb(`Published data provider context ${c}`,this.F);this.va.set(c,d);let e;rk(b,d).subscribe(f=>{let g;null==(g=e)||g();let h;null==(h=this.R.get(c))||h.stop();this.R.delete(c);f!==olympe.dm.DataSource.Ze.No&&(e=vj(this.j,c,k=>{ok(b,k);return a.request(k)}),d.onDestroy(()=>{let k;return null==
|
|
851
|
-
(k=e)?void 0:k()}));f!==olympe.dm.DataSource.Ze.kq&&(f=new olympe.C.Zb(`Bus Service of data source ${c}`,d),f=(new olympe.L.rb(c,f)).Ot(this.Xa.bind(this)),this.R.set(c,f),f.listen().subscribe(k=>{k.Fi().then(l=>pk(this,a,b,k,l)).catch(l=>{this.G.warn(`Error occurred while processing request from ${k.source()}: ${l}`);return k.si(l instanceof Error?l:Error(l))})}))})}Bi(a){const b=this;return u(function*(){let c;yield null==(c=b.R.get(a.
|
|
851
|
+
(k=e)?void 0:k()}));f!==olympe.dm.DataSource.Ze.kq&&(f=new olympe.C.Zb(`Bus Service of data source ${c}`,d),f=(new olympe.L.rb(c,f)).Ot(this.Xa.bind(this)),this.R.set(c,f),f.listen().subscribe(k=>{k.Fi().then(l=>pk(this,a,b,k,l)).catch(l=>{this.G.warn(`Error occurred while processing request from ${k.source()}: ${l}`);return k.si(l instanceof Error?l:Error(l))})}))})}Bi(a){const b=this;return u(function*(){let c;yield null==(c=b.R.get(a.kc()))?void 0:c.Bi(a)})}Xa(a){const b=this.ia.get(a);this.ia.delete(a);
|
|
852
852
|
if(a=b)null==(a=this.N.get(b))?a=0:(0<a.j&&--a.j,0===a.j?(a.G.debug(`Data subscription ${a.D} has more subscriber: unsubscribe`),a.F.unsubscribe(),a=!0):(a.G.debug(`Data subscription ${a.D} has ${a.j} subscribers`),a=!1));a&&this.N.delete(b)}};
|
|
853
853
|
class qk{constructor(a,b,c,d){this.G=a;this.D=b;this.j=0;this.F=c.subscribe(d).subscribe({next:e=>{olympe.L.rb.qd(b,e).catch(f=>a.error(`Error occurred while publishing a data notification: ${f}`))},error:e=>a.error(`Error occurred while trying to subscribe to topic ${b} for a datasource: ${e}`)})}subscribe(){this.j++;this.G.debug(`Data subscription ${this.D} has ${this.j} subscribers`);return this}}olympe.dc.sources.$r.ya=[olympe.dc.sources.mk];const X={Ls:10,bp:11,Np:12,Gr:13,QUERY_RESULT:14,fq:15,sp:16,hf:17,Hr:18,rp:19,kj:20};function sk(a,b){const c=new olympe.dc.transaction.Me,d=new olympe.dc.transaction.Me;b.forEach(e=>{const f=new Map(Array.from(Object.entries(e.p).map(([h,k])=>[h,a.j(k)]))),g=e.v?d:c;g.Yc(e.t,e.s,f,e.m);e.r.forEach(h=>g.La(h.r,h.o,h.d))});a.Z.sd(Yf(Zf(d),olympe.dc.Ia.SELF),{persist:!1});a.Z.sd(Yf(Zf(c),olympe.dc.Ia.SELF))}
|
|
854
854
|
olympe.dc.sources.cc=class extends olympe.L.cc{constructor(a){super();this.Z=a;this.db=a.view;this.F=new Map}ga(a){a=super.ga(a);if(0<this.F.size){const b=Array.from(this.F.values());this.F.clear();return Object.assign(this.format(X.Ls,a),{i:b})}return a}N(a){return(null==a?void 0:a.t)===X.Ls&&Array.isArray(null==a?void 0:a.i)?(sk(this,a.i),this.j(a.v)):this.j(a)}D(a){switch(!0){case a instanceof olympe.dm.File:var b=this.format,c=X.Np;{const d=a.W(),e={t:d};if(!this.F.has(d)&&(this.H(d),!this.db.Ve(d))){const f=
|
|
855
|
-
a.get(olympe.dm.File.urlProp);if(f.startsWith('blob:')||f.startsWith('stream:'))a=olympe.dc.it().Ga(a),this.F.get(d).p[olympe.dm.File.urlProp.W()]='stream://'+d,e.s=this.D(a)}a=e}return b.call(this,c,a);case a instanceof olympe.dc.CloudObject:return this.format(X.bp,this.H(a.W()));case a instanceof olympe.dc.la:return this.format(X.Gr,a.ga());case a instanceof olympe.dc.Ka:return this.format(X.QUERY_RESULT,a.ga(this.H.bind(this)));case a instanceof olympe.dc.db.
|
|
856
|
-
a.
|
|
855
|
+
a.get(olympe.dm.File.urlProp);if(f.startsWith('blob:')||f.startsWith('stream:'))a=olympe.dc.it().Ga(a),this.F.get(d).p[olympe.dm.File.urlProp.W()]='stream://'+d,e.s=this.D(a)}a=e}return b.call(this,c,a);case a instanceof olympe.dc.CloudObject:return this.format(X.bp,this.H(a.W()));case a instanceof olympe.dc.la:return this.format(X.Gr,a.ga());case a instanceof olympe.dc.Ka:return this.format(X.QUERY_RESULT,a.ga(this.H.bind(this)));case a instanceof olympe.dc.db.fc:return b=new olympe.dc.transaction.Me,
|
|
856
|
+
a.ic(b),this.format(X.fq,{i:a.T(),p:Zf(b)});case a instanceof olympe.dc.Request:return this.format(X.sp,{r:a.getType(),o:a.origin,d:a.kc(),u:a.Dc(),c:this.D(a.content)});case a instanceof olympe.dc.transaction.qj:return this.format(X.hf,{r:a.yh(),p:this.D(a.ec())});case a instanceof olympe.dc.query.Jd:return this.format(X.Hr,a.ga());case a instanceof olympe.dc.Pg:return this.format(X.rp,a.ga());case a instanceof olympe.dc.rc:return this.format(X.kj,this.H(a.W()));default:return super.D(a)}}j(a){if(null===
|
|
857
857
|
a||'object'!==typeof a)return super.j(a);const {t:b,v:c}=a;switch(b){case X.Np:var d=c.t;c.s&&(a=this.j(c.s),olympe.dc.it().vb(d,a));return olympe.dc.CloudObject.get(d);case X.bp:return olympe.dc.CloudObject.get(c);case X.Gr:return d=c.p.map(olympe.dc.query.na.fn.j),a=c.e,new olympe.dc.la(c.b,c.s,d,d.length-1,new Set(c.r),{max:a.m,offset:a.o,Qd:a.s,Xe:a.rm});case X.QUERY_RESULT:return Qi(c);case X.fq:return(new olympe.dc.transaction.hj).j(c.p,c.i);case X.sp:return a=null!=(d=this.j(c.c))?d:void 0,
|
|
858
858
|
Tf(new olympe.dc.Request(c.r,c.d,a,c.u),c.o);case X.hf:return d=this.j(c.p),new olympe.dc.transaction.qj(d,c.r);case X.Hr:return olympe.dc.query.Jd.j(c);case X.rp:return olympe.dc.Pg.j(c);case X.kj:return new olympe.dc.rc(c);default:return super.j(a)}}H(a){if(this.F.has(a))return a;if(!this.db.Ja(a))throw new olympe.dc.sr(a);const b={};this.db.xb(a).forEach((d,e)=>{b[e]=this.D(d)});var c=[];for(const [d,e,f]of vh(this.db,a))this.F.has(f)&&c.push(e===olympe.dc.ua.DESTINATION?{r:d,o:a,d:f}:{r:d,o:f,
|
|
859
859
|
d:a});c={t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:c};this.db.Ve(a)||(c.v=!0);this.F.set(a,c);return a}};const tk=olympe.dc.Request.j.Rg,uk=olympe.dc.Request.j.hf,vk=olympe.dc.Request.j.lh,wk=olympe.dc.Request.j.Ji,xk=olympe.dc.Request.j.Ko,yk=olympe.dc.Request.j.Rr,zk=olympe.dc.Request.j.$g,Ak=olympe.dc.Request.j.Pk,Bk=olympe.dc.Request.j.eq,Ck=olympe.dc.Request.j.Lu,Dk=olympe.dc.Request.j.Mu,Ek=olympe.dc.Request.j.Nu,Fk=olympe.dc.Request.j.ig,Gk=olympe.dc.Request.j.kg,Hk=olympe.dc.Request.j.ug,Ik=olympe.dc.Request.j.rk,Jk=olympe.dc.Request.j.ix,Kk=olympe.dc.Request.j.uw,Lk=olympe.dc.Request.j.Zp,Mk=
|
|
860
|
-
olympe.dc.Request.j.Dh,Nk=olympe.dc.Request.j.mu,Ok=olympe.dc.Request.j.tc;function Pk(a){return Qk(a,olympe.dc.Request.j.Rg).then(b=>{b=b.getData().p;const c=Yf(b,a.T());a.G.j()&&a.G.debug('< Get Context result',b);a.G.N()&&a.G.log('< Get Context result has',b.length,'operations');return c})}function Rk(a,b){const c=new olympe.dc.transaction.Me({re:!1,mi:!1}),d=b.
|
|
861
|
-
function Tk(a,b){const c=b.
|
|
862
|
-
function Vk(a,b){const c=new olympe.dc.transaction.Me({re:!1,mi:!1}),d=b.
|
|
860
|
+
olympe.dc.Request.j.Dh,Nk=olympe.dc.Request.j.mu,Ok=olympe.dc.Request.j.tc;function Pk(a){return Qk(a,olympe.dc.Request.j.Rg).then(b=>{b=b.getData().p;const c=Yf(b,a.T());a.G.j()&&a.G.debug('< Get Context result',b);a.G.N()&&a.G.log('< Get Context result has',b.length,'operations');return c})}function Rk(a,b){const c=new olympe.dc.transaction.Me({re:!1,mi:!1}),d=b.ec(),e=b.j;d.ic(c);return Sk(a,uk,{i:d.T(),r:b.yh(),p:Zf(c),bd:e?!0:void 0}).then(f=>f.ct)}
|
|
861
|
+
function Tk(a,b){const c=b.ec(),d=new olympe.dc.transaction.Me({Kl:!0,re:!1,mi:!1});c.ic(d);b=b.j?'bd=true':'';return Qk(a,vk,Zf(d),b,olympe.net.ra.ResponseType.un).then(e=>{try{const f=e.getData();let g;return null!=(g=JSON.parse(f).ct)?g:Date.now()}catch(f){return Date.now()}}).finally(()=>{Uk(a,Ik,{id:c.T(),finalize:olympe.dc.transaction.Pf.j.cj})})}
|
|
862
|
+
function Vk(a,b){const c=new olympe.dc.transaction.Me({re:!1,mi:!1}),d=b.ec();d.ic(c);return Sk(a,wk,{i:d.T(),r:b.yh(),p:Zf(c)},!1).catch(e=>a.G.error(`Error while publishing burst transaction: ${e}`))}function Wk(a,b){const c=new olympe.dc.transaction.Me({re:!1,mi:!1});b=b.ec();b.ic(c);return Sk(a,Mk,{i:b.T(),p:Zf(c)}).then(d=>d.ct)}
|
|
863
863
|
function Xk(a,b){const c=encodeURI(cb(olympe.U.pf(),JSON.stringify(Yk(a,b))));a.G.j()&&a.G.debug(`Static GraphDef query ${b} sent to orchestrator`);return Qk(a,zk,void 0,`query=${c}&v=${a.version}`,olympe.net.ra.ResponseType.qe).then(d=>Zk(a,d))}function $k(a,b){const c=b.T();a.G.j()&&a.G.debug(`Query (${c}) sent to orchestrator: ${b}`);const d=Yk(a,b);return a.va.Ob(()=>Qk(a,Bk,d,void 0,olympe.net.ra.ResponseType.qe)).then(e=>Zk(a,e))}
|
|
864
864
|
function al(a,b){if(!ze(a.F))return a.G.error(`Server is disconnected, backup of instance ${b} is canceled.`),Promise.reject('Server is disconnected');b=Yk(a,olympe.dc.la.from(b));b.f=olympe.dc.Hb.wp;b=N(yj(a.j,olympe.dc.Ia.SERVER,xk),olympe.net.ra.Hd.Xg,JSON.stringify(b),olympe.net.ra.ResponseType.ei);O(b,{[olympe.net.ra.Headers.Gh]:olympe.net.ra.hk.JSON});return zj(a.j,b).then(c=>c.getData())}
|
|
865
865
|
function bl(a,b,c,d){if(!ze(a.F))return a.G.error('Server is disconnected, restore of instance is canceled.'),Promise.reject('Server is disconnected');const e=yj(a.j,olympe.dc.Ia.SERVER,yk);b=N(e+`?debug=${c}&optional=${d}`,olympe.net.ra.Hd.Xg,b);O(b,{[olympe.net.ra.Headers.Gh]:olympe.net.ra.hk.tx});return zj(a.j,b).then(f=>f.getData())}
|
|
@@ -868,7 +868,7 @@ function Yk(a,b){var c=li(b);b={i:b.T(),b:[b.D],m:!0,v:!0};if(c[0]instanceof oly
|
|
|
868
868
|
e))})}return b}function Uk(a,b,c){b=Tf(new olympe.dc.Request(b,olympe.dc.Ia.SELF,c),a.T());let d;null==(d=a.Lb)||d.Rc(b)}
|
|
869
869
|
function Qk(a,b,c,d,e){const f=yj(a.j,a.T(),b);if('string'!==typeof f)return Promise.reject(`ServerProvider: no url for type ${b}`);b=N(`${f}${'string'===typeof d&&0<d.length?`?${d}`:''}`,void 0!==c?olympe.net.ra.Hd.Xg:olympe.net.ra.Hd.GET,c&&JSON.stringify(c));O(b,{[olympe.net.ra.Headers.Gh]:'application/json'});Gc(b,null!=e?e:olympe.net.ra.ResponseType.JSON);return zj(a.j,b)}
|
|
870
870
|
function Zk(a,b){return u(function*(){const c=b.headers.graphId,d=b.getData();let e,f;return(null!=(f=null==(e=a.Ga)?void 0:wb(e,d))?f:olympe.U.stream.Jk.transform(b.getData())).pipeThrough(new TransformStream({transform:(g,h)=>{a.G.debug(`Received ${g.length} operations for patch ${c}`);h.enqueue(Yf(g,a.T(),null,c))}}))})}
|
|
871
|
-
function cl(a,b,c){return u(function*(){const d=b.pi;let e;if(c instanceof olympe.U.stream.sg){e=new olympe.dc.db.
|
|
871
|
+
function cl(a,b,c){return u(function*(){const d=b.pi;let e;if(c instanceof olympe.U.stream.sg){e=new olympe.dc.db.fc(d);try{for(const f=ia(c);;){const g=yield f.next();if(g.done)break;a.R.j(g.value.p,d).ic(e)}}catch(f){a.G.error(`Error while reading the stream: ${f}`),e=new olympe.dc.db.fc(d)}}else e=a.R.j(b.p,d);return Pf(e,b.ct)})}
|
|
872
872
|
olympe.dc.sources.qs=class extends olympe.dc.sources.km{constructor(a,b,c,d,e,f,g){super(a,c);this.F=b;this.j=d;this.R=new olympe.dc.transaction.hj(this.T());this.H=new Map;this.N=new Set;this.version=e||'unknown';this.Ga=g?new olympe.U.stream.sx:null;this.va=new olympe.U.promise.cl(f);olympe.C.Mj(this.D.uf(),()=>{this.H.forEach((h,k)=>{h.error(new olympe.error.Vh('Connection to server has been recovered',k))})})}T(){return olympe.dc.Ia.SERVER}X(a){var b=a.getType();const c=a.content,d=Vf(a);switch(b){case Ok:return a=
|
|
873
873
|
olympe.dm.DataSource.tc.Bb,b=olympe.dm.DataSource.tc.$h,Promise.resolve(ze(this.F)?{s:b}:{s:a,r:'Disconnected'});case tk:return Pk(this);case uk:return Rk(this,c);case vk:return Tk(this,c);case wk:return Vk(this,c);case Mk:return Wk(this,c);case zk:return d.get(olympe.dc.la.j.Bq)?Xk(this,c):$k(this,c);case xk:return al(this,c);case yk:return bl(this,c.UF,c.debug,c.optional);case Jk:case Kk:case Lk:case Nk:return Sk(this,b,{});case Gk:return this.j.downloadFileContent(a);case Fk:return this.j.deleteFileContent(a);
|
|
874
874
|
case Hk:return this.j.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}Z(a,b){if(a.getType()===Ak){const c=a.content,d=c.T();return(new rxjs.Observable(e=>{const f=Yk(this,c);this.N.delete(d);this.H.set(d,e);Sk(this,Ck,f).catch(g=>e.error(g))})).pipe(tb(olympe.error.Vh,(e,f)=>{this.G.debug(`Subscribe to topic ${e.T()} now that we are back online, after waiting for ${f}ms`);b()}),rxjs.operators.finalize(()=>{this.N.add(d);Sk(this,Dk,{i:d}).catch(e=>
|
|
@@ -883,11 +883,11 @@ C(a,olympe.dc.sources.P.Qe,olympe.dc.sources.cc,olympe.dc.db.P.Ea);Xa(a,olympe.L
|
|
|
883
883
|
olympe.dc.sources.P.xk,olympe.L.P.Af,olympe.dc.P.Ih,olympe.dc.sources.P.ef);C(a,olympe.dc.sources.P.js,olympe.dc.sources.qs,olympe.dc.sources.P.Ca,olympe.L.P.Wk,olympe.L.P.Af,olympe.dc.sources.P.xk,new olympe.V.ma(olympe.dc.sources.Config.VERSION),new olympe.V.ma(olympe.dc.sources.Config.rr),new olympe.V.ma(olympe.dc.sources.Config.ns));C(a,olympe.dc.sources.P.ef,olympe.dc.sources.al,olympe.dc.P.Ih,new olympe.V.ma(olympe.dc.Config.fh),new olympe.V.ma(olympe.dc.Config.um));D(a,olympe.dc.sources.P.gm,
|
|
884
884
|
[olympe.ha.P.Ea],e=>e.hd('datacache'));C(a,olympe.dc.sources.P.pp,olympe.dc.sources.cache.Cache,olympe.dc.sources.P.gm,olympe.dc.P.bh,olympe.dc.sources.P.qp,olympe.dc.db.P.Ea,olympe.net.P.Ea,olympe.L.P.Af,olympe.Eb.P.Pm,olympe.U.P.Lg,new olympe.V.ma(olympe.net.Config.mr),new olympe.V.ma(olympe.dc.sources.Config.VERSION));C(a,olympe.dc.sources.P.qp,olympe.dc.sources.cache.Hk,olympe.Eb.P.ih,olympe.dc.sources.P.gm,olympe.Eb.P.zk)},'olympe.dc.sources');
|
|
885
885
|
olympe.V.run([olympe.dc.sources.P.ef,olympe.dc.sources.P.pp],(a,b)=>{olympe.dc.le=()=>a;olympe.dc.sources.je=()=>b});olympe.dc.sources.cache={};olympe.dc.sources.cache.errors={};olympe.dc.sources.cache.errors.tn=class extends Error{constructor(a){super(a)}};olympe.dc.sources.cache.errors.ru=class extends olympe.dc.sources.cache.errors.tn{};olympe.dc.sources.cache.errors.ex=class extends olympe.dc.sources.cache.errors.tn{};olympe.dc.sources.cache.errors.ox=class extends olympe.dc.sources.cache.errors.tn{};function el(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a}switch(a.t){case 1:return new Date(a.d);case 2:return olympe.C.Color.Fb(a);case 17:return new olympe.dc.rc(a.v);case 13:return(new olympe.dc.transaction.hj).j(a.v,a.i);default:throw Error(`Impossible to deserialize the following value: ${a}`);}}
|
|
886
|
-
olympe.dc.sources.cache.oq=class{ga(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a;case a instanceof olympe.C.eb:return{t:1,d:a.valueOf().toISOString()};case a instanceof Date:return{t:1,d:a.toISOString()};case a instanceof olympe.C.Color:return Object.assign({t:2},a.toJSON());case a instanceof olympe.dc.rc:return{t:17,v:a.W()};case a instanceof olympe.dc.db.
|
|
886
|
+
olympe.dc.sources.cache.oq=class{ga(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a;case a instanceof olympe.C.eb:return{t:1,d:a.valueOf().toISOString()};case a instanceof Date:return{t:1,d:a.toISOString()};case a instanceof olympe.C.Color:return Object.assign({t:2},a.toJSON());case a instanceof olympe.dc.rc:return{t:17,v:a.W()};case a instanceof olympe.dc.db.fc:const b=new olympe.dc.transaction.Me;a.ic(b);
|
|
887
887
|
return{t:13,i:a.T(),v:Zf(b)};default:throw Error(`Impossible to serialize the following value: ${a}`);}}};function Xj(a,b,c){return u(function*(){fl(a,'queries',b);yield a.init();const d=a.D.has(c)?a.D.get(c):new Set;d.has(b)||(d.add(b),a.D.set(c,d),a.N.next(gl(a)));return hl(a.j,b,c)})}function Yj(a,b){return u(function*(){yield a.init();a.G.debug(`Cache: subtract pending transaction operations from ${b.T()}`);b.R(a.F)})}
|
|
888
888
|
function Zj(a,b,c,d,e=!1){(()=>u(function*(){a.G.debug(`Cache: handle query ${b} graph patch: ${d.T()}`);try{const f=null===b?[]:Array.from(a.D.entries()).filter(([,h])=>h.has(b)).map(([h])=>h),g=1===f.length&&'__code-as-data__'===f[0];if(null===b||!g||a.Z){a.G.debug('Cache: persist graph patch',d.T());if(e&&b){const h=new Set(Array.from(d.Cc()).filter(k=>!k.Dd()).map(k=>k.tag()));yield il(a.j,[b],h)}yield jl(a.j,d,0<f.length?b:null);kl(a,d,c).catch(h=>{a.G.error(`Cache: Failed to download files of a graph patch: ${h}`)})}}catch(f){a.G.error(`Cache: Failed to handle graph patch ${d.T()} with message: ${f}`),
|
|
889
889
|
a.Xc.next(f)}finally{b&&ll(a,'queries',b)}}))().then(()=>{})}function ak(a,b,c,d,e=!1){return u(function*(){yield Yj(a,d);Zj(a,b,c,d,e)})}function ml(){var a=olympe.dc.sources.je();a.Z=!0;a.vb=!0}function fl(a,b,c){const d=a.status.getValue();b in d||(d[b]={total:0,processed:0,values:new Set});d[b].total+=1;d[b].values.add(c);d.processing=!0;a.status.next(d)}
|
|
890
|
-
function ll(a,b,c){const d=a.status.getValue();let e,f;null!=(f=null==(e=d[b])?void 0:e.values)&&f.delete(c)&&(d[b].processed+=1,0===d[b].values.size&&(delete d[b],('queries'===b?'files':'queries')in d||(d.processing=!1)),a.status.next(d))}function nl(a){return u(function*(){a.F=new olympe.dc.db.
|
|
890
|
+
function ll(a,b,c){const d=a.status.getValue();let e,f;null!=(f=null==(e=d[b])?void 0:e.values)&&f.delete(c)&&(d[b].processed+=1,0===d[b].values.size&&(delete d[b],('queries'===b?'files':'queries')in d||(d.processing=!1)),a.status.next(d))}function nl(a){return u(function*(){a.F=new olympe.dc.db.fc;const b=yield ol(a.j);for(const c of b)c.ic(a.F);a.ba.next(0<b.length)})}
|
|
891
891
|
function kl(a,b,c){return u(function*(){const d=pl(b),e=[];for(const g of d){const h=g.tag();if(!(yield ql(a.j,h)))if(fl(a,'files',h),!1===g.Oa(olympe.dm.File.j.W())&&g.Oa(olympe.dm.File.urlProp.W())){var f=g.Oa(olympe.dm.File.urlProp.W());f=N(f);Gc(f,olympe.net.ra.ResponseType.$l);e.push(Hc(a.gd,f).then(k=>{k=k.Oc();if(200>k||300<=k)throw Error(`Failed to download file ${g}. Response code ${k}`);}).finally(()=>ll(a,'files',h)))}else{let k;const l=null!=(k=g.Oa(olympe.dm.File.mimeTypeProp.W()))?k:
|
|
892
892
|
'application/octet-stream';f={tag:h,model:g.Xb(),mimeType:l};const n=new olympe.dc.Request(olympe.dc.Request.j.kg,c,f);f=a.kd.Ob(()=>a.Lb.request(n).then(p=>rl(a.j,h,p,l))).finally(()=>ll(a,'files',h));e.push(f)}}yield Promise.allSettled(e).then(g=>{g.forEach((h,k)=>{if('rejected'===h.status){let l;a.G.warn(`Cache: File content for ${null==(l=d[k])?void 0:l.tag()} was not found`)}})})})}
|
|
893
893
|
function pl(a){const b=[olympe.dc.ea(olympe.dm.File)];if(olympe.dc.CloudObject.exists(olympe.dm.File))b.push(...olympe.dc.la.from(olympe.dm.File).zg(olympe.dc.CloudObject.extendedByRel).Ic().keys());else for(const c of b){let d,e;b.push(...(null!=(e=null==(d=a.$c(c))?void 0:d.cb(olympe.dc.CloudObject.extendedByRel,f=>f))?e:[]))}return b.reduce((c,d)=>{let e,f;d=Array.from(null!=(f=null==(e=a.$c(d))?void 0:e.cb(olympe.dc.CloudObject.instancesRel,g=>g))?f:[]).map(g=>a.$c(g));return c.concat(d)},[])}
|
|
@@ -902,74 +902,74 @@ h,f),yield Bl(a.j,h)}catch(k){throw yl(a,f,k);}d+=1;b.next([e,d])}}a.H=null}))()
|
|
|
902
902
|
function Cl(){const a=olympe.dc.sources.je();return u(function*(){var b=new Set;const c={files:[],patches:[],version:a.version};var d=pl(a.F);for(const e of d)b.has(e.tag())||(d=yield xl(a.j,e.tag()),c.files.push({t:e.tag(),m:d.j,c:a.va.j(d.content)}),b.add(e.tag()));b=yield Dl(a.j);c.patches.push(...b);return JSON.stringify(c)})}
|
|
903
903
|
function El(a){const b=olympe.dc.sources.je();return u(function*(){let c;try{c=JSON.parse(a)}catch(e){throw Error('Invalid pending changes, must be a JSON string');}var d=c.files;if(!Array.isArray(c.patches)||!Array.isArray(d))throw Error('Invalid pending changes, must contain a `patches` array and a `files` array');for(const e of c.files)d=b.va.D(e.c),yield rl(b.j,e.t,d,e.m);yield Fl(b.j,c.patches);yield nl(b);b.Ga.sd(Pf(b.F))})}
|
|
904
904
|
function Gl(){const a=olympe.dc.sources.je();return u(function*(){yield Hl(a.j);yield il(a.j,['local-transaction']);yield nl(a)})}
|
|
905
|
-
olympe.dc.sources.cache.Cache=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.Lb=b;this.j=c;this.Ga=d;this.gd=e;this.jb=f;this.Xa=g;this.va=h;this.version=l;this.Z=this.version!==this.Xa.get('__code-as-data-version__');this.Nb=this.vb=!1;this.D=new Map;this.N=new rxjs.BehaviorSubject([]);this.H=null;this.ba=new rxjs.BehaviorSubject(!1);this.F=new olympe.dc.db.
|
|
905
|
+
olympe.dc.sources.cache.Cache=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.Lb=b;this.j=c;this.Ga=d;this.gd=e;this.jb=f;this.Xa=g;this.va=h;this.version=l;this.Z=this.version!==this.Xa.get('__code-as-data-version__');this.Nb=this.vb=!1;this.D=new Map;this.N=new rxjs.BehaviorSubject([]);this.H=null;this.ba=new rxjs.BehaviorSubject(!1);this.F=new olympe.dc.db.fc;this.Ac=this.zc=!1;this.ia=[];this.X=0;this.Yd=new rxjs.BehaviorSubject(!1);this.status=new rxjs.BehaviorSubject({processing:!1});this.R=
|
|
906
906
|
!1;this.Xc=new rxjs.Subject;this.kd=new olympe.U.promise.cl(k)}Oc(){return this.status.asObservable()}init(){const a=this;return u(function*(){if(!a.zc)if(a.Ac)yield new Promise(b=>{a.ia.push(b)});else{a.Ac=!0;(yield Il(a.j)).forEach(b=>{a.D.set(b.name,new Set(b.Pd))});a.N.next(gl(a));yield nl(a);a.Ga.sd(Pf(a.F));for(const b of a.ia)b();a.zc=!0;a.ia=[]}})}executeQuery(a){const b=this;return u(function*(){yield b.init();return sl(b,a.T())&&li(a).some(c=>c instanceof olympe.dc.query.na.Sd)?Jl(b.j,a).then(olympe.U.stream.dt):
|
|
907
|
-
b.j.executeQuery(a).then(olympe.U.stream.dt)})}applyTransaction(a,b){const c=this;return u(function*(){c.G.debug('Cache: apply transaction',a,b);yield c.init();const d=a.
|
|
907
|
+
b.j.executeQuery(a).then(olympe.U.stream.dt)})}applyTransaction(a,b){const c=this;return u(function*(){c.G.debug('Cache: apply transaction',a,b);yield c.init();const d=a.ec(),e=Array.from(d.Cb.keys());let f,g;const h=Array.from(null!=(g=null==(f=c.H)?void 0:f.j.Cb.keys())?g:[]);let k;b!==(null==(k=c.H)?void 0:k.D)||e.some(l=>!h.includes(l))?(yield Kl(c.j,d,b),c.H=new olympe.dc.sources.cache.pu(d,b),c.ba.next(!0)):(d.ic(c.H.j),yield Kl(c.j,c.H.j,b));d.ic(c.F);yield jl(c.j,d,'local-transaction')})}uploadFileContent(a,
|
|
908
908
|
b,c){const d=this;return u(function*(){yield d.init();yield rl(d.j,a,b,c);return`offline://${a}`})}downloadFileContent(a){const b=this;return u(function*(){yield b.init();return xl(b.j,a).then(c=>c.content)})}deleteFileContent(a){const b=this;return u(function*(){yield b.init();yield Ll(b.j,[a])})}};olympe.dc.sources.cache.pu=class{constructor(a,b){this.j=a;this.D=b}};olympe.dc.sources.cache.Cache.D='__code-as-data-version__';olympe.dc.sources.cache.Cache.j='__code-as-data__';function Il(a){return u(function*(){return(yield a.db.D('buckets')).map(b=>olympe.dc.sources.cache.gj.Fb(b))})}function ol(a){return u(function*(){return(yield a.db.D('pending-transactions')).map(b=>{b=olympe.dc.sources.cache.Xh.Fb(b);return el(b.j)})})}
|
|
909
909
|
function hl(a,b,c){return u(function*(){a.G.debug(`Offline DB: Adding query ${b} in bucket ${c}`);return a.db.Ob(()=>u(function*(){let d;const e=null!=(d=olympe.dc.sources.cache.gj.Fb(yield a.db.get('buckets',c,{Rl:!1})))?d:new olympe.dc.sources.cache.gj(c,[]);e.Pd.includes(b)||e.Pd.push(b);yield a.db.set('buckets',e.toJSON(),void 0,{Rl:!1})}),{wc:'addQueryIdInBucket',El:!0})})}
|
|
910
910
|
function il(a,b,c=new Set){return u(function*(){return a.db.Ob(()=>u(function*(){var d=b.map(()=>a.db.R()),e=yield Promise.all(d);d=new Map;const f=new Map,g=new Set(b);for(var h of e)for(const k of h.map(l=>olympe.dc.sources.cache.Kf.Fb(l)))e=k.tag,c.has(e)||d.has(e)||f.has(e)||(k.Pd=k.Pd.filter(l=>!g.has(l)),0===k.Pd.length?d.set(e,k):f.set(e,k.toJSON()));h=Array.from(d.keys());yield a.db.N();yield Promise.all([a.db.H(),Ll(a,h)]);yield Ml(a,d)}),{wc:'releaseQueryId',El:!0})})}
|
|
911
|
-
function jl(a,b,c){a.G.debug(`Offline DB: Apply patch ${b.T()} on local offline db`);Array.from(b.Cb.keys());const d=new olympe.dc.sources.cache.pq(a.G,c);return a.db.Ob(()=>a.db.F().then(e=>{d.j=e;d.H.clear();b.
|
|
911
|
+
function jl(a,b,c){a.G.debug(`Offline DB: Apply patch ${b.T()} on local offline db`);Array.from(b.Cb.keys());const d=new olympe.dc.sources.cache.pq(a.G,c);return a.db.Ob(()=>a.db.F().then(e=>{d.j=e;d.H.clear();b.ic(d)}).then(()=>{const e=d.X;if(null===c&&0<e.size){const f=d.Cc();return a.db.D('buckets').then(g=>{const h=g.map(olympe.dc.sources.cache.gj.Fb).reduce((k,l)=>{'__code-as-data__'!==l.name&&l.Pd.forEach(n=>k.add(n));return k},new Set);e.forEach(k=>{f.get(k).Pd.push(...h)})})}return Promise.resolve()}).then(()=>
|
|
912
912
|
{d.Cc();return a.db.N()}).then(()=>u(function*(){const e=Array.from(d.H);if(0<e.length){const f=yield a.db.F();yield Promise.all([a.db.H(),Ll(a,e)]);yield Ml(a,f)}})),{wc:'Persist Patch',El:!0}).then(()=>{null===c&&(b.Cb.forEach((e,f)=>a.j.add(f)),a.F().then(()=>{}))})}function ql(a,b){return new Promise((c,d)=>{null!==a.files?c(a.files.has(b)):a.D.push(e=>{let f;return e?d(e):c(!(null==(f=a.files)||!f.has(b)))})})}
|
|
913
913
|
function rl(a,b,c,d){c=new olympe.dc.sources.cache.$m(b,c,d);a.files.add(b);return a.db.set('files',c.toJSON()).then(()=>{}).catch(e=>{a.files.delete(b);throw e;})}function ul(a,b){return u(function*(){return a.db.remove('buckets',b).then(()=>{})})}function Al(a){return u(function*(){return(yield a.db.D('pending-transactions')).reduce((b,c)=>{c=olympe.dc.sources.cache.Xh.Fb(c);const d=c.D;let e;const f=null!=(e=b.get(d))?e:[];f.push(el(c.j));b.set(d,f);return b},new Map)})}
|
|
914
914
|
function Bl(a,b){return u(function*(){return a.db.remove('pending-transactions',b.T()).then(()=>{})})}function xl(a,b){return u(function*(){const c=yield a.db.get('files',b);if(!c)throw Error(`File ${b} not found in offline cache database`);return olympe.dc.sources.cache.$m.Fb(c)})}function Dl(a){return u(function*(){return a.db.D('pending-transactions')})}
|
|
915
915
|
function Fl(a,b){return u(function*(){const c=new Map;for(const d of b){const e=olympe.dc.sources.cache.Xh.Fb(d);e&&c.set(e.j.i,d)}yield a.db.N()})}function Hl(a){return u(function*(){return a.db.clear('pending-transactions').then(()=>{})})}
|
|
916
|
-
function Jl(a,b){return u(function*(){const c=b.lb();a.G.debug(`Offline DB: Executing query ${b.T()} by ID with source ${c}`);const d=olympe.dc.query.Jd.Cj(b);var e=(yield a.db.R(b.T())).map(f=>olympe.dc.sources.cache.Kf.Fb(f));for(const f of e){if(f.source!==c)continue;e=olympe.dc.sources.cache.Hk.Yb(f);const g=Nl(f.Od);d.create(f.tag,e,g);for(const h of f.hb)if(e=h.match(/^([a-z0-9]*)(<|>)([a-z0-9]*)$/)){const [,k,l,n]=e;e='<'===l;k===olympe.dc.
|
|
917
|
-
a.G.debug(`Offline DB: Data result for query ${b.T()}`,d.
|
|
916
|
+
function Jl(a,b){return u(function*(){const c=b.lb();a.G.debug(`Offline DB: Executing query ${b.T()} by ID with source ${c}`);const d=olympe.dc.query.Jd.Cj(b);var e=(yield a.db.R(b.T())).map(f=>olympe.dc.sources.cache.Kf.Fb(f));for(const f of e){if(f.source!==c)continue;e=olympe.dc.sources.cache.Hk.Yb(f);const g=Nl(f.Od);d.create(f.tag,e,g);for(const h of f.hb)if(e=h.match(/^([a-z0-9]*)(<|>)([a-z0-9]*)$/)){const [,k,l,n]=e;e='<'===l;k===olympe.dc.hc.ed&&!0===e||d.La(k,e?n:f.tag,e?f.tag:n)}}a.G.j()&&
|
|
917
|
+
a.G.debug(`Offline DB: Data result for query ${b.T()}`,d.ec().Cb.size,'instances',Array.from(d.ec().Md()).length,'relations');return d})}function Kl(a,b,c){b=a.N.ga(b);a.G.debug(`save transaction in destination '${c}'`,JSON.stringify(b));return a.db.set('pending-transactions',(new olympe.dc.sources.cache.Xh(c,b,Date.now())).toJSON())}function Ol(a){return u(function*(){return a.db.X('pending-transactions')})}function Ll(a,b){return u(function*(){b.forEach(c=>a.files.delete(c));yield a.db.H()})}
|
|
918
918
|
function Ml(a,b){var c={Rl:!1};return u(function*(){return 0===b.size?Promise.resolve():a.db.Ob(()=>u(function*(){var d=olympe.dc.ua.ORIGIN;const e=olympe.dc.ua.DESTINATION;a.G.debug(`Offline DB: Removing related relations of ${b.size} deleted instances`);var f=new Map;for(const g of b.values()){let h,k;for(const l of null!=(k=null==(h=g)?void 0:h.hb)?k:[]){const n=l.substring(21);if(!b.has(n)){const p=`${l.substring(0,20)}${l.charAt(20)===d?e:d}${g.tag}`;let q;const r=null!=(q=f.get(n))?q:new Set;
|
|
919
919
|
r.add(p);f.set(n,r)}}}d=yield a.db.F(Array.from(f.keys()));for(const [g,h]of f.entries())(f=d.get(g))?f.hb=f.hb.filter(k=>!h.has(k)):(a.G.warn(`Instance ${g} not found when trying to remove related relations`),d.delete(g));yield a.db.N()}),{wc:'removeRelatedRelations',Rl:null==c?void 0:c.Rl,El:!0})})}function Nl(a){return Object.entries(a).reduce((b,[c,d])=>b.set(c,el(d)),new Map)}
|
|
920
920
|
olympe.dc.sources.cache.Hk=class{constructor(a,b,c){this.H=`Olympe_Cache_${a}`;this.G=b;this.N=new olympe.dc.sources.cache.oq;this.db=c.D(this.H);this.j=new Set;this.D=[];this.files=null;this.db.Z('files').then(d=>{this.files=new Set(d);this.D.forEach(e=>e(null))}).catch(d=>{this.D.forEach(e=>e(d))});this.F=olympe.U.Promise.zj(()=>{const d=this;return u(function*(){if(!(0===d.j.size||0<(yield Ol(d))))if(0<d.db.ba())d.F().then(()=>{}),d.G.debug('Offline DB GC: Postponing round while the stack is busy');
|
|
921
921
|
else{d.G.debug(`Offline DB GC: Round with ${d.j.size} candidates`);var e=Date.now();yield d.db.Ob(()=>{const f=new Map;return d.db.F(Array.from(d.j)).then(g=>{for(const h of g.values()){g=olympe.dc.sources.cache.Kf.Fb(h);let k;0===(null==(k=g)?void 0:k.Pd.length)&&(d.G.debug(`Offline DB GC: Garbage collecting ${g.tag}`),f.set(g.tag,g))}}).then(()=>u(function*(){if(0<f.size){const g=Array.from(f.keys());yield Promise.all([d.db.H(),Ll(d,g)]);yield Ml(d,f)}}))},{wc:'garbageCollector',El:!0}).then(()=>
|
|
922
|
-
{});d.G.debug(`Offline DB GC: has taken ${Date.now()-e}ms to run`)}})},5E3)}static Yb(a){const b=new RegExp(`^(${olympe.dc.
|
|
922
|
+
{});d.G.debug(`Offline DB GC: has taken ${Date.now()-e}ms to run`)}})},5E3)}static Yb(a){const b=new RegExp(`^(${olympe.dc.hc.ed})>([a-z0-9]*)$`);for(const c of a.hb)if(a=c.match(b))return a[2];return null}executeQuery(a){const b=this;return u(function*(){const c=Date.now();b.G.debug(`Offline DB: Executing query ${a.T()} with source ${a.lb()}`);const d=olympe.dc.query.Jd.Cj(a),e=a.lb();var f=yield b.db.get('instances',a.D),g=olympe.dc.sources.cache.Kf.Fb(f);if(!g)return d;f=new Map;const h=new Set([g.tag]);
|
|
923
923
|
d.create(g.tag,olympe.dc.sources.cache.Hk.Yb(g),Nl(g.Od));for(const p of li(a))if(p instanceof olympe.dc.query.na.ai){var k=p.relation;g=k.Ma()===olympe.dc.ua.ORIGIN;const q=k.W(),r=k.ac();k=new Set;f.set(p.T(),k);const t=[f.has(p.j)?new Set(f.get(p.j)):new Set([a.D])];for(const v of t){const x=new Map;var l=yield Promise.all(Array.from(v).map(y=>{if(!h.has(y))return b.G.warn(`Offline DB: Instance ${y} not found while processing query part, this should not happen`),Promise.resolve([]);r.W();return b.db.R().then(z=>
|
|
924
|
-
z.map(A=>olympe.dc.sources.cache.Kf.Fb(A))).then(z=>{x.set(y,z)})})).then(()=>x);for(const [y,z]of l){p instanceof olympe.dc.query.na.He&&p.F&&k.add(y);for(const A of z)if(l=A.tag,A.source===e){if(p instanceof olympe.dc.query.na.He&&!k.has(l)){var n=t[t.length-1];n||(n=new Set,t.push(n));n.add(l)}k.add(l);h.has(l)||(h.add(l),n=olympe.dc.sources.cache.Hk.Yb(A),d.create(l,n,Nl(A.Od)));q===olympe.dc.
|
|
925
|
-
b.G.j()&&(b.G.debug(`Offline DB: Data result for query ${a.T()}`,d.
|
|
924
|
+
z.map(A=>olympe.dc.sources.cache.Kf.Fb(A))).then(z=>{x.set(y,z)})})).then(()=>x);for(const [y,z]of l){p instanceof olympe.dc.query.na.He&&p.F&&k.add(y);for(const A of z)if(l=A.tag,A.source===e){if(p instanceof olympe.dc.query.na.He&&!k.has(l)){var n=t[t.length-1];n||(n=new Set,t.push(n));n.add(l)}k.add(l);h.has(l)||(h.add(l),n=olympe.dc.sources.cache.Hk.Yb(A),d.create(l,n,Nl(A.Od)));q===olympe.dc.hc.ed&&!0===g||d.La(q,g?l:y,g?y:l)}}}}else p instanceof olympe.dc.query.na.Sd&&b.G.warn(`Offline DB: Trying to execute a query ${a.T()} on the Cache DB that contains a FollowRule part. This is not supported and designed not to happen.`);
|
|
925
|
+
b.G.j()&&(b.G.debug(`Offline DB: Data result for query ${a.T()}`,d.ec().Cb.size,'instances',Array.from(d.ec().Md()).length,'relations'),b.G.debug(`Offline DB: Data result for query ${a.T()} took ${Date.now()-c}ms to be executed`));return d})}};olympe.dc.sources.cache.gj=class{constructor(a,b){this.name=a;this.Pd=b}static Fb(a){return a?new olympe.dc.sources.cache.gj(a.name,a.queryIds):null}toJSON(){return{name:this.name,queryIds:this.Pd}}};
|
|
926
926
|
olympe.dc.sources.cache.Kf=class{constructor(a,b,c,d,e){this.tag=a;this.source=b;this.Od=null!=c?c:{};this.hb=null!=d?d:[];this.Pd=null!=e?e:[]}static Fb(a){return a?new olympe.dc.sources.cache.Kf(a.tag,a.source,a.props,a.relations,a.queryIds):null}toJSON(){return{tag:this.tag,source:this.source,props:this.Od,relations:this.hb,queryIds:this.Pd}}};
|
|
927
927
|
olympe.dc.sources.cache.Xh=class{constructor(a,b,c){this.D=a;this.j=b;this.timestamp=c}static Fb(a){return a?new olympe.dc.sources.cache.Xh(a.destination,a.patch,a.timestamp):null}toJSON(){return{destination:this.D,patch:this.j,timestamp:this.timestamp}}};
|
|
928
928
|
olympe.dc.sources.cache.gw=class extends olympe.dc.sources.cache.Xh{constructor(a,b,c,d){super(a,b,c);this.error=d}static Fb(a){return a?new olympe.dc.sources.cache.gw(a.destination,a.patch,a.timestamp,a.error):null}toJSON(){return{destination:this.D,patch:this.j,timestamp:this.timestamp,error:this.error}}};
|
|
929
929
|
olympe.dc.sources.cache.$m=class{constructor(a,b,c){this.tag=a;this.content=b;this.j=c}static Fb(a){return a?new olympe.dc.sources.cache.$m(a.tag,a.content,a.mimetype):null}toJSON(){return{tag:this.tag,content:this.content,mimetype:this.j}}};function Pl(a,b){let c=a.R.get(b);c||(c=new Set(a.j.get(b).hb),a.R.set(b,c));return c}
|
|
930
930
|
olympe.dc.sources.cache.pq=class{constructor(a,b){this.G=a;this.F=b;this.j=new Map;this.H=new Set;this.X=new Set;this.N=new olympe.dc.sources.cache.oq;this.R=new Map}Cc(){this.H.forEach(a=>this.j.delete(a));Array.from(this.j.entries()).forEach(([a,b])=>{b||this.j.delete(a)});return this.j}Yc(a,b,c){const d=this.j.get(a);d||this.X.add(a);var e;c=Array.from(null!=c?c:[]).reduce((h,k)=>{h[k[0]]=this.N.ga(k[1]);return h},null!=(e=null==d?void 0:d.Od)?e:{});let f;e=null!=(f=null==d?void 0:d.Pd)?f:[];null===
|
|
931
931
|
this.F||e.includes(this.F)||e.push(this.F);let g;b=new olympe.dc.sources.cache.Kf(a,b,c,null!=(g=null==d?void 0:d.hb)?g:[],e);this.j.set(a,b)}dd(a,b){const c=this.j.get(a);if(c){var d;c.Od=Array.from(b).reduce((e,[f,g])=>{null===g?delete e[f]:e[f]=this.N.ga(g);return e},null!=(d=c.Od)?d:{})}else this.G.warn(`Trying to update an instance (${a}) which do not exists in the cache database: ignoring.`)}D(a){this.H.add(a)}La(a,b,c){var d;const e=null!=(d=this.j.get(b))?d:new olympe.dc.sources.cache.Kf(b,
|
|
932
|
-
'unknown',{},[],[]);var f;d=null!=(f=this.j.get(c))?f:new olympe.dc.sources.cache.Kf(c,'unknown',{},[],[]);b=`${a}${olympe.dc.ua.ORIGIN}${b}`;f=(g,h)=>{this.j.set(g.tag,g);const k=Pl(this,g.tag);k.has(h)||(g.hb.push(h),k.add(h));null===this.F||g.Pd.includes(this.F)||g.Pd.push(this.F)};f(e,`${a}${olympe.dc.ua.DESTINATION}${c}`);f(d,b)}
|
|
932
|
+
'unknown',{},[],[]);var f;d=null!=(f=this.j.get(c))?f:new olympe.dc.sources.cache.Kf(c,'unknown',{},[],[]);b=`${a}${olympe.dc.ua.ORIGIN}${b}`;f=(g,h)=>{this.j.set(g.tag,g);const k=Pl(this,g.tag);k.has(h)||(g.hb.push(h),k.add(h));null===this.F||g.Pd.includes(this.F)||g.Pd.push(this.F)};f(e,`${a}${olympe.dc.ua.DESTINATION}${c}`);f(d,b)}jc(a,b,c){const d=this.j.get(b),e=this.j.get(c);c=`${a}${olympe.dc.ua.DESTINATION}${c}`;a=`${a}${olympe.dc.ua.ORIGIN}${b}`;b=(f,g)=>{const h=Pl(this,f.tag);if(h.has(g)){const k=
|
|
933
933
|
f.hb.indexOf(g);f.hb.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.pq.ya=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.Ki=class a{constructor(b,c){this.id=null!=b?b:olympe.U.Pc();this.D=new olympe.C.Zb('BurstTransaction#'+this.id,c);this.vb=Ql(this);this.R=!1;this.D.onDestroy(()=>this.N());this.X=new Set;this.F=new Map;this.H=new Set;this.j=null;let d;this.Xa=null!=(d=olympe.V.getParameter(olympe.dc.transaction.Config.Lo))?d:30;this.ia=[]}static j(b,c){return`${b},${c}`}Nb(b){for(const c of this.ia)c(b);this.stop()}Ga(){null!==this.j&&(clearTimeout(this.j),this.j=null);const b=this.ba(this.H);0<b.size&&
|
|
934
934
|
Rl(this,b,!1);this.H.clear()}ba(b){const c=new Map;b.forEach(d=>{const e=d.split(',');let f=c.get(e[0]);void 0===f&&(f=new Map,c.set(e[0],f));f.set(e[1],this.F.get(d))});return c}Z(b,c,d){this.va(b,c,d);this.vb(b,c,d);null===this.j&&(this.j=setTimeout(this.Ga.bind(this),this.Xa))}va(b,c,d){b=a.j(b,c);this.F.set(b,d);this.H.add(b)}jb(b,c){return this.F.get(a.j(b,c))}push(b,c){const d=olympe.dc.ea(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.ea(f),this.jb(d,e)!==g&&this.Z(d,e,g.valueOf())});
|
|
935
935
|
this.X.add(b)}complete(){return new Promise((b,c)=>{this.N((d,e)=>{for(const f of this.X)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.ea(b),f=olympe.dc.ea(c);void 0===e||void 0===f?olympe.ha.Va('dc').error('Burst transaction: instance tag or property tag is undefined'):(this.D.run(()=>{olympe.C.mo([d],g=>{this.R=!0;if(g instanceof olympe.dc.rc)olympe.ha.Va('dc').error('Cannot send complex property values in burst transactions');else{var h;this.Z(e,f,null!=(h=null==g?void 0:g.valueOf())?
|
|
936
936
|
h:null)}})}),this.D.ae(()=>{this.N()}))}stop(){this.D.destroy();this.ia.length=0}getContext(){return this.D}T(){return this.id}yh(){return!1}N(b){if(this.R){this.R=!1;null!==this.j&&(clearTimeout(this.j),this.j=null);this.H.clear();const c=this.ba(new Set(this.F.keys()));Rl(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.Ki.prototype.complete=olympe.dc.Ki.prototype.complete;olympe.dc.Ki.prototype.push=olympe.dc.Ki.prototype.push;olympe.dc.Vc=class{j(){}toString(){}};olympe.dc.Vc.j=1;olympe.dc.Vc.D=2;olympe.dc.Vc.H=3;olympe.dc.Vc.F=4;olympe.dc.Vc.N=5;olympe.dc.transaction.hj=class a{constructor(b){this.F=null!=b?b:olympe.dc.Ia.SERVER}static j(b){const c=new Map;for(const [d,e]of Object.entries(b)){b=d;let f=typeof e;20<b.length&&b.startsWith('fd')&&(b=olympe.dc.oe.af+b.substring(2));'object'===f&&(f=e&&e.c?String(e.c):'untyped');switch(f){case '1':case '2':case '3':throw Error('Complex format for primitive types not supported.');case 'string':case 'boolean':case 'number':c.set(b,e);break;case '4':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d,e.h,e.m,
|
|
937
|
-
e.s,e.S)));break;case '5':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d)));break;case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&e.M-1||0,e.d||1,e.h,e.m,e.s,e.S)));break;case '7':c.set(b,new olympe.C.Color(e.r,e.g,e.b,e.a));break;case '8':c.set(b,new olympe.dc.rc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}j(b,c){return this.D(b,new olympe.dc.db.
|
|
938
|
-
a.j(d.p),d.m);break;case olympe.dc.Vc.H:c.D(d.t,d.f,d.m);break;case olympe.dc.Vc.F:c.La(d.m,d.l,d.r,d.lm,d.rm);break;case olympe.dc.Vc.N:c.
|
|
939
|
-
function Xl(a,b,c,d){d(a.j);c&&b!==olympe.dc.Ia.SELF&&(c=a.D.get(b),c||(c=new olympe.dc.db.
|
|
940
|
-
olympe.dc.transaction.ow=class{constructor(a,b,c){this.id=null!=c?c:olympe.U.Pc();this.H=b;this.db=a;this.D=new Map;this.j=new olympe.dc.db.
|
|
941
|
-
Sl(this,c);var f=Z(this,b)&&Z(this,c)&&d!==olympe.dc.Ia.SELF&&e!==olympe.dc.Ia.SELF;f&&d!==e&&a!==olympe.dc.
|
|
942
|
-
Z(this,c)&&d!==olympe.dc.Ia.SELF&&e!==olympe.dc.Ia.SELF;f&&d!==e&&a!==olympe.dc.
|
|
937
|
+
e.s,e.S)));break;case '5':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d)));break;case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&e.M-1||0,e.d||1,e.h,e.m,e.s,e.S)));break;case '7':c.set(b,new olympe.C.Color(e.r,e.g,e.b,e.a));break;case '8':c.set(b,new olympe.dc.rc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}j(b,c){return this.D(b,new olympe.dc.db.fc(c))}D(b,c){for(const d of b)switch(d.o){case olympe.dc.Vc.j:b=a.j(d.p||{});let e;c.Yc(d.t,null!=(e=d.s)?e:this.F,b,d.m);break;case olympe.dc.Vc.D:c.dd(d.t,
|
|
938
|
+
a.j(d.p),d.m);break;case olympe.dc.Vc.H:c.D(d.t,d.f,d.m);break;case olympe.dc.Vc.F:c.La(d.m,d.l,d.r,d.lm,d.rm);break;case olympe.dc.Vc.N:c.jc(d.m,d.l,d.r,d.lm,d.rm);break;default:throw Error('Undefined patch operation: '+d.o);}return c}};function Sl(a,b){let c;return null!=(c=a.sources.get(b))?c:a.H.ue(b)}function Tl(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.j.$c(b))?void 0:c.Xb())?d:a.db.model(b))?e:null}function Z(a,b){let c;return null!=(c=a.F.get(b))?c:a.db.Ve(b)||!a.db.Ja(b)}function Ul(a,b){0===a.F.size?a.F=b:b.forEach((c,d)=>a.F.set(d,c))}function Vl(a){return Array.from(a.j.Cc()).filter(b=>!b.Dd()).map(b=>b.tag())}function Wl(a){return Array.from(a.j.Cc()).filter(b=>b.Dd()).map(b=>b.tag())}
|
|
939
|
+
function Xl(a,b,c,d){d(a.j);c&&b!==olympe.dc.Ia.SELF&&(c=a.D.get(b),c||(c=new olympe.dc.db.fc(a.id),a.D.set(b,c)),d(c))}function Yl(a,b,c){const d=Sl(a,b),e=Z(a,b),f=Tl(a,b);Xl(a,d,e,g=>{g.D(b,c,f)})}
|
|
940
|
+
olympe.dc.transaction.ow=class{constructor(a,b,c){this.id=null!=c?c:olympe.U.Pc();this.H=b;this.db=a;this.D=new Map;this.j=new olympe.dc.db.fc(this.id);this.sources=new Map;this.F=new Map}sf(){return 0===this.j.Cb.size}Yc(a,b,c,d){let e;const f=null!=(e=null!=c?c:this.sources.get(a))?e:this.H.fromModel(b);c=Z(this,a);this.sources.set(a,f);Xl(this,f,c,g=>{g.Yc(a,f,d,b)})}dd(a,b){const c=Sl(this,a),d=Z(this,a),e=Tl(this,a);Xl(this,c,d,f=>{f.dd(a,null!=b?b:new Map,e)})}La(a,b,c){const d=Sl(this,b),e=
|
|
941
|
+
Sl(this,c);var f=Z(this,b)&&Z(this,c)&&d!==olympe.dc.Ia.SELF&&e!==olympe.dc.Ia.SELF;f&&d!==e&&a!==olympe.dc.hc.ed&&(f=g=>{let h;return null!=(h=olympe.dc.fa().name(g))?h:g},olympe.ha.Va('dc').warn(`Try to create a relation between 2 objects that have different locations: \n ${f(b)} (${b})-[${f(a)} (${a})]->${f(c)} (${c}), originSrc: ${f(d)} (${d}), destinationSrc: ${f(e)} (${e})`),f=!1);Xl(this,d,f,g=>{g.La(a,b,c,Tl(this,b),Tl(this,c))})}jc(a,b,c){const d=Sl(this,b),e=Sl(this,c);let f=Z(this,b)&&
|
|
942
|
+
Z(this,c)&&d!==olympe.dc.Ia.SELF&&e!==olympe.dc.Ia.SELF;f&&d!==e&&a!==olympe.dc.hc.ed&&(olympe.ha.Va('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);Xl(this,d,f,g=>{g.jc(a,b,c,Tl(this,b),Tl(this,c))})}};function Zl(a,b,c){const d=Object.create(null);if(!b)return d;for(const f of Array.from(b.keys()).sort()){let g=f;var e=b.get(f);if(g===olympe.dc.Fq.hh)if(e===olympe.dc.Ia.SELF)d[g]=olympe.dc.fa().T();else{if(e===olympe.dc.Ia.SERVER)continue}else g.startsWith(olympe.dc.oe.af)&&(g='fd'+g.substring(1));e=a.R(e);c&&e instanceof Object&&8===e.c?a.N.set(g,e):d[g]=e}return d}function $l(a){if(0===a.N.size)return null;const b=Object.create(null);a.N.forEach((c,d)=>{b[d]=c});a.N.clear();return b}
|
|
943
943
|
class am{constructor(){this.N=new Map}R(a){return a instanceof olympe.C.Ta||a instanceof olympe.C.da||a instanceof olympe.C.$?a.valueOf():a instanceof Date||a instanceof olympe.C.eb?(a=a instanceof olympe.C.eb?a.valueOf():a,{c:4,y:a.getUTCFullYear(),M:a.getUTCMonth()+1,d:a.getUTCDate(),h:a.getUTCHours(),m:a.getUTCMinutes(),s:a.getUTCSeconds(),S:a.getUTCMilliseconds(),z:0}):a instanceof olympe.C.Color?{c:7,r:a.Fg().valueOf(),g:a.Eg().valueOf(),b:a.Cg().valueOf(),a:a.Bg().valueOf()}:a&&'function'===
|
|
944
944
|
typeof a.W?{c:8,t:a.W()}:a}}function Zf(a){const b=a.H.concat(a.F).concat(a.N).concat(a.j).concat(a.R);a.N=[];a.F=[];a.j=[];a.R=[];a.H=[];return b}
|
|
945
945
|
olympe.dc.transaction.Me=class{constructor({Kl:a=!1,mi:b=!0,re:c=!0}={}){this.N=[];this.F=[];this.j=[];this.R=[];this.H=[];this.Kl=null!=a?a:!1;this.re=null!=c?c:!0;this.mi=null!=b?b:!0;this.X=olympe.C?new am:new class extends am{R(d){return d&&'function'===typeof d.W?{c:8,t:d.W()}:d}}}flush(){return JSON.stringify(Zf(this))}Yc(a,b,c,d=null){c=Zl(this.X,null!=c?c:null,this.Kl);c={o:olympe.dc.Vc.j,t:a,p:c};this.mi&&(c.s=b);this.re&&d&&(c.m=d);this.N.push(c);this.Kl&&(b=$l(this.X))&&this.j.push({o:olympe.dc.Vc.D,
|
|
946
946
|
t:a,p:b})}dd(a,b,c=null){b=Zl(this.X,b||null,!1);a={o:olympe.dc.Vc.D,t:a,p:b};this.re&&c&&(a.m=c);this.j.push(a)}D(a,b,c=null){a={o:olympe.dc.Vc.H,t:a,f:b};this.re&&c&&(a.m=c);this.F.push(a)}La(a,b,c,d=null,e=null){if(!a)throw Error('Cannot create relation of undefined type');if(!b)throw Error(`Cannot create relation ${a} from undefined origin to ${c}`);if(!c)throw Error(`Cannot create relation ${a} from ${b} to undefined destination`);a={o:olympe.dc.Vc.F,m:a,l:b,r:c};this.re&&d&&(a.lm=d);this.re&&
|
|
947
|
-
e&&(a.rm=e);this.R.push(a)}
|
|
947
|
+
e&&(a.rm=e);this.R.push(a)}jc(a,b,c,d=null,e=null){if(!a)throw Error('Cannot delete relation of undefined type');if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');a={o:olympe.dc.Vc.N,m:a,l:b,r:c};this.re&&d&&(a.lm=d);this.re&&e&&(a.rm=e);this.H.push(a)}};olympe.dc.transaction.Me.ya=[olympe.dc.Writable];function bm(a){var b=new olympe.dc.Ya;b.X=a;return b}function cm(a,b,c,d){c=a.create(null!=c?c:olympe.dc.CloudObject,void 0);if('string'===typeof b)b=b||'',Y(c,olympe.dc.CloudObject.nameProp.W(),b);else for(const [f,g]of Object.entries(b))Y(c,f,g);b=c.W();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.W();a.Ob(new olympe.dc.transaction.Ha.yp(e,b));a.Ob(new olympe.dc.transaction.Ha.om(e,b,d));return c}
|
|
948
948
|
function dm(a,b){if(a.H)throw Error('Operation not permitted: this transaction has already been executed');a.H=!0;const c=[d=>{a.H=d},...a.Z,null!=b?b:()=>{}];return(d,e)=>{c.forEach(f=>f(d,e))}}
|
|
949
949
|
olympe.dc.Ya=class{constructor(a){this.id=null!=a?a:olympe.U.Pc();this.Ha=[];this.F=new Map;this.X=!0;this.D=new Map;this.Z=[];this.H=this.N=!1;this.R=[...olympe.dc.Lj().Z]}T(){return this.id}model(a){let b;return null!=(b=this.F.get(olympe.dc.ea(a)))?b:olympe.dc.fa().model(a)}Ob(a){a instanceof olympe.dc.Ya&&a.D.forEach((b,c)=>this.D.set(c,b));this.Ha.push(a);return a}j(a){Ul(a,this.D);for(const b of this.Ha)b.j(a);try{this.R.forEach(b=>b(a))}catch(b){throw Error(`Transaction compilation error: ${b.message}`);
|
|
950
950
|
}}create(a,b){b=this.Ob(new olympe.dc.transaction.Ha.np(a,b));const c=b.W();this.F.set(c,olympe.dc.ea(a));let d;this.persist(c,null!=(d=this.D.get(c))?d:this.X);return b}persist(a,b=!0){const c=olympe.dc.ea(a);var d=olympe.dc.fa();this.D.set(c,b);if(b){let f;b=null!=(f=this.F.get(c))?f:d.model(c);if(null===b)throw Error(`Try to persist an instance that does not exist: ${c}`);var e;d=null!=(e=d.source(a))?e:olympe.dc.le().fromModel(b);this.Ob(new olympe.dc.transaction.Ha.pw(c,d))}else{if((e=d.Ja(c))&&
|
|
951
|
-
d.Ve(c))throw Error(`Try to remove persistence of an instance already persisted: ${c}`);if(!e&&!this.F.has(c))throw Error(`Try to remove persistence of an instance that does not exist and is not part of the transaction: ${c}`);}return this}delete(a,b=olympe.dc.Hb.Jc){this.Ob(new olympe.dc.transaction.Ha.zp(a,b))}update(a,b,c){return this.Ob(new olympe.dc.transaction.Ha.qx(a,b,c))}La(a,b,c){this.Ob(new olympe.dc.transaction.Ha.om(a,b,c))}
|
|
951
|
+
d.Ve(c))throw Error(`Try to remove persistence of an instance already persisted: ${c}`);if(!e&&!this.F.has(c))throw Error(`Try to remove persistence of an instance that does not exist and is not part of the transaction: ${c}`);}return this}delete(a,b=olympe.dc.Hb.Jc){this.Ob(new olympe.dc.transaction.Ha.zp(a,b))}update(a,b,c){return this.Ob(new olympe.dc.transaction.Ha.qx(a,b,c))}La(a,b,c){this.Ob(new olympe.dc.transaction.Ha.om(a,b,c))}jc(a,b,c){this.Ob(new olympe.dc.transaction.Ha.Bu(a,b,c))}Pn(a,
|
|
952
952
|
b){this.Ob(new olympe.dc.transaction.Ha.yp(a,b))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,f);Y(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.oe.af+d.W(),e);this.La(olympe.dc.CloudObject.propertyRel,a,d);this.La(olympe.dm.Property.typeRel,d,b);this.La(olympe.dc.CloudObject.containsRel,a,d);return d}Xs(a,b,c='',{dF:d=olympe.dm.Relation.H.cw,pF:e=olympe.dm.Relation.j.vw,kF:f=olympe.dm.Relation.j.du,NF:g=olympe.dm.Relation.j.rq,aF:h=olympe.dm.Vl.NONE,
|
|
953
953
|
MF:k=olympe.dm.Relation.N|h}={},l=olympe.U.Pc()){c=Y(Y(Y(Y(Y(Y(Y(Y(Y(Y(this.create(olympe.dm.Relation,l),olympe.dc.CloudObject.nameProp,c||''),olympe.dm.Relation.D,d),olympe.dm.Relation.F,k),olympe.dm.Relation.ba,e),olympe.dm.Relation.va,e),olympe.dm.Relation.Z,e),olympe.dm.Relation.X,f),olympe.dm.Relation.ia,g),olympe.dm.Relation.Ga,olympe.dm.Relation.j.rq),olympe.dm.Relation.R,h);this.La(olympe.dc.CloudObject.Sj,a,c);this.La(olympe.dm.Relation.destinationModelRel,c,b);this.La(olympe.dc.CloudObject.containsRel,
|
|
954
|
-
a,c);return c}yh(){return!1}Gn(a){this.Z.push(olympe.C.Za().vc(a))}nb(a,b){em(olympe.dc.Lj(),this,dm(this,a),b)}Qn(a){a=dm(this,a);fm(olympe.dc.Lj(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Ya.ya=[olympe.dc.Vc];function Ql(a){var b=olympe.dc.Lj();const c=a.T();b.H.set(c,a);return(d,e,f)=>{const g=new olympe.dc.db.
|
|
955
|
-
function Rl(a,b,c,d){var e=olympe.dc.Lj();const f=olympe.dc.Request.j.Ji,g=olympe.dc.Request.j.Dh,h=a.T();a=a.yh();const k=new Map;for(const l of b.keys()){const n=e.db.source(l);if(n===olympe.dc.Ia.SELF||!e.db.Ve(l))continue;let p=k.get(n);p||(p=new olympe.dc.db.
|
|
954
|
+
a,c);return c}yh(){return!1}Gn(a){this.Z.push(olympe.C.Za().vc(a))}nb(a,b){em(olympe.dc.Lj(),this,dm(this,a),b)}Qn(a){a=dm(this,a);fm(olympe.dc.Lj(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Ya.ya=[olympe.dc.Vc];function Ql(a){var b=olympe.dc.Lj();const c=a.T();b.H.set(c,a);return(d,e,f)=>{const g=new olympe.dc.db.fc(c);g.dd(d,(new Map).set(e,f),b.db.model(d));b.j.sd(Pf(g,Infinity))}}
|
|
955
|
+
function Rl(a,b,c,d){var e=olympe.dc.Lj();const f=olympe.dc.Request.j.Ji,g=olympe.dc.Request.j.Dh,h=a.T();a=a.yh();const k=new Map;for(const l of b.keys()){const n=e.db.source(l);if(n===olympe.dc.Ia.SELF||!e.db.Ve(l))continue;let p=k.get(n);p||(p=new olympe.dc.db.fc(h),k.set(n,p));p.dd(l,b.get(l),e.db.model(l))}for(const [l,n]of k)b=new olympe.dc.Request(c?g:f,l,new olympe.dc.transaction.qj(n,a)),e.Lb.request(b).then(p=>{c&&(e.j.sd(Pf(n,p)),null==d||d(!0))}).catch(p=>{null==d||d(!1,`${p}`)})}
|
|
956
956
|
function em(a,b,c,d){if(d){const e=b.T();a.D.set(e,c);fm(a,b,(f,g)=>{f||(a.D.delete(e),c(f,g))},!1)}else fm(a,b,c,!1)}function gm(a){const b=olympe.dc.Request.j.rk;Xf(a.Lb,olympe.dc.Request.j.Mo,c=>{var d=c.content;c=d.rollback;d=d.error;const e=c.T(),f=a.H.get(e);void 0!==f&&(a.H.delete(e),f.Nb(d));a.j.sd(c);a.G.warn(`Burst update (id=${e}) has been refused and is rolled back. Error: ${d}`)});Xf(a.Lb,b,c=>{c=c.content;hm(a,c.id,c.finalize,c.error)})}
|
|
957
957
|
function im(a,b,c){if(!c)throw Error('Transaction compiler id is required');a.va.has(c)||a.Z.push(b);return a}
|
|
958
958
|
function fm(a,b,c,d=!1){const e=b.T(),f=new olympe.dc.transaction.ow(a.db,a.ia,e);try{b.j(f)}catch(q){if(q instanceof olympe.dc.jr){q.j.then(()=>fm(a,b,c,d));return}c(!1,q.message);return}if(f.sf()){c(!0);var g;null==(g=a.D.get(e))||g(!0);a.D.delete(e)}else{a.F.set(e,[]);var h=Vl(f);a.j.te(h,olympe.dc.db.Instance.j.TRANSACTION);g=h.filter(q=>Z(f,q));var k=Wl(f).filter(q=>a.db.Ve(q)&&a.db.Qb(q,olympe.dm.File)&&a.db.source(q)!==olympe.dc.Ia.SERVER).map(q=>[q,a.db.model(q),a.db.source(q)]),l=Sg(a.j,
|
|
959
959
|
f.j,g),n=olympe.C.Za().vc((q,r)=>c(null!==q,r)),p=[l,n];jm(a,f,g).then(q=>{p.splice(1,0,q);km(a,e,h,f.D.size+1);return lm(a,f.D,d,b.yh(),b.N)}).then(q=>Promise.allSettled(k.map(([r,t,v])=>a.N.va(r,t,v))).then(r=>{r.forEach(t=>{'rejected'===t.status&&a.G.warn('Some binary files have not been deleted after the transaction:',t.reason)});return q})).then(q=>{p.forEach(r=>r(q));hm(a,e,olympe.dc.transaction.Pf.j.cj)}).catch(q=>{a.G.error(q);p.forEach(r=>r(null,`${q}`));mm(a,e)})}}
|
|
960
960
|
function jm(a,b,c){const d=b.j,e=olympe.dm.File.urlProp.W();c=c.filter(n=>{let p;return a.db.Qb(n,olympe.dm.File)&&void 0!==(null==(p=d.$c(n))?void 0:p.Oa(e))}).map(olympe.dc.CloudObject.get);if(0===c.length)return Promise.resolve(()=>{});const f=olympe.dm.File.j.W(),g=olympe.dm.File.modificationDateProp.W(),h=Array.from(b.D.values()),k=[],l=olympe.U.pf();return Promise.all(c.map(n=>{const p=n.get(e);if(p.startsWith('blob:'))return l.F(p).then(q=>new Promise((r,t)=>{if(null===q)URL.revokeObjectURL(p),
|
|
961
961
|
r();else{var v=n.W(),x,y=null!=(x=n.get(olympe.dm.File.mimeTypeProp))?x:'application/data';a.N.ia(v,q,y,z=>{const A=h.reduce((K,aa)=>K||aa.$c(v),null);null!==A&&(z=(new Map).set(e,z).set(f,!0).set(g,new Date),A.Fn(z),k.push([v,z]));URL.revokeObjectURL(p);r()},t)}}));2048<p.length&&a.G.error('Trying to create a file with an URL longer than 2048. It likely is a data url and should be an object url. File tag:',n.W());return Promise.resolve([])})).then(()=>{const n=k.reduce((p,[q,r])=>{p.dd(q,r);return p},
|
|
962
|
-
new olympe.dc.db.
|
|
962
|
+
new olympe.dc.db.fc);return Sg(a.j,n)})}function km(a,b,c,d){const e=olympe.C.rh(),f=new olympe.async.Mk(e);0<a.R&&f.fg(a.R);const g=olympe.dc.transaction.Pf.j.Yv;let h=!0;const k=a.F.get(b);for(let l=0;l<d;l++)f.add((n,p)=>{k.push(e.vc((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});qd(f,(l,n)=>{l||a.G.warn(`An error occurred while processing the notification of transaction (${b}): ${n}.`);h&&a.j.detach(c,olympe.dc.db.Instance.j.TRANSACTION);mm(a,b)});f.start()}
|
|
963
963
|
function lm(a,b,c,d,e){if(c&&olympe.C.Ra(a.ba.state)!==olympe.auth.Ua.j.xf)return Promise.reject('Cannot persist with batch transactions API if not authenticated (aka: `Transaction.executeAsLarge()`).');const f=c?olympe.dc.Request.j.lh:olympe.dc.Request.j.hf;return Promise.all(Array.from(b).map(([g,h])=>{g=new olympe.dc.Request(f,g,new olympe.dc.transaction.qj(h,d,e));return a.Lb.request(g)})).then(g=>g[0])}
|
|
964
964
|
function hm(a,b,c,d){let e,f;null==(f=null==(e=a.F.get(b))?void 0:e.pop())||f(c,null!=d?d:null)}function mm(a,b){var c;null==(c=a.F.get(b))||c.forEach(d=>{d(olympe.dc.transaction.Pf.j.cj,null)});a.F.delete(b);if(0===a.F.size){for(const d of a.X)d();a.X=[]}a.D.has(b)&&(c=a.D.get(b),a.D.delete(b),c(!0))}
|
|
965
965
|
olympe.dc.transaction.Pf=class{constructor(a,b,c,d,e,f,g){this.G=a;this.j=b;this.db=b.view;this.Lb=c;this.ia=d;this.N=e;this.ba=f;this.R=g.get('notificationTimeout');this.Z=[];let h;this.va=new Set(null!=(h=g.get('disabledCompilers'))?h:[]);this.H=new olympe.U.di(g.get('burstHoldTime'));this.F=new Map;this.X=[];this.D=new Map;this.Ga=new olympe.U.promise.bl;gm(this)}xe(a){this.Ga.Ob(()=>this.Lb.request(new olympe.dc.Request(olympe.dc.Request.j.Zp,olympe.dc.Ia.SERVER)).then(b=>{a(b.ids,b.undo_stack_size,
|
|
966
|
-
b.redo_stack_size)}).catch(b=>this.G.error('Failed to process get stack request',b))).then(()=>{})}};olympe.dc.transaction.Pf.j={Sm:0,cj:1,Yv:2};olympe.dc.transaction.qj=class{constructor(a,b=!1,c=!1){this.D=a;this.F=b;this.j=c}yh(){return this.F}
|
|
966
|
+
b.redo_stack_size)}).catch(b=>this.G.error('Failed to process get stack request',b))).then(()=>{})}};olympe.dc.transaction.Pf.j={Sm:0,cj:1,Yv:2};olympe.dc.transaction.qj=class{constructor(a,b=!1,c=!1){this.D=a;this.F=b;this.j=c}yh(){return this.F}ec(){return this.D}T(){return this.D.T()}};olympe.dc.transaction.P={Ca:'dc.transaction.Logger',Ea:'dc.transaction.Manager'};olympe.dc.transaction.Config={Yq:'dc.transaction.timeout',Lo:'dc.transaction.burstInterval',wm:'dc.transaction.disabledCompilers'};
|
|
967
967
|
olympe.V.config(function(a){E(a,olympe.dc.transaction.Config.Yq,9E4);E(a,olympe.dc.transaction.Config.Lo,30);E(a,olympe.dc.transaction.Config.wm,[]);D(a,olympe.dc.transaction.P.Ca,[olympe.ha.P.Ea],b=>b.hd('dc'));D(a,'olympe.dc.transaction.Config',[new olympe.V.ma(olympe.dc.transaction.Config.Yq),new olympe.V.ma(olympe.dc.transaction.Config.wm),new olympe.V.ma(olympe.dc.db.Config.im)],(b,c,d)=>new Map([['notificationTimeout',b],['disabledCompilers',c],['burstHoldTime',d]]));C(a,olympe.dc.transaction.P.Ea,
|
|
968
968
|
olympe.dc.transaction.Pf,olympe.dc.transaction.P.Ca,olympe.dc.db.P.Ea,olympe.dc.P.bh,olympe.dc.sources.P.ef,olympe.dc.P.pk,olympe.auth.P.Ea,'olympe.dc.transaction.Config')},'olympe.dc.transaction');olympe.dc.transaction.Ha={};function nm(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Ra(e));return c}olympe.dc.transaction.Ha.Kg=class{constructor(){this.fa=olympe.dc.fa()}j(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Ra(a){a=olympe.C.Ra(a);return void 0===a||null===a?null:olympe.C.vt(a)?a.valueOf():a}};olympe.dc.transaction.Ha.Kg.ya=[olympe.dc.Vc];olympe.dc.transaction.Ha.Fo=class extends olympe.dc.transaction.Ha.Kg{constructor(a,b){super();this.relation=a instanceof olympe.dc.Sa.Relation?a:new olympe.dc.Sa.Relation(olympe.dc.ea(a));this.origin=this.fa.Ja(b)?olympe.dc.CloudObject.get(b):b}getType(){return this.relation.W()}Ma(){return this.relation.Ma()}j(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}};function Y(a,b,c){a.Od.set(olympe.dc.ea(b),c);return a}olympe.dc.transaction.Ha.np=class extends olympe.dc.transaction.Ha.Kg{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.ea(b))?c:olympe.U.nf();this.model=olympe.dc.ea(a);this.source=null;this.Od=new Map}W(){return this.tag}Yb(){return this.model}Ci(a){this.source=a;return this}j(a){const b=this.Yb(),c=this.W();if(!b)throw Error('OperationError: Cannot create instance, model tag is undefined');a.Yc(c,b,this.source,nm(this,this.Od))}toString(){return`CreateInstance(${this.Yb()}, ${this.W()})`}};
|
|
969
|
-
olympe.dc.transaction.Ha.np.ya=[olympe.dc.bf];olympe.dc.transaction.Ha.om=class extends olympe.dc.transaction.Ha.Fo{constructor(a,b,c){super(a,b);this.D=this.fa.Ja(c)?olympe.dc.CloudObject.get(c):c}j(a){const b=this.getType();if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.
|
|
970
|
-
if(!this.D)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.Ma()===olympe.dc.ua.DESTINATION?a.La(b,olympe.dc.ea(this.origin),olympe.dc.ea(this.D)):a.La(b,olympe.dc.ea(this.D),olympe.dc.ea(this.origin))}toString(){return`CreateRelation('${this.relation.Ma()}${this.relation.W()}, ${olympe.dc.ea(this.origin)}, ${olympe.dc.ea(this.D)})`}};olympe.dc.transaction.Ha.sB=class extends olympe.dc.transaction.Ha.Kg{constructor(a,b=olympe.dc.Hb.Jc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.Tb=b}j(a){for(const b of this.fa.Cc(this.model))b!==olympe.dc.ea(this.model)&&(new olympe.dc.transaction.Ha.zp(b,this.Tb)).j(a)}toString(){return`DeleteAllInstances(${this.model.W()}, ${this.Tb})`}};olympe.dc.transaction.Ha.yp=class extends olympe.dc.transaction.Ha.Fo{j(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.
|
|
971
|
-
a.
|
|
972
|
-
this.relation.Ma()===olympe.dc.ua.DESTINATION?a.
|
|
969
|
+
olympe.dc.transaction.Ha.np.ya=[olympe.dc.bf];olympe.dc.transaction.Ha.om=class extends olympe.dc.transaction.Ha.Fo{constructor(a,b,c){super(a,b);this.D=this.fa.Ja(c)?olympe.dc.CloudObject.get(c):c}j(a){const b=this.getType();if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.hc.ed)throw Error('OperationError: Cannot create the instance -> model relation');if(!this.origin)throw Error('OperationError: Cannot create relation, origin tag is undefined, null or empty string');
|
|
970
|
+
if(!this.D)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.Ma()===olympe.dc.ua.DESTINATION?a.La(b,olympe.dc.ea(this.origin),olympe.dc.ea(this.D)):a.La(b,olympe.dc.ea(this.D),olympe.dc.ea(this.origin))}toString(){return`CreateRelation('${this.relation.Ma()}${this.relation.W()}, ${olympe.dc.ea(this.origin)}, ${olympe.dc.ea(this.D)})`}};olympe.dc.transaction.Ha.sB=class extends olympe.dc.transaction.Ha.Kg{constructor(a,b=olympe.dc.Hb.Jc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.Tb=b}j(a){for(const b of this.fa.Cc(this.model))b!==olympe.dc.ea(this.model)&&(new olympe.dc.transaction.Ha.zp(b,this.Tb)).j(a)}toString(){return`DeleteAllInstances(${this.model.W()}, ${this.Tb})`}};olympe.dc.transaction.Ha.yp=class extends olympe.dc.transaction.Ha.Fo{j(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.hc.ed)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ea(this.origin);if(!this.origin)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=this.Ma(),e=this.fa.cb(c,this.relation);for(const f of e)d===olympe.dc.ua.DESTINATION?
|
|
971
|
+
a.jc(b,c,f):a.jc(b,f,c)}toString(){return`DeleteAllRelations(${this.Ma()}${this.getType()})`}};olympe.dc.transaction.Ha.zp=class extends olympe.dc.transaction.Ha.Kg{constructor(a,b=olympe.dc.Hb.Jc){super();this.tag=this.fa.Ja(a)?olympe.dc.CloudObject.get(a):a;this.Tb=b}W(){return olympe.dc.ea(this.tag)}j(a){const b=this.W();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.fa.Ja(b)&&Yl(a,b,this.Tb)}toString(){return'DeleteInstance('+this.W()+', '+this.Tb+')'}};olympe.dc.transaction.Ha.Bu=class extends olympe.dc.transaction.Ha.om{j(a){const b=this.relation.W();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.hc.ed)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ea(this.origin);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=olympe.dc.ea(this.D);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
|
|
972
|
+
this.relation.Ma()===olympe.dc.ua.DESTINATION?a.jc(b,c,d):a.jc(b,d,c)}toString(){return'DeleteRelation('+this.relation.Ma()+this.relation.W()+', '+olympe.dc.ea(this.origin)+', '+olympe.dc.ea(this.D)+')'}};olympe.dc.transaction.Ha.qx=class extends olympe.dc.transaction.Ha.Kg{constructor(a,b,c){super();this.tag=this.fa.Ja(a)?olympe.dc.CloudObject.get(a):a;this.Od=new Map;void 0!==b&&this.Od.set(olympe.dc.ea(b),c)}W(){return olympe.dc.ea(this.tag)}j(a){const b=this.W();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');var c;if(!(null!=(c=a.j.$c(b))&&c.D()||this.fa.Ja(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=nm(this,this.Od);
|
|
973
973
|
for(const [e,f]of c){var d=this.fa.Oa(b,e,!0);d instanceof olympe.dc.rc&&Yl(a,d.W(),olympe.dc.Hb.Jc);f instanceof olympe.dc.rc&&!Z(a,f.W())&&Z(a,b)&&(d=new olympe.dc.Ya,d.persist(f.W()),d.j(a))}a.dd(b,c)}toString(){return'UpdateInstance('+this.W()+', '+nm(this,this.Od)+')'}};olympe.dc.transaction.Ha.pw=class a extends olympe.dc.transaction.Ha.Kg{constructor(b,c){super();this.tag=b;this.source=c}j(b){const c=olympe.dc.fa();if(Z(b,this.tag)&&c.Ja(this.tag)&&!c.Ve(this.tag)){const e=c.xb(this.tag,!0);var d;let f;null==(f=null==(d=b.j.$c(this.tag))?void 0:d.xb())||f.forEach((g,h)=>{e.set(h,g)});for(const g of e.values())g instanceof olympe.dc.rc&&c.Ja(g.W())&&(new a(g.W(),this.source)).j(b);d=c.model(this.tag);b.Yc(this.tag,d,this.source,e);for(const [g,h,k]of vh(c,this.tag))Z(b,
|
|
974
974
|
k)&&(h===olympe.dc.ua.ORIGIN?b.La(g,k,this.tag):b.La(g,this.tag,k))}}toString(){return`PersistOperation: tag - ${this.tag}, src - ${this.source}`}};olympe.dc.ea=function(a){let b=null;if('string'===typeof a)return a;if('function'===typeof(null==a?void 0:a.W)&&(null==a||!a.nh))b=a.W();else if('function'===typeof a){let d;b=null!=(d=olympe.dc.oa.Yb(a))?d:''}else if(olympe.C.tf(a)){let d;b=olympe.dc.ea(null==(d=olympe.C.Ra(a))?void 0:d.valueOf())}let c;return null!=(c=b)?c:''};w('olympe.dc.instanceToTag',olympe.dc.ea);olympe.dc.fa=function(){return olympe.dc.et().view};olympe.dc.register=function(a,b){olympe.dc.oa.j(a,b)};
|
|
975
975
|
olympe.dc.defineProperty=function(a){return new olympe.dc.Sa.Property(a)};olympe.dc.Xs=function(a,b=olympe.dc.ua.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.ua.DESTINATION){const e=olympe.dc.ua.DESTINATION;return b===olympe.dc.ua.ORIGIN||b===e?new olympe.dc.Sa.Relation(a,b):new olympe.dc.Sa.Relation(a,d,b,c)};olympe.dc.Zx=function(a){return a.ac()};olympe.dc.kb={};olympe.dc.kb.Mn=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.C.zb(a):a instanceof olympe.C.Ta?a:null;olympe.dc.kb.Jn=a=>'boolean'===typeof a||a instanceof Boolean?olympe.C.Vb(a):a instanceof olympe.C.da?a:null;olympe.dc.kb.Ln=a=>'number'===typeof a||a instanceof Number?olympe.C.ta(a):'string'===typeof a||a instanceof String?olympe.C.ta(Number.parseFloat(a.valueOf())):a instanceof olympe.C.$?a:null;
|
|
@@ -1062,15 +1062,15 @@ a;return new rxjs.Observable(c=>{const d=kh(this.db,this.tag,(e,f)=>{null===f||v
|
|
|
1062
1062
|
olympe.dc.CloudObject)}Vn(){return this.cb(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}$f(a,b,c){const d=olympe.C.bc(c,'Sync valueType'),e=ih(this.db,this.tag,a,olympe.C.Za().vc(f=>{b&&null!==f&&void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>jh(this.db,this.tag,a,e));return d.getContext()}yb(a){return M(this.$f(a,olympe.dc.kb.Mn,olympe.C.Ta))}Cd(a){return M(this.$f(a,olympe.dc.kb.Ln,olympe.C.$))}sh(a){return M(this.$f(a,olympe.dc.kb.Jn,
|
|
1063
1063
|
olympe.C.da))}Jj(a){return M(this.$f(a,olympe.dc.kb.Kn,olympe.C.eb))}qt(){return M(this.$f(olympe.dm.Color.valueProp,olympe.dc.kb.Ss,olympe.C.Color))}rt(){return M(this.$f(olympe.sc.workflow.Transition.processRefProp,olympe.dc.kb.Ts,olympe.dc.CloudObject))}cb(a,b){a=a instanceof olympe.dc.aa.df?a:new olympe.dc.aa.df(a.W(),a.Ma());return new olympe.dc.Aa(this.W(),a,b)}Zc(a,b){return this.cb(a,b).Nc()}bt(a,b){const c=this.db,d=olympe.U.Pc(),e=olympe.C.Za(),f=new Map;U(c,this.tag,a,(g,h)=>{if(g)(g=e.run(b,
|
|
1064
1064
|
olympe.dc.CloudObject.get(h)))&&f.set(h,g);else{let k;null==(k=f.get(h))||k();f.delete(h)}},d);e.onDestroy(()=>{c.D(this.tag,a,d)})}DA(){return new olympe.dc.Aa(this.W(),[],hg(this.W()))}transform(...a){return(new olympe.dc.Aa(this.W(),[],this.constructor)).transform(...a)}cd(){return this.gt()}toString(){return`CloudObject: ${JSON.stringify(this)}`}toJSON(){return this.db.Ja(this.tag)?Object.assign({'#tag':this.W(),'#type':this.Xb().name()},this.Sc(!0,!0)):{'#tag':this.W(),'#error':'The object does not exist in the local database.'}}Sc(a=
|
|
1065
|
-
!1,b=!0){const c={};this.db.xb(this,b).forEach((d,e)=>{this.db.Ja(e)&&(e=a?this.db.name(e):e,c[e]=olympe.dc.kb.xc(d))});return c}Fa(a){return a instanceof olympe.dc.CloudObject?this.W()===a.W():'function'===typeof a?olympe.dc.oa.Yb(a)===this.W():!1}Nd(a){return olympe.C.wa([a],b=>olympe.C.Vb(this.Fa(b)),olympe.C.da)}ay(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Ya,c=!0;const d=olympe.dc.ua.ORIGIN;for(const [e,f,g]of vh(b,this))f===d?a.
|
|
1066
|
-
a.
|
|
1065
|
+
!1,b=!0){const c={};this.db.xb(this,b).forEach((d,e)=>{this.db.Ja(e)&&(e=a?this.db.name(e):e,c[e]=olympe.dc.kb.xc(d))});return c}Fa(a){return a instanceof olympe.dc.CloudObject?this.W()===a.W():'function'===typeof a?olympe.dc.oa.Yb(a)===this.W():!1}Nd(a){return olympe.C.wa([a],b=>olympe.C.Vb(this.Fa(b)),olympe.C.da)}ay(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Ya,c=!0;const d=olympe.dc.ua.ORIGIN;for(const [e,f,g]of vh(b,this))f===d?a.jc(e,g,this):e!==olympe.dc.CloudObject.modelRel.W()&&
|
|
1066
|
+
a.jc(e,this,g);a.delete(this,olympe.dc.Hb.NONE);c&&a.nb()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.Fa;olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.Sc;olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.Ag;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.bb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.Oa;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;
|
|
1067
1067
|
olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.Zz;olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.Yz;olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.Yb;olympe.dc.CloudObject.prototype.getSource=olympe.dc.CloudObject.prototype.lb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Ve;
|
|
1068
1068
|
olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.Xb;olympe.dc.CloudObject.prototype.name=olympe.dc.CloudObject.prototype.name;olympe.dc.CloudObject.prototype.getTag=olympe.dc.CloudObject.prototype.W;olympe.dc.CloudObject.getInstancesOf=olympe.dc.CloudObject.lt;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.$c;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.Md;
|
|
1069
1069
|
olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.xb;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.Cl;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.Hx;olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.Yx;olympe.dc.CloudObject.markObsolete=olympe.dc.CloudObject.Qj;olympe.dc.CloudObject.exists=olympe.dc.CloudObject.exists;olympe.dc.CloudObject.get=olympe.dc.CloudObject.get;olympe.dc.CloudObject.O=olympe.dc.oa.j('ff021000000000000001',olympe.dc.CloudObject);
|
|
1070
1070
|
olympe.dc.CloudObject.SF=olympe.dc.CloudObject.O.ja(olympe.dc.Fq.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.O.ja('ff023000000000000011');w('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);olympe.dc.CloudObject.DF=olympe.dc.CloudObject.O.ja('ff023000000000000012');olympe.dc.CloudObject.Sj=olympe.dc.CloudObject.O.sa('ff02200000000000000a');olympe.dc.CloudObject.Zs=olympe.dc.CloudObject.O.sa('ff02200000000000000b',olympe.dc.ua.ORIGIN);olympe.dc.CloudObject.mF=olympe.dc.CloudObject.O.sa('017e9c4ba4c847d71cbf');
|
|
1071
|
-
olympe.dc.CloudObject.cF=olympe.dc.CloudObject.O.sa('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.O.sa('ff02200000000000000c');w('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.O.sa('ff02200000000000000d',olympe.dc.ua.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.O.sa(olympe.dc.
|
|
1072
|
-
olympe.dc.CloudObject.instancesRel=S(olympe.dc.CloudObject.O,olympe.dc.CloudObject.modelRel);w('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.O.sa(olympe.dc.
|
|
1073
|
-
olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.O.sa(olympe.dc.
|
|
1071
|
+
olympe.dc.CloudObject.cF=olympe.dc.CloudObject.O.sa('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.O.sa('ff02200000000000000c');w('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.O.sa('ff02200000000000000d',olympe.dc.ua.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.O.sa(olympe.dc.hc.ed);w('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);
|
|
1072
|
+
olympe.dc.CloudObject.instancesRel=S(olympe.dc.CloudObject.O,olympe.dc.CloudObject.modelRel);w('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.O.sa(olympe.dc.hc.Pi);w('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);olympe.dc.CloudObject.extendedByRel=S(olympe.dc.CloudObject.O,olympe.dc.CloudObject.extendRel);w('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);
|
|
1073
|
+
olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.O.sa(olympe.dc.hc.fk);w('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.Ux=S(olympe.dc.CloudObject.O,olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.$x=olympe.dc.CloudObject.O.sa('018282d3ac0a474a0bf4');w('olympe.dc.CloudObject.deleteAlsoRel',olympe.dc.CloudObject.$x);olympe.dc.ID=olympe.dc.CloudObject;olympe.dc.CloudObject.ya=[olympe.dc.bf];m=olympe.dc.CloudObject.prototype;
|
|
1074
1074
|
m.W.K=new olympe.C.J(()=>String,[]);m.name.K=new olympe.C.J(()=>String,[]);m.ka.K=olympe.C.J.D;m.Xb.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.lb.K=new olympe.C.J(()=>String,[]);m.Ry.K=new olympe.C.J(()=>String,[]);m.gt.K=olympe.C.J.D;m.Yb.K=new olympe.C.J(()=>String,[]);m.By.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Vn.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.$f.K=new olympe.C.J(()=>olympe.C.Node,[]);m.yb.K=olympe.C.J.D;m.Cd.K=olympe.C.J.F;m.sh.K=olympe.C.J.N;
|
|
1075
1075
|
m.Jj.K=new olympe.C.J(()=>olympe.C.eb,[]);m.qt.K=new olympe.C.J(()=>olympe.C.Color,[]);m.rt.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.cb.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Zc.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.bt.K=new olympe.C.J(()=>Function,[]);m.DA.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.transform.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.cd.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.Fa.K=olympe.C.J.j;m.Nd.K=olympe.C.J.N;m.ay.K=new olympe.C.J(()=>{},[]);olympe.dc.P={Ih:'dc.DBView',yq:'dc.InstanceManager',Ca:'dc.Logger',$w:'dc.TransactionLogger',pk:'dc.FileServiceManager',bh:'dc.Router'};olympe.dc.Config={fh:'dc.tag',hg:'dc.debug',ci:'dc.subscribeAll',um:'dc.defaultSource',Op:'dc.fileCache',op:'dc.dataConsumerOnly',Fp:'dc.errorOnAbstractInstantiation'};
|
|
1076
1076
|
olympe.V.config(function(a){const b='object'===typeof window;E(a,olympe.dc.Config.hg,!1);E(a,olympe.dc.Config.ci,!1);E(a,olympe.dc.Config.um,olympe.dc.Ia.SERVER);E(a,olympe.dc.Config.op,b);E(a,olympe.dc.Config.Op,b);E(a,olympe.dc.Config.Fp,!0);E(a,olympe.dc.Config.fh,olympe.U.Pc());D(a,olympe.dc.P.Ca,[olympe.ha.P.Ea],c=>c.hd('dc'));Xa(a,olympe.dc.P.$w,olympe.dc.transaction.P.Ca);Xa(a,olympe.dc.P.Ih,olympe.dc.db.P.qm);C(a,olympe.dc.P.pk,olympe.dc.Ju,olympe.dc.P.Ca,olympe.dc.db.P.Ea,olympe.net.P.Ea,
|
|
@@ -1212,12 +1212,12 @@ olympe.sc.qa.ff.O.j=(a,b,c)=>{b=cm(a,b||'New Service Application model',olympe.s
|
|
|
1212
1212
|
d,f.tag())}};
|
|
1213
1213
|
olympe.sc.wf.Tz=a=>{const b=a.j,c=olympe.dc.fa();for(const d of b.Cc()){const e=d.Xb();e&&!d.Dd()&&c.Qb(e,olympe.sc.Gc)&&d.xb().forEach((f,g)=>{if(f instanceof olympe.dc.rc){const l=b.$c(f.W());if(null===l)throw Error(`Try to assign an instance as complex property which is not created within the same transaction: ${f.W()}`);var h;f=null!=(h=null==l?void 0:l.Xb())?h:null;h=l.tag();let n;if(f===olympe.dc.ea(olympe.sc.Wd)){h=l.Kb(olympe.sc.Wd.j);if(!h)throw Error('No object reference found for new ObjectRef');var k;
|
|
1214
1214
|
let p;f=null!=(p=null==(k=b.$c(h))?void 0:k.Xb())?p:c.model(h)}if(c.ag(f,olympe.dm.Ne)){k=mn(f);let p;n=null!=(p=l.Oa(k.W()))?p:c.Oa(h,k)}if(void 0===n)throw Error(`Try to set a complex property to an instance of a DataType: ${c.name(e)} (${e})`);a.dd(d.tag(),new Map([[g,n]]));Yl(a,l.tag(),olympe.dc.Hb.Jc)}})}};
|
|
1215
|
-
olympe.sc.wf.Qx=a=>{const b=a.j,c=olympe.dc.fa(),d=new Set;for(var e of b.Cb.values()){a=e.tag();let f;const g=null!=(f=e.Xb())?f:c.model(a);if(null!==g&&e.gd()&&(d.has(g)||c.Qb(g,olympe.sc.Gc))){d.add(g);const h=Array.from(e.ba()).flatMap(([k,,l,n])=>n&&k!==olympe.dc.
|
|
1215
|
+
olympe.sc.wf.Qx=a=>{const b=a.j,c=olympe.dc.fa(),d=new Set;for(var e of b.Cb.values()){a=e.tag();let f;const g=null!=(f=e.Xb())?f:c.model(a);if(null!==g&&e.gd()&&(d.has(g)||c.Qb(g,olympe.sc.Gc))){d.add(g);const h=Array.from(e.ba()).flatMap(([k,,l,n])=>n&&k!==olympe.dc.hc.ed?[l]:[]).find(k=>{let l,n;const p=null!=(n=null==(l=b.$c(k))?void 0:l.Xb())?n:c.model(k);return!p||!(d.has(p)||c.Qb(p,olympe.sc.Gc))});if(void 0!==h){let k,l,n;e=null!=(n=null!=(l=null==(k=b.$c(h))?void 0:k.Xb())?l:c.model(h))?
|
|
1216
1216
|
n:'unknown';throw Error(`Try to link an instance (${a}) of DataType ${c.name(g)} (${g}) to an instance which is not (${h}) a DataType: ${c.name(e)} (${e})`);}}}};olympe.sc.wf.iA=a=>{var b=a.j;const c=olympe.dc.fa();for(const d of b.Cc()){b=d.tag();const e=d.Xb();if(e&&!c.Qb(e,olympe.sc.Gc)&&Z(a,b))throw Error(`You are trying to persist an instance of : ${c.name(e)} (${e}), but only instances of DataType can be persisted`);}};
|
|
1217
1217
|
olympe.sc.wf.Ix=a=>{const b=a.j;olympe.dc.fa();for(const c of b.Cc())if(!Z(a,c.tag()))for(const d of c.xb().values())d instanceof olympe.dc.rc&&Ul(a,(new Map).set(d.W(),!1))};olympe.V.run([olympe.dc.transaction.P.Ea],a=>{im(im(im(im(a,olympe.sc.wf.Qx,'businessDataRelations'),olympe.sc.wf.Gz,'linkBusinessContainer'),olympe.sc.wf.Tz,'noBusinessComplexProperty'),olympe.sc.wf.Ix,'avoidComplexPropertyPersistence')});olympe.sc.gk=class extends olympe.dm.BrickMetadata{Ae(){return olympe.sc.Ce.Se.Hh}};olympe.sc.gk.O=olympe.dc.oa.j('01645fe6873aeea59e64',olympe.sc.gk);olympe.sc.gk.j=olympe.sc.gk.O.sa('017ed8ac775f48d4d589');olympe.sc.jp=class extends olympe.dm.Mb{Ae(){return olympe.sc.Ce.Se.Hh}};olympe.sc.jp.O=olympe.dc.oa.j('0163a68ce44f3d1fa95d',olympe.sc.jp);olympe.sc.Eh=class extends olympe.dm.BrickMetadata{};olympe.sc.Eh.O=olympe.dc.oa.j('016324fde11a836f77d3',olympe.sc.Eh);olympe.sc.Eh.j=olympe.sc.Gc.O.sa('016324fde11a836088d3');olympe.sc.Eh.O.j=(a,b)=>cm(a,null!=b?b:'New config type',olympe.sc.Eh).W();olympe.sc.fB=class{};olympe.sc.lk=class extends olympe.dm.BrickMetadata{Ae(){return olympe.sc.Ce.Se.Hh}};olympe.sc.lk.O=olympe.dc.oa.j('017dc8d6c8fd8c8bd2ff',olympe.sc.lk);olympe.sc.lk.O.j=(a,b)=>cm(a,null!=b?b:'New data connector',olympe.sc.lk,olympe.dm.DataSource).W();olympe.sc.Fe=class extends olympe.sc.Runnable{ia(){return this.cb(olympe.sc.Fe.N,olympe.sc.Runnable)}F(){return this.cb(olympe.sc.Fe.H,olympe.dm.Property)}};olympe.sc.Fe.O=lg(olympe.dc.oa.j('016c2d996d9ca27fa9d8',olympe.sc.Fe));olympe.sc.Fe.N=olympe.sc.Fe.O.sa('016c3cb7742ec9309e0b');olympe.sc.Fe.H=olympe.sc.Fe.O.sa('016c42d3454636f90533');olympe.sc.Fe.prototype.ia.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.Fe.prototype.F.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.Lp=class extends olympe.dm.Mb{Ae(){return olympe.sc.Ce.Se.Hh}};olympe.sc.Lp.O=olympe.dc.oa.j('017a7a9ff057958e5678',olympe.sc.Lp);olympe.sc.Qi=class extends olympe.dm.Enum{static create(a,b,c,d,e){const f=olympe.dc.fa();e=void 0!==e?e:f.Ja(b)&&f.Cc(b).length||0;c=(new Map).set(olympe.dm.String.valueProp,c).set(olympe.dc.CloudObject.nameProp,d||c).set(olympe.dm.Enum.rankProp,e);return a.create(b,c)}};olympe.sc.Qi.create=olympe.sc.Qi.create;olympe.sc.Qi.O=olympe.dc.oa.j('016cdd861b32d56c8208',olympe.sc.Qi);olympe.sc.Tq=class extends olympe.dm.Mb{Ae(){return olympe.sc.Ce.Se.gx}};olympe.sc.Tq.O=olympe.dc.oa.j('01644b6d4543b344b857',olympe.sc.Tq);olympe.sc.Uq=class extends olympe.dc.CloudObject{};olympe.sc.Uq.O=olympe.dc.oa.j('0162f672366be5ca7a86',olympe.sc.Uq);const no={Gp:30};olympe.sc.cc=class extends olympe.dc.sources.cc{D(a){return a instanceof olympe.sc.logic.Error?this.format(no.Gp,{c:a.Fj(),m:a.message,s:a.xe()}):super.D(a)}j(a){return(null==a?void 0:a.t)===no.Gp?(a=a.v,tn(a.m,a.c,a.s)):super.j(a)}H(a){super.H(a);if(this.db.model(a)===olympe.sc.Wd.O.W()){const b=olympe.sc.Wd.j;this.F.get(a).r.push({r:b.W(),o:a,d:this.db.Kb(a,b)})}return a}};olympe.sc.ss=class extends olympe.sc.Fe{};olympe.sc.ss.O=olympe.dc.oa.j('016d3f37610ae4fc3962',olympe.sc.ss);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.O=olympe.dc.oa.j('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Ya=class{constructor(a=!0){a=bm(a);a.N=!0;var b=olympe.sc.wf.iA;let c;(null==(c=olympe.V.getParameter(olympe.dc.transaction.Config.wm))?0:c.includes('persistenceBusinessDataOnly'))||a.R.push(b);this.j=a;this.D=[];this.source=null}static from(a){const b=olympe.sc.xa.j.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Ya}static process(a,b){return a.has(olympe.sc.xa.j.TRANSACTION,!0)?Promise.resolve(!1):b.nb().then(()=>!0)}T(){return this.j.T()}create(a,b=new Map,c=this.source,d){c=
|
|
1218
|
-
'string'===typeof c?c:olympe.dc.le().fromModel(a);a=this.j.create(a,d).Ci(c);for(const [e,f]of b)Y(a,e,f);b=a.W();this.D.push(b);return b}update(a,b,c){this.j.update(a,b,c);return this}Bt(a,b){a=this.j.update(a);for(const [c,d]of b)b=d,a.Od.set(olympe.dc.ea(c),b);return this}delete(a){this.j.delete(a);return this}La(a,b,c){this.j.La(a,b,c);return this}
|
|
1218
|
+
'string'===typeof c?c:olympe.dc.le().fromModel(a);a=this.j.create(a,d).Ci(c);for(const [e,f]of b)Y(a,e,f);b=a.W();this.D.push(b);return b}update(a,b,c){this.j.update(a,b,c);return this}Bt(a,b){a=this.j.update(a);for(const [c,d]of b)b=d,a.Od.set(olympe.dc.ea(c),b);return this}delete(a){this.j.delete(a);return this}La(a,b,c){this.j.La(a,b,c);return this}jc(a,b,c){this.j.jc(a,b,c);return this}Pn(a,b){this.j.Pn(a,b);return this}persist(a,b=!0){this.j.persist(a,b);return this}hA(a,b=!0){olympe.ha.Va('dc').warn('Transaction#persistInstance() has been deprecated. Please use Transaction#persist() instead.');
|
|
1219
1219
|
return this.persist(a,b)}Ci(a){this.source=a;return this}model(a){return this.j.model(a)}merge(a){this.j.Ob(a.j);return this}Gn(a){this.j.Gn(a);return this}nb(){return new Promise((a,b)=>{this.j.nb((c,d)=>{c?a(new olympe.sc.rj(this.D)):b(d)})})}Qn(){return new Promise((a,b)=>{this.j.Qn((c,d)=>{c?a(new olympe.sc.rj(this.D)):b(d)})})}};olympe.sc.Ya.prototype.executeAsLarge=olympe.sc.Ya.prototype.Qn;olympe.sc.Ya.prototype.execute=olympe.sc.Ya.prototype.nb;olympe.sc.Ya.prototype.afterExecution=olympe.sc.Ya.prototype.Gn;
|
|
1220
|
-
olympe.sc.Ya.prototype.merge=olympe.sc.Ya.prototype.merge;olympe.sc.Ya.prototype.model=olympe.sc.Ya.prototype.model;olympe.sc.Ya.prototype.setSource=olympe.sc.Ya.prototype.Ci;olympe.sc.Ya.prototype.persistInstance=olympe.sc.Ya.prototype.hA;olympe.sc.Ya.prototype.persist=olympe.sc.Ya.prototype.persist;olympe.sc.Ya.prototype.deleteAllRelations=olympe.sc.Ya.prototype.Pn;olympe.sc.Ya.prototype.deleteRelation=olympe.sc.Ya.prototype.
|
|
1220
|
+
olympe.sc.Ya.prototype.merge=olympe.sc.Ya.prototype.merge;olympe.sc.Ya.prototype.model=olympe.sc.Ya.prototype.model;olympe.sc.Ya.prototype.setSource=olympe.sc.Ya.prototype.Ci;olympe.sc.Ya.prototype.persistInstance=olympe.sc.Ya.prototype.hA;olympe.sc.Ya.prototype.persist=olympe.sc.Ya.prototype.persist;olympe.sc.Ya.prototype.deleteAllRelations=olympe.sc.Ya.prototype.Pn;olympe.sc.Ya.prototype.deleteRelation=olympe.sc.Ya.prototype.jc;olympe.sc.Ya.prototype.createRelation=olympe.sc.Ya.prototype.La;
|
|
1221
1221
|
olympe.sc.Ya.prototype['delete']=olympe.sc.Ya.prototype.delete;olympe.sc.Ya.prototype.multiUpdate=olympe.sc.Ya.prototype.Bt;olympe.sc.Ya.prototype.update=olympe.sc.Ya.prototype.update;olympe.sc.Ya.prototype.create=olympe.sc.Ya.prototype.create;olympe.sc.Ya.prototype.getId=olympe.sc.Ya.prototype.T;olympe.sc.Ya.process=olympe.sc.Ya.process;olympe.sc.Ya.from=olympe.sc.Ya.from;olympe.sc.rj=class{constructor(a){this.j=a}Cy(){return this.j.map(olympe.dc.CloudObject.get)}};olympe.sc.rj.prototype.getCreatedObjects=olympe.sc.rj.prototype.Cy;olympe.Ec={};olympe.Ec.au=class{run(){}};function oo(a,b='default'){return a.j===b}
|
|
1222
1222
|
olympe.Ec.Ua=class{constructor(a,b){this.j=a;this.G=b;this.D=null;this.F='';this.G.info('HC Manager will execute application registered as:',this.j)}Uj(a,b,c=''){b||(b='default');b===this.j?(null===this.D?this.G.log('Application',c,'designated to be launched'):this.G.log('OVERRIDE: Application',c,'designated to be launched'),this.D=a,this.F=c):this.G.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.j)}run(){null!==this.D?(this.G.info('Running application:',this.F),
|
|
1223
1223
|
this.D.run()):this.G.error('No app registered under name: '+this.j)}};olympe.Ec.Uj=function(a,b,c='default'){const d=a.Va();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.Ec.Config.ne+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.nd(olympe.Ec.P.Ea).config(c,[b],(e,f)=>f.Uj(e,c,b),e=>oo(e,c),'olympe.hc.registerApp')};olympe.Ec.P={Ea:'hc.Manager',Ca:'hc.Logger'};olympe.Ec.Config={ne:'hc.app',bq:'hc.globalToken'};olympe.V.config(function(a){E(a,olympe.Ec.Config.ne,'default');E(a,olympe.Ec.Config.bq,!1);D(a,olympe.Ec.P.Ca,[olympe.ha.P.Ea],b=>b.hd('hc'));D(a,olympe.Eb.P.ih,[new olympe.V.ma(olympe.Ec.Config.ne)],b=>b);D(a,olympe.auth.P.Ul,[olympe.Eb.P.ih,new olympe.V.ma(olympe.Ec.Config.bq)],(b,c)=>new olympe.auth.Ho(c?'':b));C(a,olympe.Ec.P.Ea,olympe.Ec.Ua,new olympe.V.ma(olympe.Ec.Config.ne),olympe.Ec.P.Ca)},'olympe.hc');
|
|
@@ -1234,7 +1234,7 @@ b[olympe.net.ra.Headers.Tp]?b[olympe.net.ra.Headers.Tp]+'://'+b[olympe.net.ra.He
|
|
|
1234
1234
|
h:h.message}`,olympe.net.ra.Wb.Yl)}if(0===f.size())return new olympe.net.vd('App not found',olympe.net.ra.Wb.bj);var g=a(b);f=f.Nc();g={name:f.name(),short_name:f.name(),id:e,start_url:g?`${g}?hc.app=sc.runtime&sc.app=${e}`:void 0,display:'standalone',backgroundColor:'#fff',icons:g?[{src:`${g}/images/logo.svg`,sizes:'150x150',type:'image/png'},{src:`${g}/images/logo.png`,sizes:'1024x1024',type:'image/png',purpose:'maskable any'}]:void 0};f=olympe.V.getParameter(`app.manifest.${e}`);if(!f)f={};else if('string'===
|
|
1235
1235
|
typeof f)try{f=JSON.parse(f)}catch(h){d.G.warn(`Invalid manifest app config for app: ${e}`),f={}}e=Object.assign({},g,d.j,f);return new olympe.net.vd(JSON.stringify(e),olympe.net.ra.Wb.Wh,void 0,{'content-type':'application/json'})})}).catch(()=>this.G.error('Error while starting the RuntimeHTTPService'));this.G.debug('Started RuntimeHTTPService')}};function vo(a){var b=olympe.dm.DataSource.SERVER;const c=olympe.dc.la.from(a).bb(olympe.sc.qa.Tc.j).bb(olympe.dm.Fd.F.ac()).bb(olympe.dm.Fd.j).Ic();a=olympe.dc.la.from(a).bb(olympe.sc.qa.Tc.j).bb(olympe.dm.ib.D).Ic();return c.concat(a).has(b)}
|
|
1236
1236
|
olympe.sc.ob.al=class extends olympe.dc.sources.al{R(a){return this.db.Qb(a,olympe.sc.Gc)}X(a,b){if(!this.H){super.init();var c=olympe.dc.xd.from(a).bb(olympe.sc.qa.Tc.j).Ic();if(!(c instanceof olympe.dm.ib))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.la.qc.Yg:olympe.dc.la.qc.Bf;dl(this,c,b);c=new olympe.C.Zb('deployed data sources');olympe.dc.la.from(a).bb(olympe.sc.qa.Tc.va).observe(c,{rd:b}).subscribe(d=>{const e=
|
|
1237
|
-
new olympe.dc.Ya;d.Dj().forEach(f=>{e.La(olympe.dm.DataSource.Tj,this.j,f)});d.Kj().forEach(f=>{e.
|
|
1237
|
+
new olympe.dc.Ya;d.Dj().forEach(f=>{e.La(olympe.dm.DataSource.Tj,this.j,f)});d.Kj().forEach(f=>{e.jc(olympe.dm.DataSource.Tj,this.j,f)});e.nb()})}}};function wo(a){a.j||(a.j=setInterval(()=>{a.flush().catch(()=>{})},a.Z),'function'===typeof a.j.unref&&a.j.unref())}function xo(a,b){return u(function*(){var c=N(re(a.R,olympe.L.Sb.Hp),olympe.net.ra.Hd.Xg,JSON.stringify(b),olympe.net.ra.ResponseType.un);const d=de(a.N);O(c,{[olympe.net.ra.Headers.Gh]:olympe.net.ra.hk.JSON,[olympe.net.ra.Headers.Xl]:d.Bd()});c=yield zj(a.X,c);a.G.trace('[Event Monitor] Response:',c)})}
|
|
1238
1238
|
olympe.sc.Fu=class{constructor(a,b,c,d,e,f,g,h){this.G=a;this.X=b;this.N=c;this.R=d;this.H=e;this.F=f;this.Z='number'===typeof g?Math.max(1E3,g):36E5;this.host=h;this.D=new Map;this.j=null;this.F&&wo(this)}isEnabled(){return this.F}track(a,b){this.G.trace('[Event Monitor] tracking',a,b,this.F);this.F&&(a=`${a}||${b}`,b=this.D.get(a)||0,this.D.set(a,b+1))}flush(){const a=this;return u(function*(){if(0!==a.D.size){a.G.debug('[Event Monitor] flushing');var b=(new Date).toISOString(),c=[],d=olympe.dc.fa().name(a.H);
|
|
1239
1239
|
for(const [e,f]of a.D.entries()){const [g,h]=e.split('||');c.push({host:a.host,serviceAppName:d,eventType:g,eventName:h,count:f,timestamp:b})}try{yield xo(a,c),a.G.debug('[Event Monitor] flush done'),a.D.clear()}catch(e){a.G.warn('[EventMonitor] flush failed:',(null==e?void 0:e.message)||e)}}})}destroy(){this.j&&(clearInterval(this.j),this.j=null);this.D.clear()}};olympe.sc.ob.P={qg:'sc.runtime.Main',ef:'sc.runtime.SourceSolver',Ur:'sc.runtime.appConfig',Wr:'sc.runtime.runtimeHTTPServiceConfig',Vr:'sc.runtime.RuntimeHTTPService',lr:'sc.runtime.OfflineAppConfig',Ip:'sc.runtime.EventMonitor'};olympe.sc.ob.Config={nq:'app.httpManifestPath',Rq:'app.manifest.common',Nq:'sc.loadBusinessContainer',Jp:'eventMonitor.enabled',Kp:'eventMonitor.flushFrequency'};
|
|
1240
1240
|
olympe.V.config(function(a){E(a,olympe.sc.ob.Config.nq,'/runtime/manifest');E(a,olympe.sc.ob.Config.Rq,null);E(a,olympe.sc.ob.Config.Nq,!1);E(a,olympe.sc.ob.Config.Jp,!0);E(a,olympe.sc.ob.Config.Kp,36E5);D(a,olympe.Eb.P.ih,[new olympe.V.ma(olympe.Ec.Config.ne),new olympe.V.ma(olympe.sc.Config.ne)],(b,c)=>`${b}${c?'-'+c:''}`);D(a,olympe.sc.ob.P.lr,[new olympe.V.ma(olympe.sc.Config.ne),new olympe.V.ma(olympe.net.Config.ej),new olympe.V.ma(olympe.net.Config.Vm)],(b,c,d)=>{let e;const f=null!=(e=a.getParameter(`offline.${b}.enabled`))?
|