@flexprice/sdk 0.0.1 → 1.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 (2) hide show
  1. package/README.md +216 -340
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,380 +1,256 @@
1
- # flexprice-client
1
+ # FlexPrice JavaScript SDK
2
2
 
3
- FlexpriceClient - JavaScript client for flexprice-client
4
- FlexPrice API Service
5
- This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
6
-
7
- - API version: 1.0
8
- - Package version: 1.0
9
- - Generator version: 7.12.0
10
- - Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
3
+ This is the JavaScript client library for the FlexPrice API.
11
4
 
12
5
  ## Installation
13
6
 
14
- ### For [Node.js](https://nodejs.org/)
15
-
16
- #### npm
7
+ ### Node.js
17
8
 
18
- To publish the library as a [npm](https://www.npmjs.com/), please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).
9
+ ```bash
10
+ npm install @flexprice/sdk --save
11
+ ```
19
12
 
20
- Then install it via:
13
+ ### Browser via CDN
21
14
 
22
- ```shell
23
- npm install flexprice-client --save
15
+ ```html
16
+ <script src="https://cdn.jsdelivr.net/npm/@flexprice/sdk/dist/flexprice-sdk.min.js"></script>
24
17
  ```
25
18
 
26
- Finally, you need to build the module:
19
+ ## Usage
20
+
21
+ ```javascript
22
+ // Import the FlexPrice SDK
23
+ const FlexPrice = require('@flexprice/sdk');
24
+ // Or using ES modules:
25
+ // import * as FlexPrice from '@flexprice/sdk';
26
+
27
+ // Load environment variables (using dotenv package)
28
+ require('dotenv').config();
29
+
30
+ function main() {
31
+ try {
32
+ // Configure the API client with your API key
33
+ // API keys should start with 'sk_' followed by a unique identifier
34
+ const apiKey = process.env.FLEXPRICE_API_KEY;
35
+ const apiHost = process.env.FLEXPRICE_API_HOST || 'api.cloud.flexprice.io';
36
+
37
+ if (!apiKey) {
38
+ console.error('ERROR: You must provide a valid FlexPrice API key');
39
+ process.exit(1);
40
+ }
41
+
42
+ // Initialize the API client with your API key
43
+ const defaultClient = FlexPrice.ApiClient.instance;
44
+
45
+ // Set the base path directly to the API endpoint including /v1
46
+ defaultClient.basePath = `https://${apiHost}/v1`;
47
+
48
+ // Configure API key authorization
49
+ const apiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
50
+ apiKeyAuth.apiKey = apiKey;
51
+ apiKeyAuth.in = 'header';
52
+ apiKeyAuth.name = 'x-api-key';
53
+
54
+ // Generate a unique customer ID for this example
55
+ const customerId = `sample-customer-${Date.now()}`;
56
+
57
+ // Create API instances for different endpoints
58
+ const eventsApi = new FlexPrice.EventsApi();
59
+ const customersApi = new FlexPrice.CustomersApi();
60
+
61
+ // Step 1: Create a customer
62
+ console.log(`Creating customer with ID: ${customerId}...`);
63
+
64
+ const customerRequest = {
65
+ externalId: customerId,
66
+ email: `example-${customerId}@example.com`,
67
+ name: 'Example Customer',
68
+ metadata: {
69
+ source: 'javascript-sdk-example',
70
+ createdAt: new Date().toISOString()
71
+ }
72
+ };
73
+
74
+ customersApi.customersPost({
75
+ dtoCreateCustomerRequest: customerRequest
76
+ }, function(error, data, response) {
77
+ if (error) {
78
+ console.error('Error creating customer:', error);
79
+ return;
80
+ }
81
+
82
+ console.log('Customer created successfully!');
83
+
84
+ // Step 2: Create an event
85
+ console.log('Creating event...');
86
+
87
+ // Important: Use snake_case for all property names to match the API
88
+ const eventRequest = {
89
+ event_name: 'Sample Event',
90
+ external_customer_id: customerId,
91
+ properties: {
92
+ source: 'javascript_sample_app',
93
+ environment: 'test',
94
+ timestamp: new Date().toISOString()
95
+ },
96
+ source: 'javascript_sample_app',
97
+ timestamp: new Date().toISOString()
98
+ };
99
+
100
+ // Important: Pass the event directly without wrapping it
101
+ eventsApi.eventsPost(eventRequest, function(error, eventResult, response) {
102
+ if (error) {
103
+ console.error('Error creating event:', error);
104
+ return;
105
+ }
106
+
107
+ console.log(`Event created successfully! ID: ${eventResult.event_id}`);
108
+
109
+ // Step 3: Retrieve events for this customer
110
+ console.log(`Retrieving events for customer ${customerId}...`);
111
+
112
+ // Important: Use snake_case for parameter names
113
+ eventsApi.eventsGet({
114
+ external_customer_id: customerId
115
+ }, function(error, events, response) {
116
+ if (error) {
117
+ console.error('Error retrieving events:', error);
118
+ return;
119
+ }
120
+
121
+ console.log(`Found ${events.events.length} events:`);
122
+
123
+ events.events.forEach((event, index) => {
124
+ console.log(`Event ${index + 1}: ${event.id} - ${event.event_name}`);
125
+ console.log(`Properties: ${JSON.stringify(event.properties)}`);
126
+ });
127
+
128
+ console.log('Example completed successfully!');
129
+ });
130
+ });
131
+ });
132
+ } catch (error) {
133
+ console.error('Error:', error);
134
+ }
135
+ }
27
136
 
28
- ```shell
29
- npm run build
137
+ main();
30
138
  ```
31
139
 
32
- ##### Local development
140
+ ## Running the Example
33
141
 
34
- To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run:
142
+ To run the provided example:
35
143
 
36
- ```shell
37
- npm install
38
- ```
144
+ 1. Clone the repository:
145
+ ```bash
146
+ git clone https://github.com/flexprice/javascript-sdk.git
147
+ cd javascript-sdk/examples
148
+ ```
39
149
 
40
- Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`:
150
+ 2. Install dependencies:
151
+ ```bash
152
+ npm install
153
+ ```
41
154
 
42
- ```shell
43
- npm link
44
- ```
155
+ 3. Create a `.env` file with your API credentials:
156
+ ```bash
157
+ cp .env.sample .env
158
+ # Edit .env with your API key
159
+ ```
45
160
 
46
- To use the link you just defined in your project, switch to the directory you want to use your flexprice-client from, and run:
161
+ 4. Run the example:
162
+ ```bash
163
+ npm start
164
+ ```
47
165
 
48
- ```shell
49
- npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
50
- ```
166
+ ## Features
51
167
 
52
- Finally, you need to build the module:
168
+ - Complete API coverage
169
+ - CommonJS and ES Module support
170
+ - Browser compatibility
171
+ - Detailed documentation
172
+ - Error handling
173
+ - TypeScript definitions
53
174
 
54
- ```shell
55
- npm run build
56
- ```
175
+ ## Documentation
57
176
 
58
- #### git
177
+ For detailed API documentation, refer to the code comments and the official FlexPrice API documentation.
59
178
 
60
- If the library is hosted at a git repository, e.g.https://github.com/flexprice/javascript-sdk
61
- then install it via:
179
+ ## Troubleshooting
62
180
 
63
- ```shell
64
- npm install flexprice/javascript-sdk --save
65
- ```
181
+ ### Authentication Issues
66
182
 
67
- ### For browser
183
+ If you see errors related to authentication:
68
184
 
69
- The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
70
- the above steps with Node.js and installing browserify with `npm install -g browserify`,
71
- perform the following (assuming *main.js* is your entry file):
185
+ - Make sure your API key starts with `sk_` (for server-side usage)
186
+ - Check that the key is active and has the necessary permissions
187
+ - Use the `x-api-key` header for authentication (the SDK handles this for you)
72
188
 
73
- ```shell
74
- browserify main.js > bundle.js
75
- ```
189
+ ### Property Names
76
190
 
77
- Then include *bundle.js* in the HTML pages.
191
+ Always use snake_case for property names in requests:
192
+ - ✅ `event_name`, `external_customer_id`, `page_size`
193
+ - ❌ `eventName`, `externalCustomerId`, `pageSize`
78
194
 
79
- ### Webpack Configuration
195
+ ### Parameter Passing
80
196
 
81
- Using Webpack you may encounter the following error: "Module not found: Error:
82
- Cannot resolve module", most certainly you should disable AMD loader. Add/merge
83
- the following section to your webpack config:
197
+ Pass parameters directly to methods like eventsPost:
198
+ - `eventsApi.eventsPost(eventRequest, callback)`
199
+ - `eventsApi.eventsPost({ dtoIngestEventRequest: eventRequest }, callback)`
200
+
201
+ ### Callback vs Promise Error
202
+
203
+ The SDK uses callback-style API calls instead of Promises. If you see an error like:
84
204
 
85
- ```javascript
86
- module: {
87
- rules: [
88
- {
89
- parser: {
90
- amd: false
91
- }
92
- }
93
- ]
94
- }
205
+ ```
206
+ Warning: superagent request was sent twice, because both .end() and .then() were called.
95
207
  ```
96
208
 
97
- ## Getting Started
209
+ Make sure you're using the callback pattern shown in the examples, not trying to `await` the API calls.
98
210
 
99
- Please follow the [installation](#installation) instruction and execute the following JS code:
211
+ ### Network or Connectivity Issues
100
212
 
101
- ```javascript
102
- var FlexpriceClient = require('flexprice-client');
213
+ If you encounter network-related errors:
214
+
215
+ - Check your internet connection
216
+ - Verify that the API host is accessible from your environment
217
+ - Look for firewall or proxy settings that might block API requests
218
+
219
+ ### Using the SDK in a Browser
220
+
221
+ When using the SDK in a browser, remember:
222
+
223
+ - CORS restrictions might apply - ensure your domain is whitelisted
224
+ - Never expose API keys in client-side code - use a proxy or backend service
225
+ - Some features might be limited in browser environments
226
+
227
+ ## TypeScript Usage
103
228
 
229
+ The package includes TypeScript definitions:
104
230
 
105
- var api = new FlexpriceClient.AuthApi()
106
- var login = new FlexpriceClient.DtoLoginRequest(); // {DtoLoginRequest} Login request
107
- var callback = function(error, data, response) {
231
+ ```typescript
232
+ import * as FlexPrice from '@flexprice/sdk';
233
+
234
+ // Configure the client
235
+ const client = FlexPrice.ApiClient.instance;
236
+ // ... rest of the configuration
237
+
238
+ // Type-safe API calls with correct property names
239
+ const api = new FlexPrice.EventsApi();
240
+
241
+ const eventRequest = {
242
+ event_name: 'Sample Event',
243
+ external_customer_id: 'customer-123',
244
+ properties: { key: 'value' },
245
+ source: 'typescript_example',
246
+ timestamp: new Date().toISOString()
247
+ };
248
+
249
+ api.eventsPost(eventRequest, (error, data, response) => {
108
250
  if (error) {
109
251
  console.error(error);
110
252
  } else {
111
- console.log('API called successfully. Returned data: ' + data);
253
+ console.log(data);
112
254
  }
113
- };
114
- api.authLoginPost(login, callback);
115
-
116
- ```
117
-
118
- ## Documentation for API Endpoints
119
-
120
- All URIs are relative to */v1*
121
-
122
- Class | Method | HTTP request | Description
123
- ------------ | ------------- | ------------- | -------------
124
- *FlexpriceClient.AuthApi* | [**authLoginPost**](docs/AuthApi.md#authLoginPost) | **POST** /auth/login | Login
125
- *FlexpriceClient.AuthApi* | [**authSignupPost**](docs/AuthApi.md#authSignupPost) | **POST** /auth/signup | Sign up
126
- *FlexpriceClient.CustomersApi* | [**customersGet**](docs/CustomersApi.md#customersGet) | **GET** /customers | Get customers
127
- *FlexpriceClient.CustomersApi* | [**customersIdDelete**](docs/CustomersApi.md#customersIdDelete) | **DELETE** /customers/{id} | Delete a customer
128
- *FlexpriceClient.CustomersApi* | [**customersIdEntitlementsGet**](docs/CustomersApi.md#customersIdEntitlementsGet) | **GET** /customers/{id}/entitlements | Get customer entitlements
129
- *FlexpriceClient.CustomersApi* | [**customersIdGet**](docs/CustomersApi.md#customersIdGet) | **GET** /customers/{id} | Get a customer
130
- *FlexpriceClient.CustomersApi* | [**customersIdPut**](docs/CustomersApi.md#customersIdPut) | **PUT** /customers/{id} | Update a customer
131
- *FlexpriceClient.CustomersApi* | [**customersIdUsageGet**](docs/CustomersApi.md#customersIdUsageGet) | **GET** /customers/{id}/usage | Get customer usage summary
132
- *FlexpriceClient.CustomersApi* | [**customersLookupLookupKeyGet**](docs/CustomersApi.md#customersLookupLookupKeyGet) | **GET** /customers/lookup/{lookup_key} | Get a customer by lookup key
133
- *FlexpriceClient.CustomersApi* | [**customersPost**](docs/CustomersApi.md#customersPost) | **POST** /customers | Create a customer
134
- *FlexpriceClient.EntitlementsApi* | [**entitlementsGet**](docs/EntitlementsApi.md#entitlementsGet) | **GET** /entitlements | Get entitlements
135
- *FlexpriceClient.EntitlementsApi* | [**entitlementsIdDelete**](docs/EntitlementsApi.md#entitlementsIdDelete) | **DELETE** /entitlements/{id} | Delete an entitlement
136
- *FlexpriceClient.EntitlementsApi* | [**entitlementsIdGet**](docs/EntitlementsApi.md#entitlementsIdGet) | **GET** /entitlements/{id} | Get an entitlement by ID
137
- *FlexpriceClient.EntitlementsApi* | [**entitlementsIdPut**](docs/EntitlementsApi.md#entitlementsIdPut) | **PUT** /entitlements/{id} | Update an entitlement
138
- *FlexpriceClient.EntitlementsApi* | [**entitlementsPost**](docs/EntitlementsApi.md#entitlementsPost) | **POST** /entitlements | Create a new entitlement
139
- *FlexpriceClient.EntitlementsApi* | [**plansIdEntitlementsGet**](docs/EntitlementsApi.md#plansIdEntitlementsGet) | **GET** /plans/{id}/entitlements | Get plan entitlements
140
- *FlexpriceClient.EnvironmentsApi* | [**environmentsGet**](docs/EnvironmentsApi.md#environmentsGet) | **GET** /environments | Get environments
141
- *FlexpriceClient.EnvironmentsApi* | [**environmentsIdGet**](docs/EnvironmentsApi.md#environmentsIdGet) | **GET** /environments/{id} | Get an environment
142
- *FlexpriceClient.EnvironmentsApi* | [**environmentsIdPut**](docs/EnvironmentsApi.md#environmentsIdPut) | **PUT** /environments/{id} | Update an environment
143
- *FlexpriceClient.EnvironmentsApi* | [**environmentsPost**](docs/EnvironmentsApi.md#environmentsPost) | **POST** /environments | Create an environment
144
- *FlexpriceClient.EventsApi* | [**eventsBulkPost**](docs/EventsApi.md#eventsBulkPost) | **POST** /events/bulk | Bulk Ingest events
145
- *FlexpriceClient.EventsApi* | [**eventsGet**](docs/EventsApi.md#eventsGet) | **GET** /events | Get raw events
146
- *FlexpriceClient.EventsApi* | [**eventsPost**](docs/EventsApi.md#eventsPost) | **POST** /events | Ingest event
147
- *FlexpriceClient.EventsApi* | [**eventsUsageMeterPost**](docs/EventsApi.md#eventsUsageMeterPost) | **POST** /events/usage/meter | Get usage by meter
148
- *FlexpriceClient.EventsApi* | [**eventsUsagePost**](docs/EventsApi.md#eventsUsagePost) | **POST** /events/usage | Get usage statistics
149
- *FlexpriceClient.FeaturesApi* | [**featuresGet**](docs/FeaturesApi.md#featuresGet) | **GET** /features | List features
150
- *FlexpriceClient.FeaturesApi* | [**featuresIdDelete**](docs/FeaturesApi.md#featuresIdDelete) | **DELETE** /features/{id} | Delete a feature
151
- *FlexpriceClient.FeaturesApi* | [**featuresIdGet**](docs/FeaturesApi.md#featuresIdGet) | **GET** /features/{id} | Get a feature by ID
152
- *FlexpriceClient.FeaturesApi* | [**featuresIdPut**](docs/FeaturesApi.md#featuresIdPut) | **PUT** /features/{id} | Update a feature
153
- *FlexpriceClient.FeaturesApi* | [**featuresPost**](docs/FeaturesApi.md#featuresPost) | **POST** /features | Create a new feature
154
- *FlexpriceClient.IntegrationsApi* | [**secretsIntegrationsIdDelete**](docs/IntegrationsApi.md#secretsIntegrationsIdDelete) | **DELETE** /secrets/integrations/{id} | Delete an integration
155
- *FlexpriceClient.IntegrationsApi* | [**secretsIntegrationsLinkedGet**](docs/IntegrationsApi.md#secretsIntegrationsLinkedGet) | **GET** /secrets/integrations/linked | List linked integrations
156
- *FlexpriceClient.IntegrationsApi* | [**secretsIntegrationsProviderGet**](docs/IntegrationsApi.md#secretsIntegrationsProviderGet) | **GET** /secrets/integrations/{provider} | Get integration details
157
- *FlexpriceClient.IntegrationsApi* | [**secretsIntegrationsProviderPost**](docs/IntegrationsApi.md#secretsIntegrationsProviderPost) | **POST** /secrets/integrations/{provider} | Create or update an integration
158
- *FlexpriceClient.InvoicesApi* | [**customersIdInvoicesSummaryGet**](docs/InvoicesApi.md#customersIdInvoicesSummaryGet) | **GET** /customers/{id}/invoices/summary | Get a customer invoice summary
159
- *FlexpriceClient.InvoicesApi* | [**invoicesGet**](docs/InvoicesApi.md#invoicesGet) | **GET** /invoices | List invoices
160
- *FlexpriceClient.InvoicesApi* | [**invoicesIdFinalizePost**](docs/InvoicesApi.md#invoicesIdFinalizePost) | **POST** /invoices/{id}/finalize | Finalize an invoice
161
- *FlexpriceClient.InvoicesApi* | [**invoicesIdGet**](docs/InvoicesApi.md#invoicesIdGet) | **GET** /invoices/{id} | Get an invoice by ID
162
- *FlexpriceClient.InvoicesApi* | [**invoicesIdPaymentAttemptPost**](docs/InvoicesApi.md#invoicesIdPaymentAttemptPost) | **POST** /invoices/{id}/payment/attempt | Attempt payment for an invoice
163
- *FlexpriceClient.InvoicesApi* | [**invoicesIdPaymentPut**](docs/InvoicesApi.md#invoicesIdPaymentPut) | **PUT** /invoices/{id}/payment | Update invoice payment status
164
- *FlexpriceClient.InvoicesApi* | [**invoicesIdPdfGet**](docs/InvoicesApi.md#invoicesIdPdfGet) | **GET** /invoices/{id}/pdf | Get PDF for an invoice
165
- *FlexpriceClient.InvoicesApi* | [**invoicesIdVoidPost**](docs/InvoicesApi.md#invoicesIdVoidPost) | **POST** /invoices/{id}/void | Void an invoice
166
- *FlexpriceClient.InvoicesApi* | [**invoicesPost**](docs/InvoicesApi.md#invoicesPost) | **POST** /invoices | Create a new invoice
167
- *FlexpriceClient.InvoicesApi* | [**invoicesPreviewPost**](docs/InvoicesApi.md#invoicesPreviewPost) | **POST** /invoices/preview | Get a preview invoice
168
- *FlexpriceClient.MetersApi* | [**metersGet**](docs/MetersApi.md#metersGet) | **GET** /meters | List meters
169
- *FlexpriceClient.MetersApi* | [**metersIdDelete**](docs/MetersApi.md#metersIdDelete) | **DELETE** /meters/{id} | Delete meter
170
- *FlexpriceClient.MetersApi* | [**metersIdDisablePost**](docs/MetersApi.md#metersIdDisablePost) | **POST** /meters/{id}/disable | Disable meter [TODO: Deprecate]
171
- *FlexpriceClient.MetersApi* | [**metersIdGet**](docs/MetersApi.md#metersIdGet) | **GET** /meters/{id} | Get meter
172
- *FlexpriceClient.MetersApi* | [**metersIdPut**](docs/MetersApi.md#metersIdPut) | **PUT** /meters/{id} | Update meter
173
- *FlexpriceClient.MetersApi* | [**metersPost**](docs/MetersApi.md#metersPost) | **POST** /meters | Create meter
174
- *FlexpriceClient.PaymentsApi* | [**paymentsGet**](docs/PaymentsApi.md#paymentsGet) | **GET** /payments | List payments
175
- *FlexpriceClient.PaymentsApi* | [**paymentsIdDelete**](docs/PaymentsApi.md#paymentsIdDelete) | **DELETE** /payments/{id} | Delete a payment
176
- *FlexpriceClient.PaymentsApi* | [**paymentsIdGet**](docs/PaymentsApi.md#paymentsIdGet) | **GET** /payments/{id} | Get a payment by ID
177
- *FlexpriceClient.PaymentsApi* | [**paymentsIdProcessPost**](docs/PaymentsApi.md#paymentsIdProcessPost) | **POST** /payments/{id}/process | Process a payment
178
- *FlexpriceClient.PaymentsApi* | [**paymentsIdPut**](docs/PaymentsApi.md#paymentsIdPut) | **PUT** /payments/{id} | Update a payment
179
- *FlexpriceClient.PaymentsApi* | [**paymentsPost**](docs/PaymentsApi.md#paymentsPost) | **POST** /payments | Create a new payment
180
- *FlexpriceClient.PlansApi* | [**plansGet**](docs/PlansApi.md#plansGet) | **GET** /plans | Get plans
181
- *FlexpriceClient.PlansApi* | [**plansIdDelete**](docs/PlansApi.md#plansIdDelete) | **DELETE** /plans/{id} | Delete a plan
182
- *FlexpriceClient.PlansApi* | [**plansIdGet**](docs/PlansApi.md#plansIdGet) | **GET** /plans/{id} | Get a plan
183
- *FlexpriceClient.PlansApi* | [**plansIdPut**](docs/PlansApi.md#plansIdPut) | **PUT** /plans/{id} | Update a plan
184
- *FlexpriceClient.PlansApi* | [**plansPost**](docs/PlansApi.md#plansPost) | **POST** /plans | Create a new plan
185
- *FlexpriceClient.PricesApi* | [**pricesGet**](docs/PricesApi.md#pricesGet) | **GET** /prices | Get prices
186
- *FlexpriceClient.PricesApi* | [**pricesIdDelete**](docs/PricesApi.md#pricesIdDelete) | **DELETE** /prices/{id} | Delete a price
187
- *FlexpriceClient.PricesApi* | [**pricesIdGet**](docs/PricesApi.md#pricesIdGet) | **GET** /prices/{id} | Get a price by ID
188
- *FlexpriceClient.PricesApi* | [**pricesIdPut**](docs/PricesApi.md#pricesIdPut) | **PUT** /prices/{id} | Update a price
189
- *FlexpriceClient.PricesApi* | [**pricesPost**](docs/PricesApi.md#pricesPost) | **POST** /prices | Create a new price
190
- *FlexpriceClient.SecretsApi* | [**secretsApiKeysGet**](docs/SecretsApi.md#secretsApiKeysGet) | **GET** /secrets/api/keys | List API keys
191
- *FlexpriceClient.SecretsApi* | [**secretsApiKeysIdDelete**](docs/SecretsApi.md#secretsApiKeysIdDelete) | **DELETE** /secrets/api/keys/{id} | Delete an API key
192
- *FlexpriceClient.SecretsApi* | [**secretsApiKeysPost**](docs/SecretsApi.md#secretsApiKeysPost) | **POST** /secrets/api/keys | Create a new API key
193
- *FlexpriceClient.SubscriptionsApi* | [**subscriptionsGet**](docs/SubscriptionsApi.md#subscriptionsGet) | **GET** /subscriptions | List subscriptions
194
- *FlexpriceClient.SubscriptionsApi* | [**subscriptionsIdCancelPost**](docs/SubscriptionsApi.md#subscriptionsIdCancelPost) | **POST** /subscriptions/{id}/cancel | Cancel subscription
195
- *FlexpriceClient.SubscriptionsApi* | [**subscriptionsIdGet**](docs/SubscriptionsApi.md#subscriptionsIdGet) | **GET** /subscriptions/{id} | Get subscription
196
- *FlexpriceClient.SubscriptionsApi* | [**subscriptionsIdPausePost**](docs/SubscriptionsApi.md#subscriptionsIdPausePost) | **POST** /subscriptions/{id}/pause | Pause a subscription
197
- *FlexpriceClient.SubscriptionsApi* | [**subscriptionsIdPausesGet**](docs/SubscriptionsApi.md#subscriptionsIdPausesGet) | **GET** /subscriptions/{id}/pauses | List all pauses for a subscription
198
- *FlexpriceClient.SubscriptionsApi* | [**subscriptionsIdResumePost**](docs/SubscriptionsApi.md#subscriptionsIdResumePost) | **POST** /subscriptions/{id}/resume | Resume a paused subscription
199
- *FlexpriceClient.SubscriptionsApi* | [**subscriptionsPost**](docs/SubscriptionsApi.md#subscriptionsPost) | **POST** /subscriptions | Create subscription
200
- *FlexpriceClient.SubscriptionsApi* | [**subscriptionsUsagePost**](docs/SubscriptionsApi.md#subscriptionsUsagePost) | **POST** /subscriptions/usage | Get usage by subscription
201
- *FlexpriceClient.TasksApi* | [**tasksGet**](docs/TasksApi.md#tasksGet) | **GET** /tasks | List tasks
202
- *FlexpriceClient.TasksApi* | [**tasksIdGet**](docs/TasksApi.md#tasksIdGet) | **GET** /tasks/{id} | Get a task by ID
203
- *FlexpriceClient.TasksApi* | [**tasksIdProcessPost**](docs/TasksApi.md#tasksIdProcessPost) | **POST** /tasks/{id}/process | Process a task
204
- *FlexpriceClient.TasksApi* | [**tasksIdStatusPut**](docs/TasksApi.md#tasksIdStatusPut) | **PUT** /tasks/{id}/status | Update task status
205
- *FlexpriceClient.TasksApi* | [**tasksPost**](docs/TasksApi.md#tasksPost) | **POST** /tasks | Create a new task
206
- *FlexpriceClient.TenantsApi* | [**tenantBillingGet**](docs/TenantsApi.md#tenantBillingGet) | **GET** /tenant/billing | Get billing usage for the current tenant
207
- *FlexpriceClient.TenantsApi* | [**tenantsIdGet**](docs/TenantsApi.md#tenantsIdGet) | **GET** /tenants/{id} | Get tenant by ID
208
- *FlexpriceClient.TenantsApi* | [**tenantsPost**](docs/TenantsApi.md#tenantsPost) | **POST** /tenants | Create a new tenant
209
- *FlexpriceClient.TenantsApi* | [**tenantsUpdatePut**](docs/TenantsApi.md#tenantsUpdatePut) | **PUT** /tenants/update | Update a tenant
210
- *FlexpriceClient.UsersApi* | [**usersMeGet**](docs/UsersApi.md#usersMeGet) | **GET** /users/me | Get user info
211
- *FlexpriceClient.WalletsApi* | [**customersIdWalletsGet**](docs/WalletsApi.md#customersIdWalletsGet) | **GET** /customers/{id}/wallets | Get wallets by customer ID
212
- *FlexpriceClient.WalletsApi* | [**walletsIdBalanceRealTimeGet**](docs/WalletsApi.md#walletsIdBalanceRealTimeGet) | **GET** /wallets/{id}/balance/real-time | Get wallet balance
213
- *FlexpriceClient.WalletsApi* | [**walletsIdGet**](docs/WalletsApi.md#walletsIdGet) | **GET** /wallets/{id} | Get wallet by ID
214
- *FlexpriceClient.WalletsApi* | [**walletsIdPut**](docs/WalletsApi.md#walletsIdPut) | **PUT** /wallets/{id} | Update a wallet
215
- *FlexpriceClient.WalletsApi* | [**walletsIdTerminatePost**](docs/WalletsApi.md#walletsIdTerminatePost) | **POST** /wallets/{id}/terminate | Terminate a wallet
216
- *FlexpriceClient.WalletsApi* | [**walletsIdTopUpPost**](docs/WalletsApi.md#walletsIdTopUpPost) | **POST** /wallets/{id}/top-up | Top up wallet
217
- *FlexpriceClient.WalletsApi* | [**walletsIdTransactionsGet**](docs/WalletsApi.md#walletsIdTransactionsGet) | **GET** /wallets/{id}/transactions | Get wallet transactions
218
- *FlexpriceClient.WalletsApi* | [**walletsPost**](docs/WalletsApi.md#walletsPost) | **POST** /wallets | Create a new wallet
219
-
220
-
221
- ## Documentation for Models
222
-
223
- - [FlexpriceClient.DtoAddress](docs/DtoAddress.md)
224
- - [FlexpriceClient.DtoAggregatedEntitlement](docs/DtoAggregatedEntitlement.md)
225
- - [FlexpriceClient.DtoAggregatedFeature](docs/DtoAggregatedFeature.md)
226
- - [FlexpriceClient.DtoAuthResponse](docs/DtoAuthResponse.md)
227
- - [FlexpriceClient.DtoBillingPeriodInfo](docs/DtoBillingPeriodInfo.md)
228
- - [FlexpriceClient.DtoBulkIngestEventRequest](docs/DtoBulkIngestEventRequest.md)
229
- - [FlexpriceClient.DtoCreateAPIKeyRequest](docs/DtoCreateAPIKeyRequest.md)
230
- - [FlexpriceClient.DtoCreateAPIKeyResponse](docs/DtoCreateAPIKeyResponse.md)
231
- - [FlexpriceClient.DtoCreateCustomerRequest](docs/DtoCreateCustomerRequest.md)
232
- - [FlexpriceClient.DtoCreateEntitlementRequest](docs/DtoCreateEntitlementRequest.md)
233
- - [FlexpriceClient.DtoCreateEnvironmentRequest](docs/DtoCreateEnvironmentRequest.md)
234
- - [FlexpriceClient.DtoCreateFeatureRequest](docs/DtoCreateFeatureRequest.md)
235
- - [FlexpriceClient.DtoCreateIntegrationRequest](docs/DtoCreateIntegrationRequest.md)
236
- - [FlexpriceClient.DtoCreateInvoiceLineItemRequest](docs/DtoCreateInvoiceLineItemRequest.md)
237
- - [FlexpriceClient.DtoCreateInvoiceRequest](docs/DtoCreateInvoiceRequest.md)
238
- - [FlexpriceClient.DtoCreateMeterRequest](docs/DtoCreateMeterRequest.md)
239
- - [FlexpriceClient.DtoCreatePaymentRequest](docs/DtoCreatePaymentRequest.md)
240
- - [FlexpriceClient.DtoCreatePlanEntitlementRequest](docs/DtoCreatePlanEntitlementRequest.md)
241
- - [FlexpriceClient.DtoCreatePlanPriceRequest](docs/DtoCreatePlanPriceRequest.md)
242
- - [FlexpriceClient.DtoCreatePlanRequest](docs/DtoCreatePlanRequest.md)
243
- - [FlexpriceClient.DtoCreatePriceRequest](docs/DtoCreatePriceRequest.md)
244
- - [FlexpriceClient.DtoCreatePriceTier](docs/DtoCreatePriceTier.md)
245
- - [FlexpriceClient.DtoCreateSubscriptionRequest](docs/DtoCreateSubscriptionRequest.md)
246
- - [FlexpriceClient.DtoCreateTaskRequest](docs/DtoCreateTaskRequest.md)
247
- - [FlexpriceClient.DtoCreateTenantRequest](docs/DtoCreateTenantRequest.md)
248
- - [FlexpriceClient.DtoCreateWalletRequest](docs/DtoCreateWalletRequest.md)
249
- - [FlexpriceClient.DtoCustomerEntitlementsResponse](docs/DtoCustomerEntitlementsResponse.md)
250
- - [FlexpriceClient.DtoCustomerInvoiceSummary](docs/DtoCustomerInvoiceSummary.md)
251
- - [FlexpriceClient.DtoCustomerMultiCurrencyInvoiceSummary](docs/DtoCustomerMultiCurrencyInvoiceSummary.md)
252
- - [FlexpriceClient.DtoCustomerResponse](docs/DtoCustomerResponse.md)
253
- - [FlexpriceClient.DtoCustomerUsageSummaryResponse](docs/DtoCustomerUsageSummaryResponse.md)
254
- - [FlexpriceClient.DtoEntitlementResponse](docs/DtoEntitlementResponse.md)
255
- - [FlexpriceClient.DtoEntitlementSource](docs/DtoEntitlementSource.md)
256
- - [FlexpriceClient.DtoEnvironmentResponse](docs/DtoEnvironmentResponse.md)
257
- - [FlexpriceClient.DtoEvent](docs/DtoEvent.md)
258
- - [FlexpriceClient.DtoFeatureResponse](docs/DtoFeatureResponse.md)
259
- - [FlexpriceClient.DtoFeatureUsageSummary](docs/DtoFeatureUsageSummary.md)
260
- - [FlexpriceClient.DtoGetEventsResponse](docs/DtoGetEventsResponse.md)
261
- - [FlexpriceClient.DtoGetPreviewInvoiceRequest](docs/DtoGetPreviewInvoiceRequest.md)
262
- - [FlexpriceClient.DtoGetUsageByMeterRequest](docs/DtoGetUsageByMeterRequest.md)
263
- - [FlexpriceClient.DtoGetUsageBySubscriptionRequest](docs/DtoGetUsageBySubscriptionRequest.md)
264
- - [FlexpriceClient.DtoGetUsageBySubscriptionResponse](docs/DtoGetUsageBySubscriptionResponse.md)
265
- - [FlexpriceClient.DtoGetUsageRequest](docs/DtoGetUsageRequest.md)
266
- - [FlexpriceClient.DtoGetUsageResponse](docs/DtoGetUsageResponse.md)
267
- - [FlexpriceClient.DtoIngestEventRequest](docs/DtoIngestEventRequest.md)
268
- - [FlexpriceClient.DtoInvoiceLineItemResponse](docs/DtoInvoiceLineItemResponse.md)
269
- - [FlexpriceClient.DtoInvoiceResponse](docs/DtoInvoiceResponse.md)
270
- - [FlexpriceClient.DtoLinkedIntegrationsResponse](docs/DtoLinkedIntegrationsResponse.md)
271
- - [FlexpriceClient.DtoListCustomersResponse](docs/DtoListCustomersResponse.md)
272
- - [FlexpriceClient.DtoListEntitlementsResponse](docs/DtoListEntitlementsResponse.md)
273
- - [FlexpriceClient.DtoListEnvironmentsResponse](docs/DtoListEnvironmentsResponse.md)
274
- - [FlexpriceClient.DtoListFeaturesResponse](docs/DtoListFeaturesResponse.md)
275
- - [FlexpriceClient.DtoListInvoicesResponse](docs/DtoListInvoicesResponse.md)
276
- - [FlexpriceClient.DtoListPaymentsResponse](docs/DtoListPaymentsResponse.md)
277
- - [FlexpriceClient.DtoListPlansResponse](docs/DtoListPlansResponse.md)
278
- - [FlexpriceClient.DtoListPricesResponse](docs/DtoListPricesResponse.md)
279
- - [FlexpriceClient.DtoListSecretsResponse](docs/DtoListSecretsResponse.md)
280
- - [FlexpriceClient.DtoListSubscriptionPausesResponse](docs/DtoListSubscriptionPausesResponse.md)
281
- - [FlexpriceClient.DtoListSubscriptionsResponse](docs/DtoListSubscriptionsResponse.md)
282
- - [FlexpriceClient.DtoListTasksResponse](docs/DtoListTasksResponse.md)
283
- - [FlexpriceClient.DtoListWalletTransactionsResponse](docs/DtoListWalletTransactionsResponse.md)
284
- - [FlexpriceClient.DtoLoginRequest](docs/DtoLoginRequest.md)
285
- - [FlexpriceClient.DtoMeterResponse](docs/DtoMeterResponse.md)
286
- - [FlexpriceClient.DtoPauseSubscriptionRequest](docs/DtoPauseSubscriptionRequest.md)
287
- - [FlexpriceClient.DtoPaymentAttemptResponse](docs/DtoPaymentAttemptResponse.md)
288
- - [FlexpriceClient.DtoPaymentResponse](docs/DtoPaymentResponse.md)
289
- - [FlexpriceClient.DtoPlanResponse](docs/DtoPlanResponse.md)
290
- - [FlexpriceClient.DtoPriceResponse](docs/DtoPriceResponse.md)
291
- - [FlexpriceClient.DtoResumeSubscriptionRequest](docs/DtoResumeSubscriptionRequest.md)
292
- - [FlexpriceClient.DtoSecretResponse](docs/DtoSecretResponse.md)
293
- - [FlexpriceClient.DtoSignUpRequest](docs/DtoSignUpRequest.md)
294
- - [FlexpriceClient.DtoSubscriptionPauseResponse](docs/DtoSubscriptionPauseResponse.md)
295
- - [FlexpriceClient.DtoSubscriptionResponse](docs/DtoSubscriptionResponse.md)
296
- - [FlexpriceClient.DtoSubscriptionUsageByMetersResponse](docs/DtoSubscriptionUsageByMetersResponse.md)
297
- - [FlexpriceClient.DtoTaskResponse](docs/DtoTaskResponse.md)
298
- - [FlexpriceClient.DtoTenantBillingDetails](docs/DtoTenantBillingDetails.md)
299
- - [FlexpriceClient.DtoTenantBillingUsage](docs/DtoTenantBillingUsage.md)
300
- - [FlexpriceClient.DtoTenantResponse](docs/DtoTenantResponse.md)
301
- - [FlexpriceClient.DtoTopUpWalletRequest](docs/DtoTopUpWalletRequest.md)
302
- - [FlexpriceClient.DtoUpdateCustomerRequest](docs/DtoUpdateCustomerRequest.md)
303
- - [FlexpriceClient.DtoUpdateEntitlementRequest](docs/DtoUpdateEntitlementRequest.md)
304
- - [FlexpriceClient.DtoUpdateEnvironmentRequest](docs/DtoUpdateEnvironmentRequest.md)
305
- - [FlexpriceClient.DtoUpdateFeatureRequest](docs/DtoUpdateFeatureRequest.md)
306
- - [FlexpriceClient.DtoUpdateMeterRequest](docs/DtoUpdateMeterRequest.md)
307
- - [FlexpriceClient.DtoUpdatePaymentRequest](docs/DtoUpdatePaymentRequest.md)
308
- - [FlexpriceClient.DtoUpdatePaymentStatusRequest](docs/DtoUpdatePaymentStatusRequest.md)
309
- - [FlexpriceClient.DtoUpdatePlanEntitlementRequest](docs/DtoUpdatePlanEntitlementRequest.md)
310
- - [FlexpriceClient.DtoUpdatePlanPriceRequest](docs/DtoUpdatePlanPriceRequest.md)
311
- - [FlexpriceClient.DtoUpdatePlanRequest](docs/DtoUpdatePlanRequest.md)
312
- - [FlexpriceClient.DtoUpdatePriceRequest](docs/DtoUpdatePriceRequest.md)
313
- - [FlexpriceClient.DtoUpdateTaskStatusRequest](docs/DtoUpdateTaskStatusRequest.md)
314
- - [FlexpriceClient.DtoUpdateTenantRequest](docs/DtoUpdateTenantRequest.md)
315
- - [FlexpriceClient.DtoUpdateWalletRequest](docs/DtoUpdateWalletRequest.md)
316
- - [FlexpriceClient.DtoUsageResult](docs/DtoUsageResult.md)
317
- - [FlexpriceClient.DtoUserResponse](docs/DtoUserResponse.md)
318
- - [FlexpriceClient.DtoWalletBalanceResponse](docs/DtoWalletBalanceResponse.md)
319
- - [FlexpriceClient.DtoWalletResponse](docs/DtoWalletResponse.md)
320
- - [FlexpriceClient.DtoWalletTransactionResponse](docs/DtoWalletTransactionResponse.md)
321
- - [FlexpriceClient.ErrorsErrorDetail](docs/ErrorsErrorDetail.md)
322
- - [FlexpriceClient.ErrorsErrorResponse](docs/ErrorsErrorResponse.md)
323
- - [FlexpriceClient.MeterAggregation](docs/MeterAggregation.md)
324
- - [FlexpriceClient.MeterFilter](docs/MeterFilter.md)
325
- - [FlexpriceClient.PriceJSONBTransformQuantity](docs/PriceJSONBTransformQuantity.md)
326
- - [FlexpriceClient.PricePrice](docs/PricePrice.md)
327
- - [FlexpriceClient.PricePriceTier](docs/PricePriceTier.md)
328
- - [FlexpriceClient.PriceTransformQuantity](docs/PriceTransformQuantity.md)
329
- - [FlexpriceClient.SubscriptionSubscriptionLineItem](docs/SubscriptionSubscriptionLineItem.md)
330
- - [FlexpriceClient.SubscriptionSubscriptionPause](docs/SubscriptionSubscriptionPause.md)
331
- - [FlexpriceClient.TypesAggregationType](docs/TypesAggregationType.md)
332
- - [FlexpriceClient.TypesAutoTopupTrigger](docs/TypesAutoTopupTrigger.md)
333
- - [FlexpriceClient.TypesBillingCadence](docs/TypesBillingCadence.md)
334
- - [FlexpriceClient.TypesBillingModel](docs/TypesBillingModel.md)
335
- - [FlexpriceClient.TypesBillingPeriod](docs/TypesBillingPeriod.md)
336
- - [FlexpriceClient.TypesBillingTier](docs/TypesBillingTier.md)
337
- - [FlexpriceClient.TypesEntityType](docs/TypesEntityType.md)
338
- - [FlexpriceClient.TypesFeatureType](docs/TypesFeatureType.md)
339
- - [FlexpriceClient.TypesFileType](docs/TypesFileType.md)
340
- - [FlexpriceClient.TypesInvoiceBillingReason](docs/TypesInvoiceBillingReason.md)
341
- - [FlexpriceClient.TypesInvoiceCadence](docs/TypesInvoiceCadence.md)
342
- - [FlexpriceClient.TypesInvoiceStatus](docs/TypesInvoiceStatus.md)
343
- - [FlexpriceClient.TypesInvoiceType](docs/TypesInvoiceType.md)
344
- - [FlexpriceClient.TypesPaginationResponse](docs/TypesPaginationResponse.md)
345
- - [FlexpriceClient.TypesPauseMode](docs/TypesPauseMode.md)
346
- - [FlexpriceClient.TypesPauseStatus](docs/TypesPauseStatus.md)
347
- - [FlexpriceClient.TypesPaymentDestinationType](docs/TypesPaymentDestinationType.md)
348
- - [FlexpriceClient.TypesPaymentMethodType](docs/TypesPaymentMethodType.md)
349
- - [FlexpriceClient.TypesPaymentStatus](docs/TypesPaymentStatus.md)
350
- - [FlexpriceClient.TypesPriceType](docs/TypesPriceType.md)
351
- - [FlexpriceClient.TypesResetUsage](docs/TypesResetUsage.md)
352
- - [FlexpriceClient.TypesResumeMode](docs/TypesResumeMode.md)
353
- - [FlexpriceClient.TypesSecretProvider](docs/TypesSecretProvider.md)
354
- - [FlexpriceClient.TypesSecretType](docs/TypesSecretType.md)
355
- - [FlexpriceClient.TypesStatus](docs/TypesStatus.md)
356
- - [FlexpriceClient.TypesSubscriptionStatus](docs/TypesSubscriptionStatus.md)
357
- - [FlexpriceClient.TypesTaskStatus](docs/TypesTaskStatus.md)
358
- - [FlexpriceClient.TypesTaskType](docs/TypesTaskType.md)
359
- - [FlexpriceClient.TypesTransactionReason](docs/TypesTransactionReason.md)
360
- - [FlexpriceClient.TypesTransactionStatus](docs/TypesTransactionStatus.md)
361
- - [FlexpriceClient.TypesTransactionType](docs/TypesTransactionType.md)
362
- - [FlexpriceClient.TypesWalletConfig](docs/TypesWalletConfig.md)
363
- - [FlexpriceClient.TypesWalletConfigPriceType](docs/TypesWalletConfigPriceType.md)
364
- - [FlexpriceClient.TypesWalletStatus](docs/TypesWalletStatus.md)
365
- - [FlexpriceClient.TypesWalletTxReferenceType](docs/TypesWalletTxReferenceType.md)
366
- - [FlexpriceClient.TypesWalletType](docs/TypesWalletType.md)
367
- - [FlexpriceClient.TypesWindowSize](docs/TypesWindowSize.md)
368
-
369
-
370
- ## Documentation for Authorization
371
-
372
-
373
- Authentication schemes defined for the API:
374
- ### ApiKeyAuth
375
-
376
-
377
- - **Type**: API key
378
- - **API key parameter name**: x-api-key
379
- - **Location**: HTTP header
380
-
255
+ });
256
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flexprice/sdk",
3
- "version": "0.0.1",
3
+ "version": "1.0.1",
4
4
  "description": "Official JavaScript SDK of Flexprice",
5
5
  "license": "Apache 2.0",
6
6
  "homepage": "https://flexprice.io",