frodo 0.10.5 → 0.10.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d625c77ac93f7c66bfe21f5e5080cf00458cc76e
4
- data.tar.gz: 67cd17ce735175b4670382677c0c200313f20bc0
2
+ SHA256:
3
+ metadata.gz: 794d51d038cdd0d394f220be58870ff62595e44f51192dde8cf949871dcec4fb
4
+ data.tar.gz: 61c94e9234206c8ecd8a21ed5a4969f203b968ffcb7d3fb4a6e89699c4cecb73
5
5
  SHA512:
6
- metadata.gz: '08d6bba647323abc803c11123adedd0d56ee0630b4eb74037b630a43980cc55099aa06a3f75e4dad24fa66568557eb9ed182154d9c882c4d79c41c8f6b4e9fd6'
7
- data.tar.gz: 2b66c975a180d4824d08c7d8358cf7db4182ee714a80a1cd32c62fe013c249561f857ebdec95e476655e4188e7ec0d9297096d488a598739e45793a02bc3671d
6
+ metadata.gz: 2f0f0fad989d9453752412a9c478ed58719fdb84ed11abc35ed2a2c115066c9b7e035523ddda55c8d7916d876e864e78c528f05c13ff359cf15e4e8ecb65fbc8
7
+ data.tar.gz: 426d6d42b6877f4b85a3e69a3263d064a7a66c96d3ffffc574262e8c21464e7cab20122da32df4131b689fcf17833bcfead2af4dce571601ee32cdfc494fda5e
data/lib/frodo/schema.rb CHANGED
@@ -23,6 +23,12 @@ module Frodo
23
23
  @namespace ||= metadata.attributes['Namespace'].value
24
24
  end
25
25
 
26
+ # Returns the schema's `Alias` attribute.
27
+ # @return [String]
28
+ def alias
29
+ @alias ||= metadata.attributes['Alias']&.value
30
+ end
31
+
26
32
  # Returns a list of actions defined by the schema.
27
33
  # @return [Array<String>]
28
34
  def actions
data/lib/frodo/service.rb CHANGED
@@ -94,9 +94,14 @@ module Frodo
94
94
  # @return [Hash<String, Frodo::Schema::ComplexType>]
95
95
  def complex_types
96
96
  @complex_types ||= schemas.map do |namespace, schema|
97
+ schema_hash = {}
97
98
  schema.complex_types.map do |name, complex_type|
98
- [ "#{namespace}.#{name}", complex_type ]
99
- end.to_h
99
+ schema_hash["#{namespace}.#{name}"] = complex_type
100
+ if schema.alias
101
+ schema_hash["#{schema.alias}.#{name}"] = complex_type
102
+ end
103
+ end
104
+ schema_hash
100
105
  end.reduce({}, :merge)
101
106
  end
102
107
 
data/lib/frodo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Frodo
2
- VERSION = '0.10.5'
2
+ VERSION = '0.10.6'
3
3
  end
@@ -339,6 +339,78 @@
339
339
  <NavigationProperty Name="contact_activity_parties" Type="Collection(mscrm.activityparty)" Partner="partyid_contact"/>
340
340
  <NavigationProperty Name="Contact_Letters" Type="Collection(mscrm.letter)" Partner="regardingobjectid_contact_letter"/>
341
341
  </EntityType>
342
+ <EntityType Name="role" BaseType="mscrm.crmbaseentity">
343
+ <Key>
344
+ <PropertyRef Name="roleid"/>
345
+ </Key>
346
+ <Property Name="importsequencenumber" Type="Edm.Int32"/>
347
+ <Property Name="componentstate" Type="Edm.Int32"/>
348
+ <Property Name="solutionid" Type="Edm.Guid"/>
349
+ <Property Name="_roletemplateid_value" Type="Edm.Guid"/>
350
+ <Property Name="modifiedon" Type="Edm.DateTimeOffset"/>
351
+ <Property Name="_modifiedby_value" Type="Edm.Guid"/>
352
+ <Property Name="_modifiedonbehalfby_value" Type="Edm.Guid"/>
353
+ <Property Name="organizationid" Type="Edm.Guid"/>
354
+ <Property Name="name" Type="Edm.String" Unicode="false"/>
355
+ <Property Name="canbedeleted" Type="mscrm.BooleanManagedProperty"/>
356
+ <Property Name="_createdonbehalfby_value" Type="Edm.Guid"/>
357
+ <Property Name="_createdby_value" Type="Edm.Guid"/>
358
+ <Property Name="_businessunitid_value" Type="Edm.Guid"/>
359
+ <Property Name="roleid" Type="Edm.Guid"/>
360
+ <Property Name="overwritetime" Type="Edm.DateTimeOffset"/>
361
+ <Property Name="ismanaged" Type="Edm.Boolean"/>
362
+ <Property Name="iscustomizable" Type="mscrm.BooleanManagedProperty"/>
363
+ <Property Name="_parentrootroleid_value" Type="Edm.Guid"/>
364
+ <Property Name="roleidunique" Type="Edm.Guid"/>
365
+ <Property Name="_parentroleid_value" Type="Edm.Guid"/>
366
+ <Property Name="overriddencreatedon" Type="Edm.DateTimeOffset"/>
367
+ <Property Name="createdon" Type="Edm.DateTimeOffset"/>
368
+ <Property Name="versionnumber" Type="Edm.Int64"/>
369
+ <NavigationProperty Name="systemuserroles_association" Type="Collection(mscrm.systemuser)" Partner="systemuserroles_association"/>
370
+ <NavigationProperty Name="roleprivileges_association" Type="Collection(mscrm.privilege)" Partner="roleprivileges_association"/>
371
+ <NavigationProperty Name="appmoduleroles_association" Type="Collection(mscrm.appmodule)" Partner="appmoduleroles_association"/>
372
+ <NavigationProperty Name="createdonbehalfby" Type="mscrm.systemuser" Nullable="false" Partner="lk_role_createdonbehalfby">
373
+ <ReferentialConstraint Property="_createdonbehalfby_value" ReferencedProperty="systemuserid"/>
374
+ </NavigationProperty>
375
+ <NavigationProperty Name="modifiedby" Type="mscrm.systemuser" Nullable="false" Partner="lk_rolebase_modifiedby">
376
+ <ReferentialConstraint Property="_modifiedby_value" ReferencedProperty="systemuserid"/>
377
+ </NavigationProperty>
378
+ <NavigationProperty Name="modifiedonbehalfby" Type="mscrm.systemuser" Nullable="false" Partner="lk_role_modifiedonbehalfby">
379
+ <ReferentialConstraint Property="_modifiedonbehalfby_value" ReferencedProperty="systemuserid"/>
380
+ </NavigationProperty>
381
+ <NavigationProperty Name="parentroleid" Type="mscrm.role" Nullable="false" Partner="role_parent_role">
382
+ <ReferentialConstraint Property="_parentroleid_value" ReferencedProperty="roleid"/>
383
+ </NavigationProperty>
384
+ <NavigationProperty Name="role_parent_role" Type="Collection(mscrm.role)" Partner="parentroleid"/>
385
+ <NavigationProperty Name="businessunitid" Type="mscrm.businessunit" Nullable="false" Partner="business_unit_roles">
386
+ <ReferentialConstraint Property="_businessunitid_value" ReferencedProperty="businessunitid"/>
387
+ </NavigationProperty>
388
+ <NavigationProperty Name="roletemplateid" Type="mscrm.roletemplate" Nullable="false" Partner="role_template_roles">
389
+ <ReferentialConstraint Property="_roletemplateid_value" ReferencedProperty="roletemplateid"/>
390
+ </NavigationProperty>
391
+ <NavigationProperty Name="Role_AsyncOperations" Type="Collection(mscrm.asyncoperation)" Partner="regardingobjectid_role"/>
392
+ <NavigationProperty Name="Role_BulkDeleteFailures" Type="Collection(mscrm.bulkdeletefailure)" Partner="regardingobjectid_role"/>
393
+ <NavigationProperty Name="organizationid_organization" Type="mscrm.organization" Nullable="false" Partner="organization_roles">
394
+ <ReferentialConstraint Property="organizationid" ReferencedProperty="organizationid"/>
395
+ </NavigationProperty>
396
+ <NavigationProperty Name="createdby" Type="mscrm.systemuser" Nullable="false" Partner="lk_rolebase_createdby">
397
+ <ReferentialConstraint Property="_createdby_value" ReferencedProperty="systemuserid"/>
398
+ </NavigationProperty>
399
+ <NavigationProperty Name="solution_role" Type="mscrm.solution" Nullable="false" Partner="solution_role">
400
+ <ReferentialConstraint Property="solutionid" ReferencedProperty="solutionid"/>
401
+ </NavigationProperty>
402
+ <NavigationProperty Name="teamroles_association" Type="Collection(mscrm.team)" Partner="teamroles_association"/>
403
+ <NavigationProperty Name="parentrootroleid" Type="mscrm.role" Nullable="false" Partner="role_parent_root_role">
404
+ <ReferentialConstraint Property="_parentrootroleid_value" ReferencedProperty="roleid"/>
405
+ </NavigationProperty>
406
+ <NavigationProperty Name="role_parent_root_role" Type="Collection(mscrm.role)" Partner="parentrootroleid"/>
407
+ <NavigationProperty Name="Role_SyncErrors" Type="Collection(mscrm.syncerror)" Partner="regardingobjectid_role_syncerror"/>
408
+ </EntityType>
409
+ <ComplexType Name="BooleanManagedProperty">
410
+ <Property Name="Value" Type="Edm.Boolean"/>
411
+ <Property Name="CanBeChanged" Type="Edm.Boolean"/>
412
+ <Property Name="ManagedPropertyLogicalName" Type="Edm.String" Unicode="false"/>
413
+ </ComplexType>
342
414
  <EntityContainer Name="System">
343
415
  <EntitySet Name="contacts" EntityType="Microsoft.Dynamics.CRM.contact">
344
416
  <NavigationPropertyBinding Path="lead_customer_contacts" Target="leads"/>
@@ -117,5 +117,34 @@ describe Frodo::Schema do
117
117
  subject.properties_for_entity('Error')
118
118
  }.to raise_error(/Does.Not.Exist/)
119
119
  end
120
+
121
+ context "with namespace-aliased complex types" do
122
+ let(:metadata_file) { 'spec/fixtures/files/metadata_dynamics.xml' }
123
+ it { expect(subject.properties_for_entity('role').keys).to eq(%w[
124
+ importsequencenumber
125
+ componentstate
126
+ solutionid
127
+ _roletemplateid_value
128
+ modifiedon
129
+ _modifiedby_value
130
+ _modifiedonbehalfby_value
131
+ organizationid
132
+ name
133
+ canbedeleted
134
+ _createdonbehalfby_value
135
+ _createdby_value
136
+ _businessunitid_value
137
+ roleid
138
+ overwritetime
139
+ ismanaged
140
+ iscustomizable
141
+ _parentrootroleid_value
142
+ roleidunique
143
+ _parentroleid_value
144
+ overriddencreatedon
145
+ createdon
146
+ versionnumber
147
+ ]) }
148
+ end
120
149
  end
121
150
  end
@@ -26,6 +26,14 @@ describe Frodo::Service do
26
26
  service = Frodo::Service.new(service_url, metadata_file: metadata_file, logger: logger)
27
27
  expect(service.logger).to eq(logger)
28
28
  end
29
+
30
+ context "with complex type referenced by namespace alias" do
31
+ let(:metadata_file) { 'spec/fixtures/files/metadata_dynamics.xml' }
32
+ it 'registers custom types on creation' do
33
+ subject
34
+ expect(Frodo::PropertyRegistry['mscrm.BooleanManagedProperty']).to be_a(Class)
35
+ end
36
+ end
29
37
  end
30
38
 
31
39
  describe '#logger' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frodo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.5
4
+ version: 0.10.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emmanuel Pinault
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-08 00:00:00.000000000 Z
11
+ date: 2019-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -404,7 +404,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
404
404
  version: '0'
405
405
  requirements: []
406
406
  rubyforge_project:
407
- rubygems_version: 2.6.14.3
407
+ rubygems_version: 2.7.6.2
408
408
  signing_key:
409
409
  specification_version: 4
410
410
  summary: Simple OData library