netlify-api 0.1.3 → 0.1.5
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.
- package/.turbo/turbo-build.log +3 -3
- package/CHANGELOG.md +12 -0
- package/dist/index.cjs +14 -4
- package/dist/index.d.ts +40 -11
- package/dist/index.mjs +14 -4
- package/package.json +4 -4
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
> netlify-api@0.1.
|
|
2
|
+
> netlify-api@0.1.5 build /home/runner/work/openapi-clients/openapi-clients/packages/netlify-api
|
|
3
3
|
> rimraf dist && rollup -c
|
|
4
4
|
|
|
5
5
|
[36m
|
|
6
6
|
[1m./src/index.ts[22m → [1mdist/index.cjs, dist/index.mjs[22m...[39m
|
|
7
|
-
[32mcreated [1mdist/index.cjs, dist/index.mjs[22m in [
|
|
7
|
+
[32mcreated [1mdist/index.cjs, dist/index.mjs[22m in [1m7.2s[22m[39m
|
|
8
8
|
[36m
|
|
9
9
|
[1m./src/index.ts[22m → [1mdist/index.d.ts[22m...[39m
|
|
10
|
-
[32mcreated [1mdist/index.d.ts[22m in [
|
|
10
|
+
[32mcreated [1mdist/index.d.ts[22m in [1m7.6s[22m[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# netlify-api
|
|
2
2
|
|
|
3
|
+
## 0.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- bd49651: Add `branch_deploy_custom_domain` and `deploy_preview_custom_domain`
|
|
8
|
+
|
|
9
|
+
## 0.1.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 32af887: Update return type for refresh token
|
|
14
|
+
|
|
3
15
|
## 0.1.3
|
|
4
16
|
|
|
5
17
|
### 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
|
-
|
|
805
|
+
const result = await fetch$1({
|
|
806
806
|
method: 'POST',
|
|
807
|
-
|
|
808
|
-
body:
|
|
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
|
@@ -29,7 +29,7 @@ type ErrorWrapper<TError> = TError | {
|
|
|
29
29
|
/**
|
|
30
30
|
* Generated by @openapi-codegen
|
|
31
31
|
*
|
|
32
|
-
* @version 2.
|
|
32
|
+
* @version 2.16.0
|
|
33
33
|
*/
|
|
34
34
|
type CreateSiteDeployDeploy = {
|
|
35
35
|
files?: Record<string, any>;
|
|
@@ -82,6 +82,10 @@ type CreateSiteSnippetSnippet = {
|
|
|
82
82
|
* @format binary
|
|
83
83
|
*/
|
|
84
84
|
type UploadDeployFileFileBody = Blob;
|
|
85
|
+
type CreateSiteBuildHookBuildhook = {
|
|
86
|
+
title?: string;
|
|
87
|
+
branch?: string;
|
|
88
|
+
};
|
|
85
89
|
type CreateSiteSite = {
|
|
86
90
|
id?: string;
|
|
87
91
|
state?: string;
|
|
@@ -89,6 +93,8 @@ type CreateSiteSite = {
|
|
|
89
93
|
name?: string;
|
|
90
94
|
custom_domain?: string;
|
|
91
95
|
domain_aliases?: string[];
|
|
96
|
+
branch_deploy_custom_domain?: string;
|
|
97
|
+
deploy_preview_custom_domain?: string;
|
|
92
98
|
password?: string;
|
|
93
99
|
notification_email?: string;
|
|
94
100
|
url?: string;
|
|
@@ -225,10 +231,6 @@ type CreateSiteSite = {
|
|
|
225
231
|
stop_builds?: boolean;
|
|
226
232
|
};
|
|
227
233
|
};
|
|
228
|
-
type CreateSiteBuildHookBuildhook = {
|
|
229
|
-
title?: string;
|
|
230
|
-
branch?: string;
|
|
231
|
-
};
|
|
232
234
|
type CreateSplitTestBranchTests = {
|
|
233
235
|
branch_tests?: Record<string, any>;
|
|
234
236
|
};
|
|
@@ -261,7 +263,7 @@ type ServerErrorStatus = Exclude<ComputeRange<600>[number], ComputeRange<500>[nu
|
|
|
261
263
|
/**
|
|
262
264
|
* Generated by @openapi-codegen
|
|
263
265
|
*
|
|
264
|
-
* @version 2.
|
|
266
|
+
* @version 2.16.0
|
|
265
267
|
*/
|
|
266
268
|
|
|
267
269
|
type ListSitesQueryParams = {
|
|
@@ -293,6 +295,8 @@ type ListSitesResponse = {
|
|
|
293
295
|
name?: string;
|
|
294
296
|
custom_domain?: string;
|
|
295
297
|
domain_aliases?: string[];
|
|
298
|
+
branch_deploy_custom_domain?: string;
|
|
299
|
+
deploy_preview_custom_domain?: string;
|
|
296
300
|
password?: string;
|
|
297
301
|
notification_email?: string;
|
|
298
302
|
url?: string;
|
|
@@ -437,6 +441,8 @@ type CreateSiteResponse = {
|
|
|
437
441
|
name?: string;
|
|
438
442
|
custom_domain?: string;
|
|
439
443
|
domain_aliases?: string[];
|
|
444
|
+
branch_deploy_custom_domain?: string;
|
|
445
|
+
deploy_preview_custom_domain?: string;
|
|
440
446
|
password?: string;
|
|
441
447
|
notification_email?: string;
|
|
442
448
|
url?: string;
|
|
@@ -582,6 +588,8 @@ type GetSiteResponse = {
|
|
|
582
588
|
name?: string;
|
|
583
589
|
custom_domain?: string;
|
|
584
590
|
domain_aliases?: string[];
|
|
591
|
+
branch_deploy_custom_domain?: string;
|
|
592
|
+
deploy_preview_custom_domain?: string;
|
|
585
593
|
password?: string;
|
|
586
594
|
notification_email?: string;
|
|
587
595
|
url?: string;
|
|
@@ -726,6 +734,8 @@ type UpdateSiteResponse = {
|
|
|
726
734
|
name?: string;
|
|
727
735
|
custom_domain?: string;
|
|
728
736
|
domain_aliases?: string[];
|
|
737
|
+
branch_deploy_custom_domain?: string;
|
|
738
|
+
deploy_preview_custom_domain?: string;
|
|
729
739
|
password?: string;
|
|
730
740
|
notification_email?: string;
|
|
731
741
|
url?: string;
|
|
@@ -2791,6 +2801,8 @@ type UnlinkSiteRepoResponse = {
|
|
|
2791
2801
|
name?: string;
|
|
2792
2802
|
custom_domain?: string;
|
|
2793
2803
|
domain_aliases?: string[];
|
|
2804
|
+
branch_deploy_custom_domain?: string;
|
|
2805
|
+
deploy_preview_custom_domain?: string;
|
|
2794
2806
|
password?: string;
|
|
2795
2807
|
notification_email?: string;
|
|
2796
2808
|
url?: string;
|
|
@@ -3962,6 +3974,8 @@ type CreateSiteInTeamResponse = {
|
|
|
3962
3974
|
name?: string;
|
|
3963
3975
|
custom_domain?: string;
|
|
3964
3976
|
domain_aliases?: string[];
|
|
3977
|
+
branch_deploy_custom_domain?: string;
|
|
3978
|
+
deploy_preview_custom_domain?: string;
|
|
3965
3979
|
password?: string;
|
|
3966
3980
|
notification_email?: string;
|
|
3967
3981
|
url?: string;
|
|
@@ -4086,6 +4100,8 @@ type CreateSiteInTeamRequestBody = {
|
|
|
4086
4100
|
name?: string;
|
|
4087
4101
|
custom_domain?: string;
|
|
4088
4102
|
domain_aliases?: string[];
|
|
4103
|
+
branch_deploy_custom_domain?: string;
|
|
4104
|
+
deploy_preview_custom_domain?: string;
|
|
4089
4105
|
password?: string;
|
|
4090
4106
|
notification_email?: string;
|
|
4091
4107
|
url?: string;
|
|
@@ -4262,6 +4278,8 @@ type ListSitesForAccountResponse = {
|
|
|
4262
4278
|
name?: string;
|
|
4263
4279
|
custom_domain?: string;
|
|
4264
4280
|
domain_aliases?: string[];
|
|
4281
|
+
branch_deploy_custom_domain?: string;
|
|
4282
|
+
deploy_preview_custom_domain?: string;
|
|
4265
4283
|
password?: string;
|
|
4266
4284
|
notification_email?: string;
|
|
4267
4285
|
url?: string;
|
|
@@ -7338,7 +7356,7 @@ declare class NetlifyApi {
|
|
|
7338
7356
|
constructor(options: NetlifyApiOptions);
|
|
7339
7357
|
get api(): ApiProxy;
|
|
7340
7358
|
get auth(): {
|
|
7341
|
-
refreshToken: ({ refreshToken, authToken, clientId, clientSecret }: RefreshTokenOptions) => Promise<
|
|
7359
|
+
refreshToken: ({ refreshToken, authToken, clientId, clientSecret }: RefreshTokenOptions) => Promise<RefreshTokenResult>;
|
|
7342
7360
|
};
|
|
7343
7361
|
request<Endpoint extends keyof typeof operationsByPath>(endpoint: Endpoint, params: RequestEndpointParams<Endpoint>): Promise<ReturnType<{
|
|
7344
7362
|
'GET /sites': (variables: ListSitesVariables, signal?: AbortSignal | undefined) => Promise<ListSitesResponse>;
|
|
@@ -7465,15 +7483,22 @@ declare class NetlifyApi {
|
|
|
7465
7483
|
}
|
|
7466
7484
|
type RefreshTokenOptions = {
|
|
7467
7485
|
refreshToken: string;
|
|
7468
|
-
authToken
|
|
7486
|
+
authToken?: string;
|
|
7469
7487
|
clientId: string;
|
|
7470
7488
|
clientSecret: string;
|
|
7471
7489
|
};
|
|
7490
|
+
type RefreshTokenResult = {
|
|
7491
|
+
tokenType: string;
|
|
7492
|
+
accessToken: string;
|
|
7493
|
+
refreshToken: string;
|
|
7494
|
+
scope: string;
|
|
7495
|
+
createdAt: number;
|
|
7496
|
+
};
|
|
7472
7497
|
|
|
7473
7498
|
/**
|
|
7474
7499
|
* Generated by @openapi-codegen
|
|
7475
7500
|
*
|
|
7476
|
-
* @version 2.
|
|
7501
|
+
* @version 2.16.0
|
|
7477
7502
|
*/
|
|
7478
7503
|
type SplitTestSetup = {
|
|
7479
7504
|
branch_tests?: Record<string, any>;
|
|
@@ -7566,6 +7591,8 @@ type Site = {
|
|
|
7566
7591
|
name?: string;
|
|
7567
7592
|
custom_domain?: string;
|
|
7568
7593
|
domain_aliases?: string[];
|
|
7594
|
+
branch_deploy_custom_domain?: string;
|
|
7595
|
+
deploy_preview_custom_domain?: string;
|
|
7569
7596
|
password?: string;
|
|
7570
7597
|
notification_email?: string;
|
|
7571
7598
|
url?: string;
|
|
@@ -7690,6 +7717,8 @@ type SiteSetup = {
|
|
|
7690
7717
|
name?: string;
|
|
7691
7718
|
custom_domain?: string;
|
|
7692
7719
|
domain_aliases?: string[];
|
|
7720
|
+
branch_deploy_custom_domain?: string;
|
|
7721
|
+
deploy_preview_custom_domain?: string;
|
|
7693
7722
|
password?: string;
|
|
7694
7723
|
notification_email?: string;
|
|
7695
7724
|
url?: string;
|
|
@@ -8753,7 +8782,7 @@ declare namespace schemas {
|
|
|
8753
8782
|
/**
|
|
8754
8783
|
* Generated by @openapi-codegen
|
|
8755
8784
|
*
|
|
8756
|
-
* @version 2.
|
|
8785
|
+
* @version 2.16.0
|
|
8757
8786
|
*/
|
|
8758
8787
|
/**
|
|
8759
8788
|
* @format int32
|
|
@@ -8779,7 +8808,7 @@ declare namespace parameters {
|
|
|
8779
8808
|
/**
|
|
8780
8809
|
* Generated by @openapi-codegen
|
|
8781
8810
|
*
|
|
8782
|
-
* @version 2.
|
|
8811
|
+
* @version 2.16.0
|
|
8783
8812
|
*/
|
|
8784
8813
|
type Error = {
|
|
8785
8814
|
/**
|
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
|
-
|
|
803
|
+
const result = await fetch$1({
|
|
804
804
|
method: 'POST',
|
|
805
|
-
|
|
806
|
-
body:
|
|
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
|
+
"version": "0.1.5",
|
|
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/
|
|
8
|
+
"url": "https://github.com/SferaDev/openapi-clients/issues"
|
|
9
9
|
},
|
|
10
|
-
"homepage": "https://github.com/SferaDev/
|
|
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/
|
|
20
|
+
"url": "git+https://github.com/SferaDev/openapi-clients.git"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
23
|
"tsc": "tsc --noEmit",
|