open_rosa 0.1.0 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4971029b8b1f9034f894d18db290b204f7e4a8a62d7955dd9ecc9bf23a2669fc
4
- data.tar.gz: 3dc882cc5e3b522d920c69c0b18d82fb6c8d4a2b0e44ecd41fc18155487f1efc
3
+ metadata.gz: 504ec17fd100ce2f925c14cc5fc1ba091e5e90bc7a8487daa78796957d4145fd
4
+ data.tar.gz: a4988b15ca00e7ca7b607528d0737fb7e0bbfafd4189a0bab13b7ad5e262e577
5
5
  SHA512:
6
- metadata.gz: b90bcba3f90852d450de4569d26a3e3ffff4b4e67e7a879ad4115f638ee3871033d3f92e0dd18ad810b33255b54e9ab8f4142c34e24a75c5dfcb42dd6dfc3dc3
7
- data.tar.gz: bb75af6367be14823f22259ddaff589f48b6a3f33794c0874633182741080cd2502d02bb87242520f71ca3486a7e8ddf28b8aa11f12c811ee706c32d454c76b6
6
+ metadata.gz: '09b9bc3f1d10416d78d9549d7a0508e4cade415824ba4c08c8092fc513aee9348e8fa4c686f111c59cfdc617d27b3627406a4bf809dc479a794dd696f819a503'
7
+ data.tar.gz: 5be9e04f1daa8cdb68b7cafff2d263fac64827a5956f57488abe277540c391ac4ecf061f69f3a17991a9eafff1250b55dd8d4f1fdafb24dc6a3f867c83503747
data/CHANGELOG.md CHANGED
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.2.0] - 2026-03-09
11
+
12
+ ### Added
13
+
14
+ - XForm generation now includes an `instanceID` binding with `jr:preload="uid"` so ODK Collect automatically generates a UUID for each submission
15
+ - Middleware falls back to `request.base_url` when no explicit `base_url` is configured, so form download URLs match the request host
16
+
10
17
  ## [0.1.0] - 2025-12-26
11
18
 
12
19
  Initial release.
@@ -102,7 +102,7 @@ module OpenRosa
102
102
  {
103
103
  form_id: request.params["formID"],
104
104
  verbose: request.params["verbose"] == "true",
105
- base_url: @config.base_url,
105
+ base_url: @config.base_url || request.base_url,
106
106
  mount_path: mount_path
107
107
  }
108
108
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenRosa
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
@@ -80,6 +80,17 @@ module OpenRosa
80
80
 
81
81
  def generate_bindings(xml)
82
82
  generate_field_bindings(xml, @fields, "/#{@form_id}")
83
+ generate_instance_id_binding(xml)
84
+ end
85
+
86
+ def generate_instance_id_binding(xml)
87
+ xml.bind(
88
+ nodeset: "/#{@form_id}/meta/instanceID",
89
+ type: "string",
90
+ readonly: "true()",
91
+ "jr:preload" => "uid",
92
+ "jr:preloadParams" => "concat('uuid:', uuid())"
93
+ )
83
94
  end
84
95
 
85
96
  def generate_field_bindings(xml, fields, path_prefix)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: open_rosa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Watt
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-01-10 00:00:00.000000000 Z
11
+ date: 2026-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri