netlify-api 0.1.3 → 0.1.4

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.
@@ -1,10 +1,10 @@
1
1
 
2
- > netlify-api@0.1.3 build /home/runner/work/openapi-clients/openapi-clients/packages/netlify-api
2
+ > netlify-api@0.1.4 build /home/runner/work/openapi-clients/openapi-clients/packages/netlify-api
3
3
  > rimraf dist && rollup -c
4
4
 
5
5
  
6
6
  ./src/index.ts → dist/index.cjs, dist/index.mjs...
7
- created dist/index.cjs, dist/index.mjs in 5.3s
7
+ created dist/index.cjs, dist/index.mjs in 8s
8
8
  
9
9
  ./src/index.ts → dist/index.d.ts...
10
- created dist/index.d.ts in 5s
10
+ created dist/index.d.ts in 7.4s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # netlify-api
2
2
 
3
+ ## 0.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 32af887: Update return type for refresh token
8
+
3
9
  ## 0.1.3
4
10
 
5
11
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -802,16 +802,26 @@ class NetlifyApi {
802
802
  get auth() {
803
803
  return {
804
804
  refreshToken: async ({ refreshToken, authToken, clientId, clientSecret }) => {
805
- return await __classPrivateFieldGet(this, _NetlifyApi_fetch, "f").call(this, `${baseUrl}/oauth/token`, {
805
+ const result = await fetch$1({
806
806
  method: 'POST',
807
- headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${authToken}` },
808
- body: JSON.stringify({
807
+ url: '/oauth/token',
808
+ body: {
809
809
  grant_type: 'refresh_token',
810
810
  refresh_token: refreshToken,
811
811
  client_id: clientId,
812
812
  client_secret: clientSecret
813
- })
813
+ },
814
+ token: authToken || __classPrivateFieldGet(this, _NetlifyApi_token, "f"),
815
+ fetchImpl: __classPrivateFieldGet(this, _NetlifyApi_fetch, "f"),
816
+ basePath: ''
814
817
  });
818
+ return {
819
+ tokenType: result.token_type,
820
+ accessToken: result.access_token,
821
+ refreshToken: result.refresh_token,
822
+ scope: result.scope,
823
+ createdAt: result.created_at
824
+ };
815
825
  }
816
826
  };
817
827
  }
package/dist/index.d.ts CHANGED
@@ -7338,7 +7338,7 @@ declare class NetlifyApi {
7338
7338
  constructor(options: NetlifyApiOptions);
7339
7339
  get api(): ApiProxy;
7340
7340
  get auth(): {
7341
- refreshToken: ({ refreshToken, authToken, clientId, clientSecret }: RefreshTokenOptions) => Promise<Response>;
7341
+ refreshToken: ({ refreshToken, authToken, clientId, clientSecret }: RefreshTokenOptions) => Promise<RefreshTokenResult>;
7342
7342
  };
7343
7343
  request<Endpoint extends keyof typeof operationsByPath>(endpoint: Endpoint, params: RequestEndpointParams<Endpoint>): Promise<ReturnType<{
7344
7344
  'GET /sites': (variables: ListSitesVariables, signal?: AbortSignal | undefined) => Promise<ListSitesResponse>;
@@ -7465,10 +7465,17 @@ declare class NetlifyApi {
7465
7465
  }
7466
7466
  type RefreshTokenOptions = {
7467
7467
  refreshToken: string;
7468
- authToken: string;
7468
+ authToken?: string;
7469
7469
  clientId: string;
7470
7470
  clientSecret: string;
7471
7471
  };
7472
+ type RefreshTokenResult = {
7473
+ tokenType: string;
7474
+ accessToken: string;
7475
+ refreshToken: string;
7476
+ scope: string;
7477
+ createdAt: number;
7478
+ };
7472
7479
 
7473
7480
  /**
7474
7481
  * Generated by @openapi-codegen
package/dist/index.mjs CHANGED
@@ -800,16 +800,26 @@ class NetlifyApi {
800
800
  get auth() {
801
801
  return {
802
802
  refreshToken: async ({ refreshToken, authToken, clientId, clientSecret }) => {
803
- return await __classPrivateFieldGet(this, _NetlifyApi_fetch, "f").call(this, `${baseUrl}/oauth/token`, {
803
+ const result = await fetch$1({
804
804
  method: 'POST',
805
- headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${authToken}` },
806
- body: JSON.stringify({
805
+ url: '/oauth/token',
806
+ body: {
807
807
  grant_type: 'refresh_token',
808
808
  refresh_token: refreshToken,
809
809
  client_id: clientId,
810
810
  client_secret: clientSecret
811
- })
811
+ },
812
+ token: authToken || __classPrivateFieldGet(this, _NetlifyApi_token, "f"),
813
+ fetchImpl: __classPrivateFieldGet(this, _NetlifyApi_fetch, "f"),
814
+ basePath: ''
812
815
  });
816
+ return {
817
+ tokenType: result.token_type,
818
+ accessToken: result.access_token,
819
+ refreshToken: result.refresh_token,
820
+ scope: result.scope,
821
+ createdAt: result.created_at
822
+ };
813
823
  }
814
824
  };
815
825
  }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "netlify-api",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Netlify API client for Node.js",
5
5
  "author": "SferaDev",
6
6
  "license": "ISC",
7
7
  "bugs": {
8
- "url": "https://github.com/SferaDev/vercel-api/issues"
8
+ "url": "https://github.com/SferaDev/openapi-clients/issues"
9
9
  },
10
- "homepage": "https://github.com/SferaDev/vercel-api#readme",
10
+ "homepage": "https://github.com/SferaDev/openapi-clients#readme",
11
11
  "main": "dist/index.cjs",
12
12
  "module": "dist/index.mjs",
13
13
  "typings": "dist/index.d.ts",
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "repository": {
19
19
  "type": "git",
20
- "url": "git+https://github.com/SferaDev/vercel-api.git"
20
+ "url": "git+https://github.com/SferaDev/openapi-clients.git"
21
21
  },
22
22
  "scripts": {
23
23
  "tsc": "tsc --noEmit",