license_manager 0.3.1 → 0.3.2

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: 68a828b5a78c2e840be0a77b50d429b1e59e88714cbbe50436934eaffaf73435
4
- data.tar.gz: 41bee49be6e3419467fc60612ed97e70c6888d579882a2422a9835ca75b87719
3
+ metadata.gz: 20647dd29895350d4dadc4bab710756eb748a814c67e08a7c8a9e0661b472caa
4
+ data.tar.gz: '004191f59667807fb23c21aaf7548ca7fa6c821254603a285fb51bde85d511ab'
5
5
  SHA512:
6
- metadata.gz: 0b825e5dbe10c69b2ffbf8961e8d060a467612d1c12ccbcf23e078d9403ee5306bd388121fdebdb0c3d309c3adbc470c86c0183c4c62a2352078df2c83349648
7
- data.tar.gz: f077da231328da5cb860b63972bd9508ef959373ff91d4cc83a77cbc626fdc8bdfe4a56b1978729bf5366384a08c53647059e0a9bb6b429102352eb8f2ffc960
6
+ metadata.gz: 446e1c8285486571af235bdd1f162ba2d8fd2b44788051b019249f5b2e0c75a78146a107c2182d76eb01db4cf4b4147748e6a642740b53f9e0673158702ccb20
7
+ data.tar.gz: '093cdc1dee0f7f4dbdcf7039996b9a9ae76377dd347df40f6315114d35d84544aba352e2d7d15e3442ed7012c61ba3f025d1f15ef3aad3cdabd44025a300f303'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.2 (2026-11-05)
4
+
5
+ ### Changes
6
+
7
+ - `GET /v1/products/{productId}/integrations/slack`: endpoint added
8
+ - `POST /v1/products/{productId}/integrations/slack/authorize`: endpoint added
9
+ - `DELETE /v1/slack-connections/{id}`: endpoint added
10
+ - `PATCH /v1/slack-connections/{id}`: endpoint added
11
+ - `POST /v1/slack-connections/{id}/test`: endpoint added
12
+
3
13
  ## 0.3.1 (2026-11-04)
4
14
 
5
15
  ### Changes
data/README.md CHANGED
@@ -85,7 +85,7 @@ Every method is documented, with its parameters and responses, in the [`docs`](d
85
85
  | [`ReleasesApi`](docs/ReleasesApi.md) | `list_releases`, `create_release`, `get_release`, `delete_release`, `update_release` |
86
86
  | [`TokensApi`](docs/TokensApi.md) | `create_customer_token`, `create_license_token`, `create_machine_token` |
87
87
  | [`EventsApi`](docs/EventsApi.md) | `list_policy_events`, `list_license_events` |
88
- | [`IntegrationsApi`](docs/IntegrationsApi.md) | `get_stripe_integration`, `connect_stripe`, `disconnect_integration`, `update_integration`, `check_integration`, `list_stripe_prices`, `create_stripe_mapping`, `delete_stripe_mapping`, `update_stripe_mapping` |
88
+ | [`IntegrationsApi`](docs/IntegrationsApi.md) | `get_stripe_integration`, `connect_stripe`, `disconnect_integration`, `update_integration`, `check_integration`, `list_stripe_prices`, `create_stripe_mapping`, `delete_stripe_mapping`, `update_stripe_mapping`, `get_slack_integration`, `authorize_slack`, `delete_slack_connection`, `update_slack_connection`, `test_slack_connection` |
89
89
 
90
90
  ## Versioning
91
91
 
@@ -4,17 +4,93 @@ All URIs are relative to *https://api.licensemanager.dev*
4
4
 
5
5
  | Method | HTTP request | Description |
6
6
  | ------ | ------------ | ----------- |
7
+ | [**authorize_slack**](IntegrationsApi.md#authorize_slack) | **POST** /v1/products/{productId}/integrations/slack/authorize | Start connecting a Slack channel |
7
8
  | [**check_integration**](IntegrationsApi.md#check_integration) | **POST** /v1/integrations/{id}/check | Check an integration |
8
9
  | [**connect_stripe**](IntegrationsApi.md#connect_stripe) | **PUT** /v1/products/{productId}/integrations/stripe | Connect Stripe |
9
10
  | [**create_stripe_mapping**](IntegrationsApi.md#create_stripe_mapping) | **POST** /v1/products/{productId}/integrations/stripe/mappings | Map a Stripe price to a policy |
11
+ | [**delete_slack_connection**](IntegrationsApi.md#delete_slack_connection) | **DELETE** /v1/slack-connections/{id} | Remove a Slack connection |
10
12
  | [**delete_stripe_mapping**](IntegrationsApi.md#delete_stripe_mapping) | **DELETE** /v1/integration-mappings/{id} | Delete a mapping |
11
13
  | [**disconnect_integration**](IntegrationsApi.md#disconnect_integration) | **DELETE** /v1/integrations/{id} | Disconnect an integration |
14
+ | [**get_slack_integration**](IntegrationsApi.md#get_slack_integration) | **GET** /v1/products/{productId}/integrations/slack | Get the Slack integration of a product |
12
15
  | [**get_stripe_integration**](IntegrationsApi.md#get_stripe_integration) | **GET** /v1/products/{productId}/integrations/stripe | Get the Stripe integration of a product |
13
16
  | [**list_stripe_prices**](IntegrationsApi.md#list_stripe_prices) | **GET** /v1/integrations/{id}/stripe/prices | List the Stripe prices of an integration |
17
+ | [**test_slack_connection**](IntegrationsApi.md#test_slack_connection) | **POST** /v1/slack-connections/{id}/test | Send a test message to a Slack channel |
14
18
  | [**update_integration**](IntegrationsApi.md#update_integration) | **PATCH** /v1/integrations/{id} | Update an integration |
19
+ | [**update_slack_connection**](IntegrationsApi.md#update_slack_connection) | **PATCH** /v1/slack-connections/{id} | Update a Slack connection |
15
20
  | [**update_stripe_mapping**](IntegrationsApi.md#update_stripe_mapping) | **PATCH** /v1/integration-mappings/{id} | Change the policy of a mapping |
16
21
 
17
22
 
23
+ ## authorize_slack
24
+
25
+ > <SlackAuthorize> authorize_slack(product_id)
26
+
27
+ Start connecting a Slack channel
28
+
29
+ Returns the URL of Slack's consent screen, where the user picks the channel getting the product's notifications. Slack then redirects to the app's integrations page. Doesn't accept tokens: only API keys and sessions. **Required role permission**: `integration:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
30
+
31
+ ### Examples
32
+
33
+ ```ruby
34
+ require 'time'
35
+ require 'license_manager'
36
+ # setup authorization
37
+ LicenseManager.configure do |config|
38
+ # Configure API key authorization: apiKey
39
+ config.api_key['x-api-key'] = 'YOUR API KEY'
40
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
41
+ # config.api_key_prefix['x-api-key'] = 'Bearer'
42
+ end
43
+
44
+ api_instance = LicenseManager::IntegrationsApi.new
45
+ product_id = 'x7Kp2QaZ' # String |
46
+
47
+ begin
48
+ # Start connecting a Slack channel
49
+ result = api_instance.authorize_slack(product_id)
50
+ p result
51
+ rescue LicenseManager::ApiError => e
52
+ puts "Error when calling IntegrationsApi->authorize_slack: #{e}"
53
+ end
54
+ ```
55
+
56
+ #### Using the authorize_slack_with_http_info variant
57
+
58
+ This returns an Array which contains the response data, status code and headers.
59
+
60
+ > <Array(<SlackAuthorize>, Integer, Hash)> authorize_slack_with_http_info(product_id)
61
+
62
+ ```ruby
63
+ begin
64
+ # Start connecting a Slack channel
65
+ data, status_code, headers = api_instance.authorize_slack_with_http_info(product_id)
66
+ p status_code # => 2xx
67
+ p headers # => { ... }
68
+ p data # => <SlackAuthorize>
69
+ rescue LicenseManager::ApiError => e
70
+ puts "Error when calling IntegrationsApi->authorize_slack_with_http_info: #{e}"
71
+ end
72
+ ```
73
+
74
+ ### Parameters
75
+
76
+ | Name | Type | Description | Notes |
77
+ | ---- | ---- | ----------- | ----- |
78
+ | **product_id** | **String** | | |
79
+
80
+ ### Return type
81
+
82
+ [**SlackAuthorize**](SlackAuthorize.md)
83
+
84
+ ### Authorization
85
+
86
+ [apiKey](../README.md#apiKey)
87
+
88
+ ### HTTP request headers
89
+
90
+ - **Content-Type**: Not defined
91
+ - **Accept**: application/json
92
+
93
+
18
94
  ## check_integration
19
95
 
20
96
  > <Integration> check_integration(id)
@@ -232,6 +308,76 @@ end
232
308
  - **Accept**: application/json
233
309
 
234
310
 
311
+ ## delete_slack_connection
312
+
313
+ > delete_slack_connection(id)
314
+
315
+ Remove a Slack connection
316
+
317
+ Stops posting to the channel and revokes the installation's token in Slack. Doesn't accept tokens: only API keys and sessions. **Required role permission**: `integration:delete` when called with a session, granted by the member's role. API keys aren't limited by roles.
318
+
319
+ ### Examples
320
+
321
+ ```ruby
322
+ require 'time'
323
+ require 'license_manager'
324
+ # setup authorization
325
+ LicenseManager.configure do |config|
326
+ # Configure API key authorization: apiKey
327
+ config.api_key['x-api-key'] = 'YOUR API KEY'
328
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
329
+ # config.api_key_prefix['x-api-key'] = 'Bearer'
330
+ end
331
+
332
+ api_instance = LicenseManager::IntegrationsApi.new
333
+ id = 's4Hq8ZpLm' # String |
334
+
335
+ begin
336
+ # Remove a Slack connection
337
+ api_instance.delete_slack_connection(id)
338
+ rescue LicenseManager::ApiError => e
339
+ puts "Error when calling IntegrationsApi->delete_slack_connection: #{e}"
340
+ end
341
+ ```
342
+
343
+ #### Using the delete_slack_connection_with_http_info variant
344
+
345
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
346
+
347
+ > <Array(nil, Integer, Hash)> delete_slack_connection_with_http_info(id)
348
+
349
+ ```ruby
350
+ begin
351
+ # Remove a Slack connection
352
+ data, status_code, headers = api_instance.delete_slack_connection_with_http_info(id)
353
+ p status_code # => 2xx
354
+ p headers # => { ... }
355
+ p data # => nil
356
+ rescue LicenseManager::ApiError => e
357
+ puts "Error when calling IntegrationsApi->delete_slack_connection_with_http_info: #{e}"
358
+ end
359
+ ```
360
+
361
+ ### Parameters
362
+
363
+ | Name | Type | Description | Notes |
364
+ | ---- | ---- | ----------- | ----- |
365
+ | **id** | **String** | | |
366
+
367
+ ### Return type
368
+
369
+ nil (empty response body)
370
+
371
+ ### Authorization
372
+
373
+ [apiKey](../README.md#apiKey)
374
+
375
+ ### HTTP request headers
376
+
377
+ - **Content-Type**: Not defined
378
+ - **Accept**: application/json
379
+
380
+
235
381
  ## delete_stripe_mapping
236
382
 
237
383
  > delete_stripe_mapping(id)
@@ -372,6 +518,77 @@ nil (empty response body)
372
518
  - **Accept**: application/json
373
519
 
374
520
 
521
+ ## get_slack_integration
522
+
523
+ > <SlackIntegration> get_slack_integration(product_id)
524
+
525
+ Get the Slack integration of a product
526
+
527
+ Slack channels getting notifications about the product's licenses: purchases, renewals, failed payments and cancellations. Doesn't accept tokens: only API keys and sessions.
528
+
529
+ ### Examples
530
+
531
+ ```ruby
532
+ require 'time'
533
+ require 'license_manager'
534
+ # setup authorization
535
+ LicenseManager.configure do |config|
536
+ # Configure API key authorization: apiKey
537
+ config.api_key['x-api-key'] = 'YOUR API KEY'
538
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
539
+ # config.api_key_prefix['x-api-key'] = 'Bearer'
540
+ end
541
+
542
+ api_instance = LicenseManager::IntegrationsApi.new
543
+ product_id = 'x7Kp2QaZ' # String |
544
+
545
+ begin
546
+ # Get the Slack integration of a product
547
+ result = api_instance.get_slack_integration(product_id)
548
+ p result
549
+ rescue LicenseManager::ApiError => e
550
+ puts "Error when calling IntegrationsApi->get_slack_integration: #{e}"
551
+ end
552
+ ```
553
+
554
+ #### Using the get_slack_integration_with_http_info variant
555
+
556
+ This returns an Array which contains the response data, status code and headers.
557
+
558
+ > <Array(<SlackIntegration>, Integer, Hash)> get_slack_integration_with_http_info(product_id)
559
+
560
+ ```ruby
561
+ begin
562
+ # Get the Slack integration of a product
563
+ data, status_code, headers = api_instance.get_slack_integration_with_http_info(product_id)
564
+ p status_code # => 2xx
565
+ p headers # => { ... }
566
+ p data # => <SlackIntegration>
567
+ rescue LicenseManager::ApiError => e
568
+ puts "Error when calling IntegrationsApi->get_slack_integration_with_http_info: #{e}"
569
+ end
570
+ ```
571
+
572
+ ### Parameters
573
+
574
+ | Name | Type | Description | Notes |
575
+ | ---- | ---- | ----------- | ----- |
576
+ | **product_id** | **String** | | |
577
+
578
+ ### Return type
579
+
580
+ [**SlackIntegration**](SlackIntegration.md)
581
+
582
+ ### Authorization
583
+
584
+ [apiKey](../README.md#apiKey)
585
+
586
+ ### HTTP request headers
587
+
588
+ - **Content-Type**: Not defined
589
+ - **Accept**: application/json
590
+
591
+
375
592
  ## get_stripe_integration
376
593
 
377
594
  > <StripeIntegration> get_stripe_integration(product_id)
@@ -514,6 +731,77 @@ end
514
731
  - **Accept**: application/json
515
732
 
516
733
 
734
+ ## test_slack_connection
735
+
736
+ > <SlackConnection> test_slack_connection(id)
737
+
738
+ Send a test message to a Slack channel
739
+
740
+ Posts a message to the channel, to check it gets the notifications. Marks the connection `revoked` when Slack says it won't work again. Doesn't accept tokens: only API keys and sessions. **Required role permission**: `integration:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
741
+
742
+ ### Examples
743
+
744
+ ```ruby
745
+ require 'time'
746
+ require 'license_manager'
747
+ # setup authorization
748
+ LicenseManager.configure do |config|
749
+ # Configure API key authorization: apiKey
750
+ config.api_key['x-api-key'] = 'YOUR API KEY'
751
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
752
+ # config.api_key_prefix['x-api-key'] = 'Bearer'
753
+ end
754
+
755
+ api_instance = LicenseManager::IntegrationsApi.new
756
+ id = 's4Hq8ZpLm' # String |
757
+
758
+ begin
759
+ # Send a test message to a Slack channel
760
+ result = api_instance.test_slack_connection(id)
761
+ p result
762
+ rescue LicenseManager::ApiError => e
763
+ puts "Error when calling IntegrationsApi->test_slack_connection: #{e}"
764
+ end
765
+ ```
766
+
767
+ #### Using the test_slack_connection_with_http_info variant
768
+
769
+ This returns an Array which contains the response data, status code and headers.
770
+
771
+ > <Array(<SlackConnection>, Integer, Hash)> test_slack_connection_with_http_info(id)
772
+
773
+ ```ruby
774
+ begin
775
+ # Send a test message to a Slack channel
776
+ data, status_code, headers = api_instance.test_slack_connection_with_http_info(id)
777
+ p status_code # => 2xx
778
+ p headers # => { ... }
779
+ p data # => <SlackConnection>
780
+ rescue LicenseManager::ApiError => e
781
+ puts "Error when calling IntegrationsApi->test_slack_connection_with_http_info: #{e}"
782
+ end
783
+ ```
784
+
785
+ ### Parameters
786
+
787
+ | Name | Type | Description | Notes |
788
+ | ---- | ---- | ----------- | ----- |
789
+ | **id** | **String** | | |
790
+
791
+ ### Return type
792
+
793
+ [**SlackConnection**](SlackConnection.md)
794
+
795
+ ### Authorization
796
+
797
+ [apiKey](../README.md#apiKey)
798
+
799
+ ### HTTP request headers
800
+
801
+ - **Content-Type**: Not defined
802
+ - **Accept**: application/json
803
+
804
+
517
805
  ## update_integration
518
806
 
519
807
  > <Integration> update_integration(id, update_integration)
@@ -587,6 +875,79 @@ end
587
875
  - **Accept**: application/json
588
876
 
589
877
 
878
+ ## update_slack_connection
879
+
880
+ > <SlackConnection> update_slack_connection(id, update_slack_connection)
881
+
882
+ Update a Slack connection
883
+
884
+ Changes the notifications the channel gets. Doesn't accept tokens: only API keys and sessions. **Required role permission**: `integration:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
885
+
886
+ ### Examples
887
+
888
+ ```ruby
889
+ require 'time'
890
+ require 'license_manager'
891
+ # setup authorization
892
+ LicenseManager.configure do |config|
893
+ # Configure API key authorization: apiKey
894
+ config.api_key['x-api-key'] = 'YOUR API KEY'
895
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
896
+ # config.api_key_prefix['x-api-key'] = 'Bearer'
897
+ end
898
+
899
+ api_instance = LicenseManager::IntegrationsApi.new
900
+ id = 's4Hq8ZpLm' # String |
901
+ update_slack_connection = LicenseManager::UpdateSlackConnection.new({events: [purchased, canceled]}) # UpdateSlackConnection |
902
+
903
+ begin
904
+ # Update a Slack connection
905
+ result = api_instance.update_slack_connection(id, update_slack_connection)
906
+ p result
907
+ rescue LicenseManager::ApiError => e
908
+ puts "Error when calling IntegrationsApi->update_slack_connection: #{e}"
909
+ end
910
+ ```
911
+
912
+ #### Using the update_slack_connection_with_http_info variant
913
+
914
+ This returns an Array which contains the response data, status code and headers.
915
+
916
+ > <Array(<SlackConnection>, Integer, Hash)> update_slack_connection_with_http_info(id, update_slack_connection)
917
+
918
+ ```ruby
919
+ begin
920
+ # Update a Slack connection
921
+ data, status_code, headers = api_instance.update_slack_connection_with_http_info(id, update_slack_connection)
922
+ p status_code # => 2xx
923
+ p headers # => { ... }
924
+ p data # => <SlackConnection>
925
+ rescue LicenseManager::ApiError => e
926
+ puts "Error when calling IntegrationsApi->update_slack_connection_with_http_info: #{e}"
927
+ end
928
+ ```
929
+
930
+ ### Parameters
931
+
932
+ | Name | Type | Description | Notes |
933
+ | ---- | ---- | ----------- | ----- |
934
+ | **id** | **String** | | |
935
+ | **update_slack_connection** | [**UpdateSlackConnection**](UpdateSlackConnection.md) | | |
936
+
937
+ ### Return type
938
+
939
+ [**SlackConnection**](SlackConnection.md)
940
+
941
+ ### Authorization
942
+
943
+ [apiKey](../README.md#apiKey)
944
+
945
+ ### HTTP request headers
946
+
947
+ - **Content-Type**: application/json
948
+ - **Accept**: application/json
949
+
950
+
590
951
  ## update_stripe_mapping
591
952
 
592
953
  > <IntegrationMapping> update_stripe_mapping(id, update_integration_mapping)
@@ -0,0 +1,18 @@
1
+ # LicenseManager::SlackAuthorize
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **url** | **String** | Slack&#39;s consent screen: open it in the browser to pick the channel. Valid 10 minutes. | |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'license_manager'
13
+
14
+ instance = LicenseManager::SlackAuthorize.new(
15
+ url: https://slack.com/oauth/v2/authorize?client_id&#x3D;…
16
+ )
17
+ ```
18
+
@@ -0,0 +1,38 @@
1
+ # LicenseManager::SlackConnection
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | | |
8
+ | **team_id** | **String** | | |
9
+ | **team_name** | **String** | | |
10
+ | **channel_id** | **String** | | |
11
+ | **channel_name** | **String** | Name of the channel when it was connected, with its &#x60;#&#x60;. | |
12
+ | **configuration_url** | **String** | Page of the installation in Slack. | |
13
+ | **events** | **Array&lt;String&gt;** | Notifications the channel gets: &#x60;purchased&#x60; (a license bought through Stripe), &#x60;renewed&#x60; (a subscription renewal paid), &#x60;payment_failed&#x60; (a subscription payment failed) and &#x60;canceled&#x60; (a license canceled, or its subscription ended). | |
14
+ | **status** | **String** | &#x60;revoked&#x60; once Slack refuses the messages, like when the app was removed from the workspace or the channel deleted: remove it and add it again. | |
15
+ | **status_reason** | **String** | | |
16
+ | **last_sent_at** | **Time** | | |
17
+ | **created_at** | **Time** | | |
18
+
19
+ ## Example
20
+
21
+ ```ruby
22
+ require 'license_manager'
23
+
24
+ instance = LicenseManager::SlackConnection.new(
25
+ id: s4Hq8ZpLm,
26
+ team_id: T0123ABCD,
27
+ team_name: Acme,
28
+ channel_id: C0456EFGH,
29
+ channel_name: #sales,
30
+ configuration_url: null,
31
+ events: null,
32
+ status: null,
33
+ status_reason: null,
34
+ last_sent_at: null,
35
+ created_at: null
36
+ )
37
+ ```
38
+
@@ -0,0 +1,20 @@
1
+ # LicenseManager::SlackIntegration
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **configured** | **Boolean** | Whether the server has a Slack app to connect channels with: &#x60;SLACK_CLIENT_ID&#x60; and &#x60;SLACK_CLIENT_SECRET&#x60; are set. | |
8
+ | **connections** | [**Array&lt;SlackConnection&gt;**](SlackConnection.md) | Slack channels getting the product&#39;s notifications. | |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'license_manager'
14
+
15
+ instance = LicenseManager::SlackIntegration.new(
16
+ configured: null,
17
+ connections: null
18
+ )
19
+ ```
20
+
@@ -0,0 +1,18 @@
1
+ # LicenseManager::UpdateSlackConnection
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **events** | **Array&lt;String&gt;** | Notifications the channel gets. | |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'license_manager'
13
+
14
+ instance = LicenseManager::UpdateSlackConnection.new(
15
+ events: [purchased, canceled]
16
+ )
17
+ ```
18
+