Skip to content

Commit b79d2b1

Browse files
committed
Generated client from my.yoast.test
1 parent 97afd8a commit b79d2b1

27 files changed

+1143
-770
lines changed

.babelrc

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,33 @@
11
{
2-
"plugins": [
3-
["babel-plugin-transform-builtin-extend", {
4-
"globals": ["Error", "Array"]
5-
}]
2+
"presets": [
3+
"@babel/preset-env"
64
],
7-
"presets": ["env", "stage-0"]
5+
"plugins": [
6+
"@babel/plugin-syntax-dynamic-import",
7+
"@babel/plugin-syntax-import-meta",
8+
"@babel/plugin-proposal-class-properties",
9+
"@babel/plugin-proposal-json-strings",
10+
[
11+
"@babel/plugin-proposal-decorators",
12+
{
13+
"legacy": true
14+
}
15+
],
16+
"@babel/plugin-proposal-function-sent",
17+
"@babel/plugin-proposal-export-namespace-from",
18+
"@babel/plugin-proposal-numeric-separator",
19+
"@babel/plugin-proposal-throw-expressions",
20+
"@babel/plugin-proposal-export-default-from",
21+
"@babel/plugin-proposal-logical-assignment-operators",
22+
"@babel/plugin-proposal-optional-chaining",
23+
[
24+
"@babel/plugin-proposal-pipeline-operator",
25+
{
26+
"proposal": "minimal"
27+
}
28+
],
29+
"@babel/plugin-proposal-nullish-coalescing-operator",
30+
"@babel/plugin-proposal-do-expressions",
31+
"@babel/plugin-proposal-function-bind"
32+
]
833
}

.swagger-codegen/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.24
1+
3.0.26

README.md

Lines changed: 1 addition & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -71,101 +71,4 @@ Please follow the [installation](#installation) instruction and execute the foll
7171
var YoastProvisionerApiClient = require('Yoast provisioner API client');
7272
```
7373

74-
# Subscription API
75-
76-
The subscription API can be used by Yoast partners to create subscriptions in MyYoast. Subscriptions facilitate passing license checks of yoast plugins.
77-
78-
We have a Swagger document you can use to [explore the API](https://my.yoast.com/provisioning-api/#/). We can provide the credentials to view it.
79-
## Provisioner
80-
81-
A provisioner is a yoast partner allowed to create subscriptions in MyYoast.
82-
83-
We create an account for each provisioner, and with the credentials for that account, the provisioners can call the API endpoints.
84-
85-
The API uses basic auth. If you are a provisioner and do not yet have the proper credentials to call the provisioning API, please contact us.
86-
87-
## Client API
88-
89-
To assist provisioners we have used [swagger-codegen](https://swagger.io/docs/open-source-tools/swagger-codegen/) to generate clients for the API. There's:
90-
91-
- [PHP client](https://github.com/Yoast/subscription-api-php-client)
92-
- [With additional documentation](https://github.com/Yoast/subscription-api-php-client/blob/master/docs/Api/SubscriptionProvisioningApi.md)
93-
- [javascript client](https://github.com/Yoast/subscription-api-javascript-client)
94-
95-
The readme of these clients should explain how to install and use them.
96-
97-
## Subscription
98-
99-
A subscription gives a site a valid license for a plugin on the site of the customer's choice, for a set amount of time.
100-
101-
### Subscription statuses
102-
103-
There are four possible statuses a subscription can have:
104-
105-
- `active`: This subscription is active, will be set to `expired` when the end date has passed.
106-
- `pending-cancel`: The customer has manually cancelled their subscription. The subscription will not be renewed, and will be set to `cancelled` when the end date has passed.
107-
- `cancelled`: The subscription has been cancelled, and no longer provides a valid license.
108-
- `expired`: The subscription's end date has passed without renewing, and no longer provides a valid license.
109-
110-
### Creating subscriptions
111-
112-
You can use the [create endpoint](https://my.yoast.com/provisioning-api/#/Subscription%20Provisioning/post_api_provisioning_subscriptions_create) to create a new subscription.
113-
114-
When creating a subscription, you should send along the site the customer wants to connect their subscription to. A subscription acts as a valid license for its connected site.
115-
116-
If you know the first name and last name of the customer, you should send them along as well. We use the names to address our customer in communication.
117-
118-
When a subscription is created, a MyYoast account is created for the customer if they didn't have an account already. With this account, the customer can access Yoast SEO Academy and its premium content.
119-
We will then create the subscription for the customer, and return this new subscription as the response to the API call.
120-
If the customer account is new, the customer will also receive an email informing them that an account has been created for them, and that they can set a password.
121-
122-
If the subscription should give the user access to courses (such as a Yoast SEO Premium subscription), these courses can be accessed via MyYoast in the [courses tab](https://my.yoast.com/courses).
123-
124-
### Renewing subscriptions
125-
126-
You can use the [renew endpoint](https://my.yoast.com/provisioning-api/#/Subscription%20Provisioning/post_api_provisioning_subscriptions__id__renew) to renew an existing subscription.
127-
128-
Renewing a subscription extends the subscription duration. The amount of time the subscription is extended by depends on the product.
129-
Most products give access for one year. Some products give access for a month. This is or will be configured for your provisioner account.
130-
131-
Renewing a subscription sets the end date of the subscription to a new date further in the future.
132-
If the end date of a subscription is in the past, the amount of extra time is added to the date of the request instead.
133-
134-
**Cancelled subscriptions can no longer be renewed.**
135-
136-
#### Cancelling subscriptions
137-
138-
If it is known that a customer will not renew their subscription or if the customer should no longer have their subscription, the [cancel endpoint](https://my.yoast.com/provisioning-api/#/Subscription%20Provisioning/post_api_provisioning_subscriptions__id__cancel) should be used.
139-
140-
The status of that subscription will be set to `pending-cancel`. It's still a valid license until the end date passes, then it will be set to `cancelled`.
141-
142-
If the customer should lose access immediately. you can set `immediately` to `true` in the body. In this case, the subscription is set to `cancelled` immediately, regardless of the amount of time the subscription had remaining. The subscription is no longer considered a valid license when it has the `cancelled` status.
143-
144-
### Subscription expiration and cancellation.
145-
146-
If a subscription's end date has passed, that subscription is due for expiration.
147-
148-
If the subscription's status is `active`, the subscription's status will be set to `expired`, and the subscription is no longer considered a valid license. We have a CRON job in my-yoast responsible for this. This is done automatically every 30 minutes..
149-
150-
The same applies for subscriptions that are `pending-cancel`, and whose end date has passed. These subscriptions will be set to `cancelled`.
151-
152-
## License checks
153-
154-
The Yoast plugin on the site of the customer sends a request on visiting the plugin page or the premium settings page, to check whether the site has a valid license for that plugin. This request is cached.
155-
156-
A site has a valid license for a product when the site has any connected `active` or `pending-cancel` subscription in MyYoast, that grants access to that product.
157-
158-
The response of the license check will always include a download url for the latest version of the plugins the user has access to.
159-
160-
### Connecting a site to subscriptions.
161-
162-
You can connect a site to a subscription on creation of that subscription, or use the [set-site endpoint](https://my.yoast.com/provisioning-api/#/Subscription%20Provisioning/post_api_provisioning_subscriptions__id__set_site) of the API.
163-
164-
## Getting the plugin
165-
166-
After a customer gets a subscription, that customer will get access to the connected product.
167-
168-
Any plugins the customer should get access to can be downloaded. The download URLS for a subscription are always present in any response to the subscription API.
169-
170-
If the subscription should give the user access to courses (such as a subscription for the Yoast SEO Premium plugin), these courses can be accessed via MyYoast on the [courses page](https://my.yoast.com/courses).
171-
We will also send an email to the customer when the customer gets access to any of our courses. If a customer gains access to multiple courses at once, a single email is sent containing a notice of all the courses that are accessible.
74+
Documentation on how to use the subscription API, can be found [in the developer docs.](https://developer.yoast.com/customization/myyoast/apis/subscription-api)

docs/ProvisioningAccountApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# YoastProvisionerApiClient.ProvisioningAccountApi
22

3-
All URIs are relative to *http://my.yoast.test:3000/*
3+
All URIs are relative to *https://my.yoast.test:3000/*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------
@@ -16,7 +16,7 @@ This route generate a new Basic Auth token that is used for provisioner accounts
1616

1717
### Example
1818
```javascript
19-
import YoastProvisionerApiClient from 'Yoast provisioner API client';
19+
import {YoastProvisionerApiClient} from 'Yoast provisioner API client';
2020

2121
let apiInstance = new YoastProvisionerApiClient.ProvisioningAccountApi();
2222
apiInstance.apiProvisioningAccountRegenerateTokenPost((error, data, response) => {

docs/ProvisioningDownloadsApi.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# YoastProvisionerApiClient.ProvisioningDownloadsApi
22

3-
All URIs are relative to *http://my.yoast.test:3000/*
3+
All URIs are relative to *https://my.yoast.test:3000/*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------
@@ -17,7 +17,7 @@ This route returns the latest version of the product that is offered to the cust
1717

1818
### Example
1919
```javascript
20-
import YoastProvisionerApiClient from 'Yoast provisioner API client';
20+
import {YoastProvisionerApiClient} from 'Yoast provisioner API client';
2121

2222
let apiInstance = new YoastProvisionerApiClient.ProvisioningDownloadsApi();
2323
let productCode = "productCode_example"; // String | The code used to create the product.
@@ -52,15 +52,15 @@ No authorization required
5252

5353
<a name="apiProvisioningDownloadsCurrentZipGet"></a>
5454
# **apiProvisioningDownloadsCurrentZipGet**
55-
> &#x27;String&#x27; apiProvisioningDownloadsCurrentZipGet(productCode)
55+
> apiProvisioningDownloadsCurrentZipGet(productCode)
5656
5757
Redirect to the current zip for the productCode.
5858

5959
If a new version is available, you can use this route to redirect to the zip of that new version of the product.
6060

6161
### Example
6262
```javascript
63-
import YoastProvisionerApiClient from 'Yoast provisioner API client';
63+
import {YoastProvisionerApiClient} from 'Yoast provisioner API client';
6464

6565
let apiInstance = new YoastProvisionerApiClient.ProvisioningDownloadsApi();
6666
let productCode = "productCode_example"; // String | The code used to create the product.
@@ -69,7 +69,7 @@ apiInstance.apiProvisioningDownloadsCurrentZipGet(productCode, (error, data, res
6969
if (error) {
7070
console.error(error);
7171
} else {
72-
console.log('API called successfully. Returned data: ' + data);
72+
console.log('API called successfully.');
7373
}
7474
});
7575
```
@@ -82,7 +82,7 @@ Name | Type | Description | Notes
8282

8383
### Return type
8484

85-
**&#x27;String&#x27;**
85+
null (empty response body)
8686

8787
### Authorization
8888

@@ -91,5 +91,5 @@ No authorization required
9191
### HTTP request headers
9292

9393
- **Content-Type**: Not defined
94-
- **Accept**: application/json
94+
- **Accept**: Not defined
9595

docs/ProvisioningUsersApi.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# YoastProvisionerApiClient.ProvisioningUsersApi
2+
3+
All URIs are relative to *https://my.yoast.test:3000/*
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**apiProvisioningUserScheduleDeletePost**](ProvisioningUsersApi.md#apiProvisioningUserScheduleDeletePost) | **POST** /api/provisioning/user/schedule-delete | Schedule a delete for a subscription
8+
9+
<a name="apiProvisioningUserScheduleDeletePost"></a>
10+
# **apiProvisioningUserScheduleDeletePost**
11+
> SubscriptionProvisioningResponseDto apiProvisioningUserScheduleDeletePost(body)
12+
13+
Schedule a delete for a subscription
14+
15+
Schedules a customer for gdpr delete.
16+
17+
### Example
18+
```javascript
19+
import {YoastProvisionerApiClient} from 'Yoast provisioner API client';
20+
21+
let apiInstance = new YoastProvisionerApiClient.ProvisioningUsersApi();
22+
let body = new YoastProvisionerApiClient.ScheduleDeleteUserDto(); // ScheduleDeleteUserDto |
23+
24+
apiInstance.apiProvisioningUserScheduleDeletePost(body, (error, data, response) => {
25+
if (error) {
26+
console.error(error);
27+
} else {
28+
console.log('API called successfully. Returned data: ' + data);
29+
}
30+
});
31+
```
32+
33+
### Parameters
34+
35+
Name | Type | Description | Notes
36+
------------- | ------------- | ------------- | -------------
37+
**body** | [**ScheduleDeleteUserDto**](ScheduleDeleteUserDto.md)| |
38+
39+
### Return type
40+
41+
[**SubscriptionProvisioningResponseDto**](SubscriptionProvisioningResponseDto.md)
42+
43+
### Authorization
44+
45+
No authorization required
46+
47+
### HTTP request headers
48+
49+
- **Content-Type**: application/json
50+
- **Accept**: application/json
51+

0 commit comments

Comments
 (0)