netlify 23.9.0 → 23.9.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.
- package/dist/commands/agents/agents-create.js +1 -1
- package/dist/commands/agents/agents-create.js.map +1 -1
- package/dist/commands/agents/agents-show.d.ts.map +1 -1
- package/dist/commands/agents/agents-show.js +1 -1
- package/dist/commands/agents/agents-show.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/hooks/requires-site-info-with-project.d.ts.map +1 -1
- package/dist/utils/hooks/requires-site-info-with-project.js +32 -33
- package/dist/utils/hooks/requires-site-info-with-project.js.map +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requires-site-info-with-project.d.ts","sourceRoot":"","sources":["../../../src/utils/hooks/requires-site-info-with-project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAKxC;;;GAGG;AACH,QAAA,MAAM,2BAA2B,GAAU,SAAS,OAAO,
|
|
1
|
+
{"version":3,"file":"requires-site-info-with-project.d.ts","sourceRoot":"","sources":["../../../src/utils/hooks/requires-site-info-with-project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAKxC;;;GAGG;AACH,QAAA,MAAM,2BAA2B,GAAU,SAAS,OAAO,uBA+E1D,CAAA;AAED,eAAe,2BAA2B,CAAA"}
|
|
@@ -10,47 +10,46 @@ const requiresSiteInfoWithProject = async (command) => {
|
|
|
10
10
|
const { api, site } = baseCommand.netlify;
|
|
11
11
|
const options = baseCommand.opts();
|
|
12
12
|
let siteId = site.id;
|
|
13
|
-
// If --project flag is provided, resolve it to a site ID
|
|
14
|
-
if (options.project
|
|
13
|
+
// If --project flag is provided, resolve it to a site ID (overrides linked site)
|
|
14
|
+
if (options.project) {
|
|
15
15
|
try {
|
|
16
|
-
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
baseCommand.netlify.site.id = siteId;
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
|
|
24
|
-
baseCommand.netlify.siteInfo = siteData; // Type assertion needed due to API type mismatch
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
const sites = await api.listSites({
|
|
29
|
-
filter: 'all',
|
|
30
|
-
name: options.project,
|
|
31
|
-
});
|
|
32
|
-
const matchedSite = sites.find((site) => site.name === options.project);
|
|
33
|
-
if (matchedSite?.id) {
|
|
34
|
-
siteId = matchedSite.id;
|
|
35
|
-
// Update the site info in the command
|
|
36
|
-
baseCommand.netlify.site.id = siteId;
|
|
37
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
|
|
38
|
-
baseCommand.netlify.siteInfo = matchedSite; // Type assertion needed due to API type mismatch
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
return logAndThrowError(`Project "${options.project}" not found. Make sure you have access to this project.`);
|
|
42
|
-
}
|
|
16
|
+
const siteData = await api.getSite({ siteId: options.project });
|
|
17
|
+
if (siteData.id) {
|
|
18
|
+
siteId = siteData.id;
|
|
19
|
+
baseCommand.netlify.site.id = siteId;
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
|
|
21
|
+
baseCommand.netlify.siteInfo = siteData;
|
|
43
22
|
}
|
|
44
23
|
}
|
|
45
24
|
catch (error_) {
|
|
46
25
|
const error = error_;
|
|
47
|
-
if (error.status ===
|
|
26
|
+
if (error.status === 404) {
|
|
27
|
+
try {
|
|
28
|
+
const sites = await api.listSites({
|
|
29
|
+
filter: 'all',
|
|
30
|
+
name: options.project,
|
|
31
|
+
});
|
|
32
|
+
const matchedSite = sites.find((site) => site.name === options.project);
|
|
33
|
+
if (matchedSite?.id) {
|
|
34
|
+
siteId = matchedSite.id;
|
|
35
|
+
baseCommand.netlify.site.id = siteId;
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
|
|
37
|
+
baseCommand.netlify.siteInfo = matchedSite;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
return logAndThrowError(`Project "${options.project}" not found. Make sure you have access to this project.`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch (listError) {
|
|
44
|
+
return logAndThrowError(`Failed to resolve project "${options.project}": ${listError.message}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
else if (error.status === 401) {
|
|
48
48
|
return logAndThrowError(`Not authorized to access project "${options.project}"`);
|
|
49
49
|
}
|
|
50
|
-
|
|
51
|
-
return logAndThrowError(`
|
|
50
|
+
else {
|
|
51
|
+
return logAndThrowError(`Failed to resolve project "${options.project}": ${error.message}`);
|
|
52
52
|
}
|
|
53
|
-
return logAndThrowError(`Failed to resolve project "${options.project}": ${error.message}`);
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
55
|
// Now check if we have a site ID (either from link or --project)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requires-site-info-with-project.js","sourceRoot":"","sources":["../../../src/utils/hooks/requires-site-info-with-project.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAiB,MAAM,uBAAuB,CAAA;AAG7E;;;GAGG;AACH,MAAM,2BAA2B,GAAG,KAAK,EAAE,OAAgB,EAAE,EAAE;IAC7D,2FAA2F;IAC3F,8FAA8F;IAC9F,MAAM,WAAW,GAAG,OAAsB,CAAA;IAC1C,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,WAAW,CAAC,OAAO,CAAA;IACzC,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,EAAwB,CAAA;IAExD,IAAI,MAAM,GAAG,IAAI,CAAC,EAAE,CAAA;IAEpB,
|
|
1
|
+
{"version":3,"file":"requires-site-info-with-project.js","sourceRoot":"","sources":["../../../src/utils/hooks/requires-site-info-with-project.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAiB,MAAM,uBAAuB,CAAA;AAG7E;;;GAGG;AACH,MAAM,2BAA2B,GAAG,KAAK,EAAE,OAAgB,EAAE,EAAE;IAC7D,2FAA2F;IAC3F,8FAA8F;IAC9F,MAAM,WAAW,GAAG,OAAsB,CAAA;IAC1C,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,WAAW,CAAC,OAAO,CAAA;IACzC,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,EAAwB,CAAA;IAExD,IAAI,MAAM,GAAG,IAAI,CAAC,EAAE,CAAA;IAEpB,iFAAiF;IACjF,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QACpB,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;YAC/D,IAAI,QAAQ,CAAC,EAAE,EAAE,CAAC;gBAChB,MAAM,GAAG,QAAQ,CAAC,EAAE,CAAA;gBACpB,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,CAAA;gBACpC,uGAAuG;gBACvG,WAAW,CAAC,OAAO,CAAC,QAAQ,GAAG,QAAe,CAAA;YAChD,CAAC;QACH,CAAC;QAAC,OAAO,MAAM,EAAE,CAAC;YAChB,MAAM,KAAK,GAAG,MAAkB,CAAA;YAChC,IAAI,KAAK,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBACzB,IAAI,CAAC;oBACH,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,SAAS,CAAC;wBAChC,MAAM,EAAE,KAAK;wBACb,IAAI,EAAE,OAAO,CAAC,OAAO;qBACtB,CAAC,CAAA;oBACF,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,QAAQ,CAAC,EAAE,EAAE,CAAC;YACrC,uGAAuG;YACvG,WAAW,CAAC,OAAO,CAAC,QAAQ,GAAG,QAAe,CAAA,CAAC,iDAAiD;QAClG,CAAC;IACH,CAAC;IAAC,OAAO,MAAM,EAAE,CAAC;QAChB,eAAe;QACf,IAAK,MAAmB,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YACxC,IAAI,CAAC,iFAAiF,CAAC,CAAA;YACvF,OAAO,gBAAgB,CAAC,uCAAuC,MAAM,GAAG,CAAC,CAAA;QAC3E,CAAC;QACD,UAAU;QACV,IAAK,MAAmB,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YACxC,OAAO,gBAAgB,CAAC,4BAA4B,CAAC,CAAA;QACvD,CAAC;QAED,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACjC,CAAC;AACH,CAAC,CAAA;AAED,eAAe,2BAA2B,CAAA"}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netlify",
|
|
3
|
-
"version": "23.9.
|
|
3
|
+
"version": "23.9.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "netlify",
|
|
9
|
-
"version": "23.9.
|
|
9
|
+
"version": "23.9.1",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|