netsuite_api 0.1.2 → 0.1.4

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
2
  SHA256:
3
- metadata.gz: f3974a301fe87a4275e736c4a8ba9baed955c95f19daebfc99a0415bf6c5a32f
4
- data.tar.gz: 6ec6116a64a4a52e3b59cd66c9066bd68d140adab6527ed9647979a1de3af872
3
+ metadata.gz: a19005bb2dadcffb65d996a094dbf0f55c866531b46a4cf1201b1acc05e84699
4
+ data.tar.gz: abff7e2b360b63df02b2ebb9edb800d6ec7293d3337fa02c366623a8d98e4171
5
5
  SHA512:
6
- metadata.gz: f6438fc9fb9225961945fdf572389357f03b97690e5984c9708fd11f85c4695c58b6a0c8388cde5a4b4d490ab27490b27cfee6b2672f92284586661a469ba1ad
7
- data.tar.gz: c758d278fe44237943c066343c9c3d8bb62ac69720582179d278691ea3967dc833109bbf4e94e7cc2af7fd66db12a96d0b23718bf3793b89c979954bace242df
6
+ metadata.gz: d64199bf0624819643df0ac0b56f61da172274a96ebaa1b81b2713a97cfc99f8005fc5ab4d5d40ec07567b468f6cdf5df01ebbc01051556033643ea093b9ba5e
7
+ data.tar.gz: fb661b28e3c79df42d0116f7256d78bfba4f7e000c1b97256fd7ec9b43a847fa2ec1a7ef0f685c6d9c778d9c0c2531d7acf3892c9a87f378ac89c20697fcb573
data/Gemfile.lock CHANGED
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- netsuite_api (0.1.1)
5
- activesupport (~> 6.0)
6
- faraday (~> 2.0)
7
- securerandom (~> 0.3)
4
+ netsuite_api (0.1.2)
5
+ activesupport
6
+ faraday
7
+ securerandom
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,14 +1,17 @@
1
1
  # NetsuiteApi
2
2
 
3
3
  This library is designed to help ruby/rails based applications communicate with the publicly available REST API for NetSuite.
4
+
4
5
  If you are unfamiliar with the NetSuite REST API, you should first read the documentation located at [SuiteTalk REST Web Services API Guide](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/book_1559132836.html).
5
6
 
7
+ The NetSuite REST API document could be found at [NetSuite REST API Browser: Record API v1](https://system.netsuite.com/help/helpcenter/en_US/APIs/REST_API_Browser/record/v1/2024.1/index.html#tag-account)
8
+
6
9
  ## Installation
7
10
 
8
11
  Add this line to your application's Gemfile:
9
12
 
10
13
  ```ruby
11
- gem 'netsuite_api'
14
+ gem 'netsuite_api', '0.1.4'
12
15
  ```
13
16
 
14
17
  And then execute:
@@ -19,9 +22,106 @@ Or install it yourself as:
19
22
 
20
23
  $ gem install netsuite_api
21
24
 
22
- ## Usage
25
+ ## Basic Usage
26
+
27
+ ### Setup Credential Information
28
+
29
+ Set All the credential information in your project .env file
30
+ ```
31
+ NETSUITE_HOST = ""
32
+ NETSUITE_ACCOUNT_ID = ""
33
+ NETSUITE_CONSUMER_KEY = ""
34
+ NETSUITE_CONSUMER_SECRET = ""
35
+ NETSUITE_TOKEN = ""
36
+ NETSUITE_TOKEN_SECRET = ""
37
+ NETSUITE_PDF_HOST =
38
+ ```
39
+
40
+ or pass those information when initialize NetsuiteApi instance, for example, initializing NetsuiteApi::Invoice
41
+ ```
42
+ NetsuiteApi::Invoice.new(netsuite_host: "", netsuite_pdf_host: "", account_id: "", consumer_key: "", token: "", token_secret: "", consumer_secret: "")
43
+ ```
44
+
45
+ ## NetsuiteApi Object Usage
46
+
47
+ There are 7 objects could be used: `NetsuiteApi::Invoice`, `NetsuiteApi::CreditMemo`, `NetsuiteApi::Payment`, `NetsuiteApi::Customer`, `NetsuiteApi::Contact`, `NetsuiteApi::Vendor`, `NetsuiteApi::VendorBill`.
48
+
49
+ More information about the objects could be found in `lib/netsuite_api`.
50
+
51
+ All the objects have method to get record, create data, update data, delete data in NetSuite through Netsuite REST API.
52
+
53
+ Following section shows an example of using `NetsuiteApi::Invoice`. The way to use other objects is similar.
54
+
55
+ ### Get data
56
+
57
+ * Get a specific invoice data.
58
+ ```
59
+ service = NetsuiteApi::Invoice.new
60
+ service.get(netsuite_invoice_id)
61
+ ```
62
+
63
+ * Query some invoice data.
64
+ ```
65
+ # query invoices which entity is 12
66
+
67
+ service = NetsuiteApi::Invoice.new
68
+ query_params = { "q" => "entity EQUAL 12" }
69
+ service.query(query_params)
70
+ ```
71
+ More information about the query parameters could be found in [Record Collection Filtering](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1545222128.html#Record-Collection-Filtering)
72
+
73
+
74
+ ### Create data
75
+
76
+ * Create an invoice
77
+ ```
78
+ service = NetsuiteApi::Invoice.new
79
+ params = {
80
+ "entity" => {
81
+ "id" => "12"
82
+ },
83
+ "postingperiod" => "121",
84
+ "item" => {
85
+ "items" => [
86
+ {
87
+ "amount" => 100.0,
88
+ "item" => {
89
+ "id" => "26"
90
+ }
91
+ }
92
+ ]
93
+ },
94
+ "subsidiary" => {
95
+ "id" => "8"
96
+ },
97
+ "currency" => {
98
+ "id": "2"
99
+ }
100
+ }
101
+ service.create(invoice_params)
102
+ ```
103
+
104
+
105
+ ### Update data
106
+
107
+ * Update an invoice
108
+ ```
109
+ service = NetsuiteApi::Invoice.new
110
+ update_params = { "otherRefNum": "1234" }
111
+ invoice_id = 1
112
+ service.update(invoice_id, update_params)
113
+ ```
114
+
115
+
116
+ ### Delete data
117
+
118
+ * Delete an invoice
119
+ ```
120
+ service = NetsuiteApi::Invoice.new
121
+ invoice_id = 1
122
+ service.delete(invoice_id)
123
+ ```
23
124
 
24
- TODO: Write usage instructions here
25
125
 
26
126
  ## Development
27
127
 
@@ -31,7 +131,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
31
131
 
32
132
  ## Contributing
33
133
 
34
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/netsuite_api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
134
+ Bug reports and pull requests are welcome on GitHub at https://github.com/iceland101113/netsuite_api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
35
135
 
36
136
  ## License
37
137
 
@@ -1,3 +1,3 @@
1
1
  module NetsuiteApi
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.4"
3
3
  end
data/netsuite_api.gemspec CHANGED
@@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
39
39
  spec.add_development_dependency "rspec", "~> 3.0"
40
40
  spec.add_development_dependency "webmock", "~> 3.0"
41
41
  # spec.add_development_dependency "pry",
42
- spec.add_dependency "faraday", "~> 2.0"
43
- spec.add_dependency "activesupport", "~> 6.0"
44
- spec.add_dependency "securerandom", "~> 0.3"
42
+ spec.add_dependency "faraday"
43
+ spec.add_dependency "activesupport"
44
+ spec.add_dependency "securerandom"
45
45
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netsuite_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - HueiYi Lucy Cheng
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-07 00:00:00.000000000 Z
11
+ date: 2024-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -70,44 +70,44 @@ dependencies:
70
70
  name: faraday
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '2.0'
75
+ version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '2.0'
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: activesupport
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '6.0'
89
+ version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: '6.0'
96
+ version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: securerandom
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: '0.3'
103
+ version: '0'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: '0.3'
110
+ version: '0'
111
111
  description: Ruby Library for NetSuite REST API. Originally developed by HueiYi Lucy
112
112
  Cheng.
113
113
  email: