puzzly_api_plugin 0.0.3 → 0.1.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: 7bd9fd6a8da98d5042c4a6e12d23cf44daa35e130b5c45bef022d7e8202e2911
4
- data.tar.gz: dda4ceafb3f082db4373c05d0cfb1ee339fe23405e8e2e3082703d8527dbda01
3
+ metadata.gz: 8c966005ba0e6f9546fb783f7fe9b937a7cd81f81c548327eaeff46cbe75d89d
4
+ data.tar.gz: 451f4dd532c5a2eb697259865b932ad7702f319148f332e9966b094937c8cedf
5
5
  SHA512:
6
- metadata.gz: cddf5ec5d4caad041898aa74a292014735c9f106c471e5716cad3956ae7f7d20d2c1e9c2bab0c6777864cd3aac3a502e9043e7606d36897c83071be421b00ed3
7
- data.tar.gz: 992f66353ce91885698dcbc838ff609a18e4fb975e63d08011a9178854f1b62bd0b81acc3962a99a1a706ef383e5b3822a2525704738609b4ea6301e1686e09c
6
+ metadata.gz: 5d6f2967605412d36eb20656c89a838f30e3daa876cd0cd55431a7f97a86f9160d1da8e7902b128f5b9f07b93411f446ffb2058a877441eeb22bc6b899d323d9
7
+ data.tar.gz: 8979409e44faff9cdee69ed7df66838308eb1201c9b5e608796fbf02fa330fe7cd2b311020b5fcf12c26eef67c6ad0506c830a7ef8f5b2d5fd501dfa991bffeb
data/.gitignore CHANGED
@@ -6,6 +6,8 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ /_site
10
+ /.jekyll-cache
9
11
 
10
12
  # rspec failure tracking
11
13
  .rspec_status
@@ -0,0 +1,5 @@
1
+ jekyll:
2
+ image: jekyll/jekyll
3
+ volumes:
4
+ - .:/srv/jekyll
5
+ command: jekyll build
@@ -24,6 +24,9 @@ module PuzzlyApiPlugin
24
24
 
25
25
  CONTEXTS = 'contexts'
26
26
  NUMBER_OF_CONTEXTS = 'numberOfContexts'
27
+
28
+ CONSUMES_TOPICS = 'consumesTopics'
29
+ PRODUCES_TOPICS = 'producesTopics'
27
30
 
28
31
  MODULES = 'modules'
29
32
  NUMBER_OF_MODULES = 'numberOfModules'
@@ -42,12 +45,10 @@ module PuzzlyApiPlugin
42
45
  end
43
46
 
44
47
  class YAMLFields
45
- API_ID = 'apiId'
46
48
  API_NAME = 'apiName'
47
49
  API_DESCRIPTION = 'apiDescription'
48
50
  API_SPECIFICATION = 'apiSpecification'
49
51
 
50
- CACHE_ID = 'cacheId'
51
52
  CACHE_NAME = 'cacheName'
52
53
  CACHE_DESCRIPTION = 'cacheDescription'
53
54
  CACHE_SPECIFICATION = 'cacheSpecification'
@@ -55,12 +56,13 @@ module PuzzlyApiPlugin
55
56
  CONTEXT_ID = 'contextId'
56
57
  CONTEXT_NAME = 'contextName'
57
58
  CONTEXT_DESCRIPTION = 'contextDescription'
58
-
59
+
59
60
  MODULE_ID = 'moduleId'
60
61
  MODULE_NAME = 'moduleName'
61
62
  MODULE_DESCRIPTION = 'moduleDescription'
63
+ MODULE_CONSUMES_TOPICS = 'moduleConsumesTopics'
64
+ MODULE_PRODUCES_TOPICS = 'moduleProducesTopics'
62
65
 
63
- QUERY_ID = 'queryId'
64
66
  QUERY_NAME = 'queryName'
65
67
  QUERY_DESCRIPTION = 'queryDescription'
66
68
  QUERY_SPECIFICATION = 'querySpecification'
@@ -70,12 +72,10 @@ module PuzzlyApiPlugin
70
72
  SCHEMA_DESCRIPTION = 'schemaDescription'
71
73
  SCHEMA_SPECIFICATION = 'schemaSpecification'
72
74
 
73
- TABLE_ID = 'tableId'
74
75
  TABLE_NAME = 'tableName'
75
76
  TABLE_DESCRIPTION = 'tableDescription'
76
77
  TABLE_SPECIFICATION = 'tableSpecification'
77
78
 
78
- TOPIC_ID = 'topicId'
79
79
  TOPIC_NAME = 'topicName'
80
80
  TOPIC_DESCRIPTION = 'topicDescription'
81
81
  end
@@ -5,14 +5,13 @@ module PuzzlyApiPlugin
5
5
  def self.create(document)
6
6
  Api.new(document,
7
7
  document.data[YAMLFields::MODULE_ID],
8
- document.data[YAMLFields::API_ID],
9
8
  document.data[YAMLFields::API_NAME],
10
9
  document.data[YAMLFields::API_DESCRIPTION],
11
10
  document.data[YAMLFields::API_SPECIFICATION])
12
11
  end
13
12
 
14
- def initialize(document, module_id, id, name, description, specification)
15
- super(document, id, name)
13
+ def initialize(document, module_id, name, description, specification)
14
+ super(document, name)
16
15
  self[MetadataFields::MODULE_ID] = module_id
17
16
  self[MetadataFields::DESCRIPTION] = description
18
17
  self[MetadataFields::SPECIFICATION] = specification
@@ -5,14 +5,13 @@ module PuzzlyApiPlugin
5
5
  def self.create(document)
6
6
  Cache.new(document,
7
7
  document.data[YAMLFields::MODULE_ID],
8
- document.data[YAMLFields::CACHE_ID],
9
8
  document.data[YAMLFields::CACHE_NAME],
10
9
  document.data[YAMLFields::CACHE_DESCRIPTION],
11
10
  document.data[YAMLFields::CACHE_SPECIFICATION])
12
11
  end
13
12
 
14
- def initialize(document, module_id, id, name, description, specification)
15
- super(document, id, name)
13
+ def initialize(document, module_id, name, description, specification)
14
+ super(document, name)
16
15
  self[MetadataFields::MODULE_ID] = module_id
17
16
  self[MetadataFields::DESCRIPTION] = description
18
17
  self[MetadataFields::SPECIFICATION] = specification
@@ -4,13 +4,12 @@ module PuzzlyApiPlugin
4
4
  class Context < Metadata
5
5
  def self.create(document)
6
6
  Context.new(document,
7
- document.data[YAMLFields::CONTEXT_ID],
8
7
  document.data[YAMLFields::CONTEXT_NAME],
9
8
  document.data[YAMLFields::CONTEXT_DESCRIPTION])
10
9
  end
11
10
 
12
- def initialize(document, id, name, description)
13
- super(document, id, name)
11
+ def initialize(document, name, description)
12
+ super(document, name)
14
13
  self[MetadataFields::DESCRIPTION] = description
15
14
  end
16
15
 
@@ -2,9 +2,9 @@
2
2
 
3
3
  module PuzzlyApiPlugin
4
4
  class Metadata < JSONable
5
- def initialize(document, id, name)
5
+ def initialize(document, name)
6
6
  self[MetadataFields::PATH] = document.collection.label.to_s + document.cleaned_relative_path
7
- self[MetadataFields::ID] = id
7
+ self[MetadataFields::ID] = document.cleaned_relative_path[1..-1]
8
8
  self[MetadataFields::NAME] = name
9
9
  end
10
10
 
@@ -5,15 +5,18 @@ module PuzzlyApiPlugin
5
5
  def self.create(document)
6
6
  Module.new(document,
7
7
  document.data[YAMLFields::CONTEXT_ID],
8
- document.data[YAMLFields::MODULE_ID],
9
8
  document.data[YAMLFields::MODULE_NAME],
10
- document.data[YAMLFields::MODULE_DESCRIPTION])
9
+ document.data[YAMLFields::MODULE_DESCRIPTION],
10
+ document.data[YAMLFields::MODULE_CONSUMES_TOPICS],
11
+ document.data[YAMLFields::MODULE_PRODUCES_TOPICS])
11
12
  end
12
13
 
13
- def initialize(document, context_id, id, name, description)
14
- super(document, id, name)
14
+ def initialize(document, context_id, name, description, consumesTopics, producesTopics)
15
+ super(document, name)
15
16
  self[MetadataFields::CONTEXT_ID] = context_id
16
17
  self[MetadataFields::DESCRIPTION] = description
18
+ self[MetadataFields::CONSUMES_TOPICS] = consumesTopics
19
+ self[MetadataFields::PRODUCES_TOPICS] = producesTopics
17
20
  end
18
21
 
19
22
  def context_id
@@ -23,5 +26,13 @@ module PuzzlyApiPlugin
23
26
  def description
24
27
  self[MetadataFields::DESCRIPTION]
25
28
  end
29
+
30
+ def consumesTopics
31
+ self[MetadataFields::CONSUMES_TOPICS]
32
+ end
33
+
34
+ def producesTopics
35
+ self[MetadataFields::PRODUCES_TOPICS]
36
+ end
26
37
  end
27
38
  end
@@ -5,14 +5,13 @@ module PuzzlyApiPlugin
5
5
  def self.create(document)
6
6
  Query.new(document,
7
7
  document.data[YAMLFields::MODULE_ID],
8
- document.data[YAMLFields::QUERY_ID],
9
8
  document.data[YAMLFields::QUERY_NAME],
10
9
  document.data[YAMLFields::QUERY_DESCRIPTION],
11
10
  document.data[YAMLFields::QUERY_SPECIFICATION])
12
11
  end
13
12
 
14
- def initialize(document, module_id, id, name, description, specification)
15
- super(document, id, name)
13
+ def initialize(document, module_id, name, description, specification)
14
+ super(document, name)
16
15
  self[MetadataFields::MODULE_ID] = module_id
17
16
  self[MetadataFields::DESCRIPTION] = description
18
17
  self[MetadataFields::SPECIFICATION] = specification
@@ -5,14 +5,13 @@ module PuzzlyApiPlugin
5
5
  def self.create(document)
6
6
  Schema.new(document,
7
7
  document.data[YAMLFields::CONTEXT_ID],
8
- document.data[YAMLFields::SCHEMA_ID],
9
8
  document.data[YAMLFields::SCHEMA_NAME],
10
9
  document.data[YAMLFields::SCHEMA_DESCRIPTION],
11
10
  document.data[YAMLFields::SCHEMA_SPECIFICATION])
12
11
  end
13
12
 
14
- def initialize(document, context_id, id, name, description, specification)
15
- super(document, id, name)
13
+ def initialize(document, context_id, name, description, specification)
14
+ super(document, name)
16
15
  self[MetadataFields::CONTEXT_ID] = context_id
17
16
  self[MetadataFields::DESCRIPTION] = description
18
17
  self[MetadataFields::SPECIFICATION] = specification
@@ -5,14 +5,13 @@ module PuzzlyApiPlugin
5
5
  def self.create(document)
6
6
  Table.new(document,
7
7
  document.data[YAMLFields::MODULE_ID],
8
- document.data[YAMLFields::TABLE_ID],
9
8
  document.data[YAMLFields::TABLE_NAME],
10
9
  document.data[YAMLFields::TABLE_DESCRIPTION],
11
10
  document.data[YAMLFields::TABLE_SPECIFICATION])
12
11
  end
13
12
 
14
- def initialize(document, module_id, id, name, description, specification)
15
- super(document, id, name)
13
+ def initialize(document, module_id, name, description, specification)
14
+ super(document, name)
16
15
  self[MetadataFields::MODULE_ID] = module_id
17
16
  self[MetadataFields::DESCRIPTION] = description
18
17
  self[MetadataFields::SPECIFICATION] = specification
@@ -6,13 +6,12 @@ module PuzzlyApiPlugin
6
6
  Topic.new(document,
7
7
  document.data[YAMLFields::MODULE_ID],
8
8
  document.data[YAMLFields::SCHEMA_ID],
9
- document.data[YAMLFields::TOPIC_ID],
10
9
  document.data[YAMLFields::TOPIC_NAME],
11
10
  document.data[YAMLFields::TOPIC_DESCRIPTION])
12
11
  end
13
12
 
14
- def initialize(document, module_id, schema_id, id, name, description)
15
- super(document, id, name)
13
+ def initialize(document, module_id, schema_id, name, description)
14
+ super(document, name)
16
15
  self[MetadataFields::MODULE_ID] = module_id
17
16
  self[MetadataFields::SCHEMA_ID] = schema_id
18
17
  self[MetadataFields::DESCRIPTION] = description
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PuzzlyApiPlugin
4
- VERSION = '0.0.3'
4
+ VERSION = '0.1.0'
5
5
  end
@@ -8,6 +8,19 @@ module PuzzlyApiPlugin
8
8
  caches = CachesCollection.instance.get_by_module mod
9
9
  queries = QueriesCollection.instance.get_by_module mod
10
10
  tables = TablesCollection.instance.get_by_module mod
11
+
12
+ consumesTopics = []
13
+ mod.consumesTopics.split(",").each do |topic_id|
14
+ topic = TopicsCollection.instance.get_by_id topic_id
15
+ consumesTopics.push topic.to_identity
16
+ end
17
+
18
+ producesTopics = []
19
+ mod.producesTopics.split(",").each do |topic_id|
20
+ topic = TopicsCollection.instance.get_by_id topic_id
21
+ producesTopics.push topic.to_identity
22
+ end
23
+
11
24
  topics = TopicsCollection.instance.get_by_module mod
12
25
 
13
26
  ModuleView.new(context.to_identity,
@@ -16,10 +29,11 @@ module PuzzlyApiPlugin
16
29
  caches.map { |_id, cache| cache.to_identity },
17
30
  queries.map { |_id, query| query.to_identity },
18
31
  tables.map { |_id, table| table.to_identity },
19
- topics.map { |_id, topic| topic.to_identity })
32
+ consumesTopics,
33
+ producesTopics)
20
34
  end
21
35
 
22
- def initialize(context, mod, apis, caches, queries, tables, topics)
36
+ def initialize(context, mod, apis, caches, queries, tables, consumesTopics, producesTopics)
23
37
  mod.copy_to_hash self
24
38
  self.delete MetadataFields::CONTEXT_ID
25
39
 
@@ -28,7 +42,8 @@ module PuzzlyApiPlugin
28
42
  self.caches caches
29
43
  self.queries queries
30
44
  self.tables tables
31
- self.topics topics
45
+ self[MetadataFields::CONSUMES_TOPICS] = consumesTopics
46
+ self[MetadataFields::PRODUCES_TOPICS] = producesTopics
32
47
  end
33
48
  end
34
49
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puzzly_api_plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mr. Braz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-24 00:00:00.000000000 Z
11
+ date: 2020-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -124,6 +124,7 @@ files:
124
124
  - Rakefile
125
125
  - bin/console
126
126
  - bin/setup
127
+ - docker-compose.yml
127
128
  - lib/puzzly_api_plugin.rb
128
129
  - lib/puzzly_api_plugin/collection/apis.rb
129
130
  - lib/puzzly_api_plugin/collection/caches.rb