multiwoven-integrations 0.1.17 → 0.1.18

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: 2b5d95619c96cf27279deaccb0a69eb119fb5da9acfcc2fde885e8fac38cee42
4
- data.tar.gz: 6091f680309d4300be69e94496bf3400274b7934f2c32d639cce7a49f487bf86
3
+ metadata.gz: 33bd471327290a3ea7196e558ad47a4a41c5295f7535ca7e01ba5e3c920edf8f
4
+ data.tar.gz: 1b4c17cd7dcc6b7ea0e1a5208e71fba57d2c790863fee0fda5fcd24220bddf4f
5
5
  SHA512:
6
- metadata.gz: '095149b7a10dcd6f7ab18c201ecfb38515e73f863c675a3f85f7f73878aecfadab80cde348676e3ebeb03096ebf26faa57618f903a992eaa07825afd11a24119'
7
- data.tar.gz: 5ffb66ff3a80658096f672693b9d927fa1a49cfcae85bdce9a5fc1524be48fb45e3f646e2c478a69e3447ba56017656c628976ad01dad486beab8a8043f0ee76
6
+ metadata.gz: 68017d5b0a0548fb3944248838fe5938377e477d2ce32c34421b32f92eba9bc487564d99583dad8f7f61aa0bba358f35570a2a6b20e3045c42da009b9dd46d87
7
+ data.tar.gz: da0889bd2c8865111319eab6d7ec3923edf34fb91b38bb885395e7aa2006080cddd17a73b924ab88154f5d38bc749fb00a2d53760c1c1d2a1ff032d48288f6e8
@@ -10,6 +10,7 @@ module Multiwoven
10
10
  def connector_spec
11
11
  @connector_spec ||= begin
12
12
  spec_json = keys_to_symbols(read_json(CONNECTOR_SPEC_PATH)).to_json
13
+ # returns Protocol::ConnectorSpecification
13
14
  ConnectorSpecification.from_json(spec_json)
14
15
  end
15
16
  end
@@ -19,17 +20,20 @@ module Multiwoven
19
20
  icon_name = client_meta_data[:data][:icon]
20
21
  icon_url = "https://raw.githubusercontent.com/Multiwoven/multiwoven-integrations/#{MAIN_BRANCH_SHA}/assets/images/connectors/#{icon_name}"
21
22
  client_meta_data[:data][:icon] = icon_url
22
-
23
+ # returns hash
23
24
  @meta_data ||= client_meta_data
24
25
  end
25
26
 
27
+ # Connection config is a hash
26
28
  def check_connection(_connection_config)
27
29
  raise "Not implemented"
28
30
  # returns Protocol.ConnectionStatus
29
31
  end
30
32
 
33
+ # Connection config is a hash
31
34
  def discover(_connection_config)
32
35
  raise "Not implemented"
36
+ # returns Protocol::Catalog
33
37
  end
34
38
 
35
39
  private
@@ -3,9 +3,11 @@
3
3
  module Multiwoven
4
4
  module Integrations::Core
5
5
  class DestinationConnector < BaseConnector
6
+ # records is transformed json payload send it to the destination
7
+ # SyncConfig is the Protocol::SyncConfig object
6
8
  def write(_sync_config, _records, _action = "insert")
7
9
  raise "Not implemented"
8
- # return list of record message
10
+ # return Protocol::TrackingMessage
9
11
  end
10
12
  end
11
13
  end
@@ -3,10 +3,12 @@
3
3
  module Multiwoven
4
4
  module Integrations::Core
5
5
  class SourceConnector < BaseConnector
6
+ # accepts Protocol::SyncConfig
6
7
  def read(_sync_config)
7
8
  raise "Not implemented"
8
9
  # setup sync configs
9
10
  # call query(connection, query)
11
+ # Returns list of RecordMessage
10
12
  end
11
13
 
12
14
  private
@@ -65,7 +65,7 @@ module Multiwoven
65
65
  end
66
66
 
67
67
  def extract_data(record_object, properties)
68
- data_attributes = record_object.with_indifferent_access[:data][:attributes]
68
+ data_attributes = record_object.with_indifferent_access
69
69
  data_attributes.select { |key, _| properties.key?(key.to_sym) }
70
70
  end
71
71
 
@@ -55,7 +55,7 @@ module Multiwoven::Integrations::Destination
55
55
  write_success = 0
56
56
  write_failure = 0
57
57
  records.each do |record|
58
- payload = create_payload(record.with_indifferent_access[:data][:attributes], sync_config.stream.json_schema.with_indifferent_access)
58
+ payload = create_payload(record.with_indifferent_access, sync_config.stream.json_schema.with_indifferent_access)
59
59
  response = Multiwoven::Integrations::Core::HttpClient.request(
60
60
  url,
61
61
  sync_config.stream.request_method,
@@ -72,7 +72,7 @@ module Multiwoven
72
72
  def build_args(stream_name, record)
73
73
  case stream_name
74
74
  when "chat_postMessage"
75
- { channel: channel_id, text: slack_code_block(record[:data][:attributes]) }
75
+ { channel: channel_id, text: slack_code_block(record) }
76
76
  else
77
77
  raise "Stream name not found: #{stream_name}"
78
78
  end
@@ -9,63 +9,12 @@
9
9
  "properties": {
10
10
  "text": {
11
11
  "type": ["string", "null"]
12
- },
13
- "attachments": {
14
- "type": ["string", "null"]
15
- },
16
- "blocks": {
17
- "type": ["array", "null"],
18
- "items": {
19
- "type": "string"
20
- }
21
- },
22
- "as_user": {
23
- "type": ["boolean", "null"]
24
- },
25
- "icon_emoji": {
26
- "type": ["string", "null"]
27
- },
28
- "icon_url": {
29
- "type": ["string", "null"]
30
- },
31
- "link_names": {
32
- "type": ["boolean", "null"]
33
- },
34
- "metadata": {
35
- "type": ["string", "null"]
36
- },
37
- "mrkdwn": {
38
- "type": ["boolean", "null"]
39
- },
40
- "parse": {
41
- "type": ["string", "null"]
42
- },
43
- "reply_broadcast": {
44
- "type": ["boolean", "null"]
45
- },
46
- "thread_ts": {
47
- "type": ["string", "null"]
48
- },
49
- "unfurl_links": {
50
- "type": ["boolean", "null"]
51
- },
52
- "unfurl_media": {
53
- "type": ["boolean", "null"]
54
- },
55
- "username": {
56
- "type": ["string", "null"]
57
12
  }
58
13
  },
59
- "oneOf": [
60
- { "required": ["text"] },
61
- { "required": ["attachments"] },
62
- { "required": ["blocks"] }
63
- ]
14
+ "oneOf": [{ "required": ["text"] }]
64
15
  },
65
16
  "supported_sync_modes": ["full_refresh", "incremental"],
66
- "source_defined_cursor": true,
67
- "default_cursor_field": ["updated"],
68
- "source_defined_primary_key": [["Id"]]
17
+ "source_defined_cursor": true
69
18
  }
70
19
  ]
71
20
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Multiwoven
4
4
  module Integrations
5
- VERSION = "0.1.17"
5
+ VERSION = "0.1.18"
6
6
 
7
7
  ENABLED_SOURCES = %w[
8
8
  Snowflake
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multiwoven-integrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Subin T P
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-06 00:00:00.000000000 Z
11
+ date: 2024-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport