cenit-collection-ecommerce 0.0.1

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.
Files changed (38) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.travis.yml +3 -0
  4. data/Gemfile +6 -0
  5. data/README.md +83 -0
  6. data/Rakefile +1 -0
  7. data/bin/console +14 -0
  8. data/bin/setup +7 -0
  9. data/cenit-collection-ecommerce.gemspec +26 -0
  10. data/lib/cenit/collection/ecommerce.rb +29 -0
  11. data/lib/cenit/collection/ecommerce/build.rb +14 -0
  12. data/lib/cenit/collection/ecommerce/index.json +6 -0
  13. data/lib/cenit/collection/ecommerce/libraries/ecommerce/address.json +37 -0
  14. data/lib/cenit/collection/ecommerce/libraries/ecommerce/adjustment.json +10 -0
  15. data/lib/cenit/collection/ecommerce/libraries/ecommerce/cart.json +10 -0
  16. data/lib/cenit/collection/ecommerce/libraries/ecommerce/customer.json +27 -0
  17. data/lib/cenit/collection/ecommerce/libraries/ecommerce/dimension.json +10 -0
  18. data/lib/cenit/collection/ecommerce/libraries/ecommerce/image.json +25 -0
  19. data/lib/cenit/collection/ecommerce/libraries/ecommerce/inventory.json +21 -0
  20. data/lib/cenit/collection/ecommerce/libraries/ecommerce/line_item.json +21 -0
  21. data/lib/cenit/collection/ecommerce/libraries/ecommerce/order.json +60 -0
  22. data/lib/cenit/collection/ecommerce/libraries/ecommerce/order_total.json +32 -0
  23. data/lib/cenit/collection/ecommerce/libraries/ecommerce/payment.json +24 -0
  24. data/lib/cenit/collection/ecommerce/libraries/ecommerce/product.json +65 -0
  25. data/lib/cenit/collection/ecommerce/libraries/ecommerce/shipment.json +50 -0
  26. data/lib/cenit/collection/ecommerce/libraries/ecommerce/source.json +24 -0
  27. data/lib/cenit/collection/ecommerce/libraries/ecommerce/variant.json +31 -0
  28. data/lib/cenit/collection/ecommerce/libraries/index.json +1 -0
  29. data/lib/cenit/collection/ecommerce/support/sample/cart.json +205 -0
  30. data/lib/cenit/collection/ecommerce/support/sample/customer.json +82 -0
  31. data/lib/cenit/collection/ecommerce/support/sample/inventory.json +16 -0
  32. data/lib/cenit/collection/ecommerce/support/sample/orders.json +119 -0
  33. data/lib/cenit/collection/ecommerce/support/sample/product.json +61 -0
  34. data/lib/cenit/collection/ecommerce/support/sample/shipment.json +54 -0
  35. data/lib/cenit/collection/ecommerce/support/sample/sms.json +14 -0
  36. data/lib/cenit/collection/ecommerce/support/sample/stores.json +22 -0
  37. data/lib/cenit/collection/ecommerce/version.rb +7 -0
  38. metadata +109 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 30267bcaeb6aab7fbd156cae401e2848333b40fe
4
+ data.tar.gz: 5a54acbd0b0d20800b7dcce498d9019a587777c8
5
+ SHA512:
6
+ metadata.gz: 79070872bfec2ca11230d64cfb21b691da9bcda56de71f884e6cba52e6c49653da98244ca005feb923718964bbb62538dfa450518940ad1878f06f7da5f25ea2
7
+ data.tar.gz: 30868e0b3317b8df2333e90ae709e848923f28449153bfb516860bd2720f806bc1d5a1f97667d009187b08a88c8f999c8c3d19cd858fa58a136807b30044ec9c
@@ -0,0 +1,10 @@
1
+ .idea/
2
+ /.bundle/
3
+ /.yardoc
4
+ /Gemfile.lock
5
+ /_yardoc/
6
+ /coverage/
7
+ /doc/
8
+ /pkg/
9
+ /spec/reports/
10
+ /tmp/
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.2
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in cenit-collection-ecommerce.gemspec
4
+ gemspec
5
+ gem 'cenit-client'
6
+ gem 'cenit-collection-base'
@@ -0,0 +1,83 @@
1
+ # Cenit::Collection::Ecommerce
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/cenit/collection/ecommerce`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'cenit-collection-ecommerce'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install cenit-collection-ecommerce
22
+
23
+ ###Structure
24
+
25
+ |Cenit
26
+ |Collection
27
+ | Connection Roles
28
+ | Connections
29
+ | Webhooks
30
+ | Libraries
31
+ | Flows
32
+ | Translators
33
+ | Events
34
+
35
+ ###Install Shared Collection
36
+
37
+ run `bundle exec irb -I lib -r 'cenit/collection/ecommerce'`
38
+
39
+ Configure your Cenithub Client API
40
+
41
+ ```ruby
42
+ config = {push_url: 'https://www.cenithub.com/api/v1/push',connection_key: 'My Conn Key',connection_token: 'My Conn Token'}
43
+ ```
44
+ OR
45
+
46
+ ```ruby
47
+ config = {push_url: 'https://www.cenithub.com/api/v1/push',user_key: 'My User Key',user_token: 'My User Token'}
48
+ ```
49
+ Show Hash Collection
50
+
51
+ ```ruby
52
+ Cenit::Collection::Ecommerce.show_collection(config)
53
+ ```
54
+
55
+ Load Shared Collection into Cenithub
56
+
57
+ ```ruby
58
+ Cenit::Collection::Ecommerce.push_collection(config)
59
+ ```
60
+
61
+ Setup Shared Collection into Cenithub
62
+
63
+ ```ruby
64
+ Cenit::Collection::Ecommerce.pull_collection(config)
65
+ ```
66
+ Push sample data into Cenithub
67
+
68
+ ```ruby
69
+ Cenit::Collection::Ecommerce.push_sample('sms',config)
70
+ ```
71
+ ## Development
72
+
73
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
74
+
75
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
76
+
77
+ ## Contributing
78
+
79
+ 1. Fork it ( https://github.com/[my-github-username]/cenit-collection-ecommerce/fork )
80
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
81
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
82
+ 4. Push to the branch (`git push origin my-new-feature`)
83
+ 5. Create a new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "cenit/collection/ecommerce"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'cenit/collection/ecommerce/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "cenit-collection-ecommerce"
8
+ spec.version = Cenit::Collection::Ecommerce::VERSION
9
+ spec.authors = ["asnioby"]
10
+ spec.email = ["asnioby@gmail.com"]
11
+
12
+ spec.summary = %q{Cenit Library Ecommerce}
13
+ spec.description = %q{Collection for Cenit Library Ecommerce}
14
+ spec.homepage = "https://github.com/openjaf/cenit-collection-ecommerce"
15
+
16
+ spec.rubyforge_project = "cenit-collection"
17
+
18
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
+ spec.bindir = 'bin'
20
+ spec.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
+ spec.require_paths = ["lib"]
22
+
23
+
24
+ spec.add_development_dependency "bundler", "~> 1.9"
25
+ spec.add_development_dependency "rake", "~> 10.0"
26
+ end
@@ -0,0 +1,29 @@
1
+ require "cenit/collection/ecommerce/version"
2
+
3
+ module Cenit
4
+ module Collection
5
+ module Ecommerce
6
+
7
+ require "cenit/collection/ecommerce/build"
8
+ require "cenit/client"
9
+ #bundle exec irb -I lib -r 'cenit/collection/ecommerce'
10
+ #config = {:push_url => "http://localhost:3000/api/v1/push", :connection_token => "BKjD6BiNijY8y9UwUjsR", :connection_id => "C597517142"}
11
+ #Cenit::Collection::Ecommerce.push_collection
12
+
13
+ @ecommerce= Cenit::Collection::Ecommerce::Build.new
14
+
15
+ def self.push_collection (config)
16
+ Cenit::Client.push(@ecommerce.shared_collection.to_json, config)
17
+ end
18
+
19
+ def self.shared_collection ()
20
+ @ecommerce.shared_collection
21
+ end
22
+
23
+ def self.push_sample(model, config)
24
+ Cenit::Client.push(@ecommerce.sample_data(model).to_json, config)
25
+ end
26
+
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,14 @@
1
+ require "cenit/collection/ecommerce/version"
2
+ require 'cenit/collection/base/build'
3
+
4
+ module Cenit
5
+ module Collection
6
+ module Ecommerce
7
+ class Build < Cenit::Collection::Base::Build
8
+ def initialize
9
+ super(__dir__)
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "Ecommerces Collection 111",
3
+ "description": "Ecommerce Collection",
4
+ "category": "Library",
5
+ "data": {"name": "Ecommerce Collection"}
6
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "title": "Address",
3
+
4
+ "type": "object",
5
+
6
+ "properties": {
7
+ "firstname": {
8
+ "type": "string"
9
+ },
10
+ "lastname": {
11
+ "type": "string"
12
+ },
13
+ "address1": {
14
+ "type": "string"
15
+ },
16
+ "address2": {
17
+ "type": "string",
18
+ "default": ""
19
+ },
20
+ "city": {
21
+ "type": "string"
22
+ },
23
+ "state": {
24
+ "type": "string"
25
+ },
26
+ "country": {
27
+ "type": "string"
28
+ },
29
+ "phone": {
30
+ "type": "string"
31
+ },
32
+ "zipcode": {
33
+ "type": "string"
34
+ }
35
+ },
36
+ "required": ["firstname", "lastname", "address1", "zipcode", "city", "state", "country"]
37
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "schemas":{
3
+ "uri": "adjustment.json",
4
+ "schema": "{\r\n \"title\": \"Adjustment\",\r\n \r\n \"type\": \"object\",\r\n \r\n \"properties\": {\r\n \"name\": {\r\n \"type\": \"string\"\r\n },\r\n \"value\": {\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"required\": [\"name\", \"value\"]\r\n}",
5
+ "library": {
6
+ "_reference": true,
7
+ "name": "Ecommerce"
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "schemas": {
3
+ "uri": "cart.json",
4
+ "schema": "{\r\n \"title\": \"Cart\",\r\n\r\n \"type\": \"object\",\r\n\r\n \"properties\": {\r\n \"id\": {\r\n \"type\": \"string\"\r\n },\r\n \"status\": {\r\n \"type\": \"string\"\r\n },\r\n \"channel\": {\r\n \"type\": \"string\"\r\n },\r\n \"email\": {\r\n \"type\": \"string\"\r\n },\r\n \"currency\": {\r\n \"type\": \"string\"\r\n },\r\n \"placed_on\": {\r\n \"$ref\": \"Date\"\r\n },\r\n \"totals\": {\r\n \"$ref\": \"order_total.json\"\r\n },\r\n \"shipping_address\": {\r\n \"$ref\": \"address.json\"\r\n },\r\n \"billing_address\": {\r\n \"$ref\": \"address.json\"\r\n\r\n },\r\n \"line_items\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"line_item.json\"\r\n }\r\n },\r\n \"adjustments\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"adjustment.json\"\r\n }\r\n },\r\n \"payments\": {\r\n \"type\": \"array\",\r\n \"items\": {\r\n \"$ref\": \"payment.json\"\r\n }\r\n }\r\n },\r\n \"required\": [\"id\", \"status\", \"channel\", \"email\", \"currency\", \"placed_on\", \"shipping_address\", \"billing_address\"]\r\n}",
5
+ "library": {
6
+ "_reference": true,
7
+ "name": "Ecommerce"
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "title": "Customer",
3
+
4
+ "type": "object",
5
+
6
+ "properties": {
7
+ "id": {
8
+ "type": "string"
9
+ },
10
+ "firstname": {
11
+ "type": "string"
12
+ },
13
+ "lastname": {
14
+ "type": "string"
15
+ },
16
+ "email": {
17
+ "type": "string"
18
+ },
19
+ "shipping_address": {
20
+ "$ref": "address.json"
21
+ },
22
+ "billing_address": {
23
+ "$ref": "address.json"
24
+ }
25
+ },
26
+ "required": ["id", "firstname", "lastname"]
27
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "schemas": {
3
+ "uri": "dimension.json",
4
+ "schema": "{\r\n \"title\": \"Dimension\",\r\n\r\n \"type\": \"object\",\r\n\r\n \"properties\": {\r\n \"height\": {\r\n \"type\": \"integer\"\r\n },\r\n \"width\": {\r\n \"type\": \"integer\"\r\n }\r\n }\r\n}",
5
+ "library": {
6
+ "_reference": true,
7
+ "name": "Ecommerce"
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "title": "Image",
3
+
4
+ "type": "object",
5
+
6
+ "properties": {
7
+ "url": {
8
+ "type": "string"
9
+ },
10
+ "position": {
11
+ "type": "string"
12
+ },
13
+ "title": {
14
+ "type": "string"
15
+ },
16
+ "type": {
17
+ "type": "string"
18
+ },
19
+ "dimension": {
20
+ "$ref": "Dimension"
21
+ }
22
+
23
+ },
24
+ "required": ["url"]
25
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "title": "Inventory",
3
+
4
+ "type": "object",
5
+
6
+ "properties": {
7
+ "id": {
8
+ "type": "string"
9
+ },
10
+ "location": {
11
+ "type": "string"
12
+ },
13
+ "quantity": {
14
+ "type": "integer"
15
+ },
16
+ "product_id": {
17
+ "type": "string"
18
+ }
19
+ },
20
+ "required": ["location", "quantity"]
21
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "title": "LineItem",
3
+
4
+ "type": "object",
5
+
6
+ "properties": {
7
+ "name": {
8
+ "type": "string"
9
+ },
10
+ "quantity": {
11
+ "type": "integer"
12
+ },
13
+ "price": {
14
+ "type": "number"
15
+ },
16
+ "product_id": {
17
+ "type": "string"
18
+ }
19
+ },
20
+ "required": ["name", "quantity", "price"]
21
+ }
@@ -0,0 +1,60 @@
1
+ {
2
+ "title": "Order",
3
+
4
+ "type": "object",
5
+
6
+ "properties": {
7
+ "id": {
8
+ "type": "string"
9
+ },
10
+ "status": {
11
+ "type": "string"
12
+ },
13
+ "channel": {
14
+ "type": "string"
15
+ },
16
+ "email": {
17
+ "type": "string"
18
+ },
19
+ "currency": {
20
+ "type": "string"
21
+ },
22
+ "placed_on": {
23
+ "$ref": "DateTime"
24
+ },
25
+ "token": {
26
+ "type": "string"
27
+ },
28
+ "shipping_instructions": {
29
+ "type": "string"
30
+ },
31
+ "totals": {
32
+ "$ref": "order_total.json"
33
+ },
34
+ "line_items": {
35
+ "type": "array",
36
+ "items": {
37
+ "$ref": "line_item.json"
38
+ }
39
+ },
40
+ "adjustments": {
41
+ "type": "array",
42
+ "items": {
43
+ "$ref": "adjustment.json"
44
+ }
45
+ },
46
+ "payments": {
47
+ "type": "array",
48
+ "items": {
49
+ "$ref": "payment.json"
50
+ }
51
+ },
52
+ "shipping_address": {
53
+ "$ref": "address.json"
54
+ },
55
+ "billing_address": {
56
+ "$ref": "address.json"
57
+ }
58
+ },
59
+ "required": ["id", "status", "channel", "currency", "placed_on"]
60
+ }