go to post Timothy Leavitt · Apr 4, 2023 I ended up going with:"Extend %Net.HttpRequest, override the Read method, and add support for read of individual chunks from an ongoing request (similar to what is already supported for WebSockets, but also on an HTTP 200 response with Transfer-Encoding: chunked)." Hoping to get my example use case out on the Open Exchange at some point...
go to post Timothy Leavitt · Feb 27, 2023 The general pattern that I would recommend is: Use isc.rest (https://github.com/intersystems/isc-rest) to create APIs to existing (or new) data and business logic Use isc.ipm.js (https://github.com/intersystems/isc-ipm-js) to generate client code - once it's set up, getting an updated OpenAPI spec file and - on top of that - updated Angular services and TypeScript model classes (for example) is as easy as running zpm "package-name generate" https://github.com/intersystems/isc-perf-ui is a simple example of how this all fits together - see especially https://github.com/intersystems/isc-perf-ui/blob/main/module.xml. I just used this toolset to build a small but meaningful IRIS-based application in about a week. I didn't hand-code a single REST endpoint in ObjectScript, and I got my OpenAPI spec and all my Angular services and TypeScript interfaces for free*. Of course, if you already have a significant hand-coded REST API, this doesn't help much. For one application my team manages we've added a Forward in our main REST dispatch class to one using isc.rest and gradually migrated endpoints over to use the standardized approach. * ok, not totally free - there's the small price of writing better ObjectScript and e.g. having methods that return a registered JSON-enabled type rather than e.g. %DynamicArray and %DynamicObject.
go to post Timothy Leavitt · Feb 14, 2023 I just got here via search. These days (but perhaps not in 2016) we support application/json and application/yaml. text/plain and other types (haven't fully enumerated them) actually work in VSCode, but not Studio. (Good reminder to not use Studio!) See: https://docs.intersystems.com/iris20223/csp/docbook/DocBook.UI.Page.cls?...
go to post Timothy Leavitt · Feb 13, 2023 @Evgeny Shvarov you're correct that no further configuration is needed - although if you want to commit direct from the IDE / Web UI you should set up the username/email for attribution. At a technical level, see: https://github.com/intersystems/git-source-control/blob/main/cls/SourceC... git-source-control doesn't reference module.xml directly; there's a method in IPM to get the package to which a given "InternalName" (e.g., Foo.Bar.CLS) belongs, so it calls that.
go to post Timothy Leavitt · Feb 10, 2023 @Stefan Cronje re: existing class definitions to Swagger, that's covered in https://github.com/intersystems/isc-rest
go to post Timothy Leavitt · Feb 10, 2023 I agree on most of this. A few comments: "Triple slash - Great idea. TestCoverage - Great tool. Why are they not in a single "powerful" package?" These tools solve different, distinct problems (although both are related to unit testing). Tools that solve different, distinct problems should be separate packages. If you want to write a single "powerful" package that depends on both of them and maybe adds some glue between them, feel free! Dependencies: Packages should use semantic versioning, and dependencies in IPM can be declared in a way that adheres to the semantic versioning contract. It's the responsibility of the dependency repo owner to follow this, and if you don't trust them you can just lock down to the version you tested with. Also, I'm hoping to get around to reviewing your TestCoverage PR soon - just trying to deal with some CI infrastructure issues, and my day job keeps interfering.
go to post Timothy Leavitt · Feb 6, 2023 Here's a quick example. In short: View Other Click in the document Click the thing that shows up in the bottom status bar Enter routine + offset (e.g., copy/paste from error message) and hit enter. It would be nice if this was available via quick pick based on the isfs context (including the routine, not just the tag+offset).
go to post Timothy Leavitt · Feb 1, 2023 @Kari Vatjus-Anttila I'm just seeing this now. I'm a bit mystified - currently I'm using the same flags with latest-enough IRIS and the latest package manager, and it's fine. It's possible that the mocking framework is causing issues. It looks like it has its own unit test manager; how does that play alongside the custom TestCoverage unit test manager? Have you made further changes to TestCoverage.Manager?
go to post Timothy Leavitt · Jan 25, 2023 There are a few more projection examples in isc-rest. Here's my favorite: https://github.com/intersystems/isc-rest/blob/main/cls/_pkg/isc/rest/mod... IMO if a user shouldn't modify a method that's automatically generated, it's best to put it in a separate generated class. The above example covers that behavior.
go to post Timothy Leavitt · Jan 24, 2023 Also - git-source-control 2.1.0 fixes issues with import of its own export format. You should try it out. ;)
go to post Timothy Leavitt · Jan 24, 2023 @Evgeny Shvarov as we've covered in GitHub issues, the business rule issue is a product-level issue (in the new Angular rule editor only, not the old Zen rule editor). I clarified https://github.com/intersystems/git-source-control/issues/225 re: the importable format. The non-"wrapped" XML export format is importable by git-source-control and, I believe, IPM itself, although not by $System.OBJ.Load. It's just a matter of preference/readability. In a package manager context being loadable by $System.OBJ.Load isn't as important, and while the enclosing <Export> and <Document> tags aren't as annoying for XML files as for XML-exported classes/routines/etc., they're still annoying and distract from the true content of the document.
go to post Timothy Leavitt · Jan 4, 2023 @Dmitry Maslennikov it's not actually a REST service, I just want a web application where I have full control over behavior of URLs under the application root in ObjectScript. %CSP.REST is the easiest (maybe only?) way to do that. I ended up implementing Login as follows (which at least mostly works): /// Called for a REST page in the event of a login being required ClassMethod Login(skipheader As %Boolean = 1) As %Status [ ProcedureBlock = 0 ] { // Support including logo image (most of the time...) Set brokerApp = "/csp/broker/" Set brokerName = $Replace(%request.URL,$Piece(%request.URL,"/portal",1),brokerApp) If (brokerName '= brokerApp) { Set filename = $System.CSP.GetFileName(brokerName) If ##class(%Library.File).Exists(filename) { Set %response.ServerSideRedirect = brokerName Quit $$$OK } } // Redirect with trailing slash (supports above) If ($Extract(%request.CgiEnvs("REQUEST_URI"),*) '= "/") && (%request.URL = %request.Application) { Set %response.Redirect = %request.Application Do %response.WriteHTTPHeader() Quit $$$OK } // Suppress "Access Denied" error message If %request.Method = "GET" { Set %request.Data("Error:ErrorCode",1) = $$$ERROR($$$RequireAuthentication) } Quit ##class(%CSP.Login).Page() }
go to post Timothy Leavitt · Nov 30, 2022 My first thought for "there should be results but there aren't" is an index that hasn't been built. Try calling %BuildIndices(,1,1) on the local table and see if that makes a difference. (Note - that purges existing indices and locks the extent, so use with caution if there are transactional updates happening to the table.)
go to post Timothy Leavitt · Nov 30, 2022 @Eduard Lebedyuk - I just found this while looking to do the same thing. You say that adding a favorite is the easiest way - are there other approaches as well short of editing code you shouldn't edit?
go to post Timothy Leavitt · Nov 8, 2022 This is super exciting and I look forward to seeing what's next!
go to post Timothy Leavitt · Nov 3, 2022 @Evgeny Shvarov agreed - although it's good to be sure that you're developing on the same version that you're targeting in production.
go to post Timothy Leavitt · Nov 3, 2022 This is a good point. Fortunately, dictionary version updates are few and far between these days. (They used to happen all the time.)