@livechat/developer-studio-api 2.0.9 → 2.0.11

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/index.d.mts CHANGED
@@ -782,14 +782,15 @@ type LinkAppRepositoryGitHubData = {
782
782
  type: "existing";
783
783
  fullName: string;
784
784
  branch: string;
785
- target?: "node";
786
785
  };
787
786
  type LinkAppRepositoryGitLabData = {};
788
- type LinkAppRepositoryData = ({
787
+ type LinkAppRepositoryData = {
788
+ target: AppRepositoryTarget | undefined;
789
+ } & (({
789
790
  provider: "github";
790
791
  } & LinkAppRepositoryGitHubData) | ({
791
792
  provider: "gitlab";
792
- } & LinkAppRepositoryGitLabData);
793
+ } & LinkAppRepositoryGitLabData));
793
794
  type LinkAppRepositoryPayload = {
794
795
  appId: string;
795
796
  appName: string;
@@ -1284,7 +1285,7 @@ interface UpdateApplicationIconPayload {
1284
1285
  }
1285
1286
 
1286
1287
  type AppRepositoryProvider = "github" | "gitlab";
1287
- type AppRepositoryTarget = "node";
1288
+ type AppRepositoryTarget = "node" | "nextjs";
1288
1289
  type AppDeploymentProvider = "internal" | "netlify" | "vercel" | "heroku" | "custom";
1289
1290
  type AppDeploymentMode = "local" | "provider";
1290
1291
  type AppLoggerProvider = "sentry" | "amplitude";
@@ -2142,7 +2143,7 @@ declare const api: {
2142
2143
  id: string;
2143
2144
  title: string;
2144
2145
  }[]>;
2145
- createSiteByInstallationId(name: string, repositoryFullName: string, installationId: string, branch?: string | undefined, authorization?: NetlifyClientInstanceAuthorization | undefined): Promise<NetlifySite>;
2146
+ createSiteByInstallationId(name: string, repositoryFullName: string, target: AppRepositoryTarget, installationId: string, branch?: string | undefined, authorization?: NetlifyClientInstanceAuthorization | undefined): Promise<NetlifySite>;
2146
2147
  createSiteByDeployKey(name: string, repositoryFullName: string, deployKeyId: string, branch?: string | undefined, authorization?: NetlifyClientInstanceAuthorization | undefined): Promise<NetlifySite>;
2147
2148
  removeSite(siteId: string, authorization?: NetlifyClientInstanceAuthorization | undefined): Promise<void>;
2148
2149
  triggerSiteBuild(siteId: string, authorization?: NetlifyClientInstanceAuthorization | undefined): Promise<void>;
package/dist/index.d.ts CHANGED
@@ -782,14 +782,15 @@ type LinkAppRepositoryGitHubData = {
782
782
  type: "existing";
783
783
  fullName: string;
784
784
  branch: string;
785
- target?: "node";
786
785
  };
787
786
  type LinkAppRepositoryGitLabData = {};
788
- type LinkAppRepositoryData = ({
787
+ type LinkAppRepositoryData = {
788
+ target: AppRepositoryTarget | undefined;
789
+ } & (({
789
790
  provider: "github";
790
791
  } & LinkAppRepositoryGitHubData) | ({
791
792
  provider: "gitlab";
792
- } & LinkAppRepositoryGitLabData);
793
+ } & LinkAppRepositoryGitLabData));
793
794
  type LinkAppRepositoryPayload = {
794
795
  appId: string;
795
796
  appName: string;
@@ -1284,7 +1285,7 @@ interface UpdateApplicationIconPayload {
1284
1285
  }
1285
1286
 
1286
1287
  type AppRepositoryProvider = "github" | "gitlab";
1287
- type AppRepositoryTarget = "node";
1288
+ type AppRepositoryTarget = "node" | "nextjs";
1288
1289
  type AppDeploymentProvider = "internal" | "netlify" | "vercel" | "heroku" | "custom";
1289
1290
  type AppDeploymentMode = "local" | "provider";
1290
1291
  type AppLoggerProvider = "sentry" | "amplitude";
@@ -2142,7 +2143,7 @@ declare const api: {
2142
2143
  id: string;
2143
2144
  title: string;
2144
2145
  }[]>;
2145
- createSiteByInstallationId(name: string, repositoryFullName: string, installationId: string, branch?: string | undefined, authorization?: NetlifyClientInstanceAuthorization | undefined): Promise<NetlifySite>;
2146
+ createSiteByInstallationId(name: string, repositoryFullName: string, target: AppRepositoryTarget, installationId: string, branch?: string | undefined, authorization?: NetlifyClientInstanceAuthorization | undefined): Promise<NetlifySite>;
2146
2147
  createSiteByDeployKey(name: string, repositoryFullName: string, deployKeyId: string, branch?: string | undefined, authorization?: NetlifyClientInstanceAuthorization | undefined): Promise<NetlifySite>;
2147
2148
  removeSite(siteId: string, authorization?: NetlifyClientInstanceAuthorization | undefined): Promise<void>;
2148
2149
  triggerSiteBuild(siteId: string, authorization?: NetlifyClientInstanceAuthorization | undefined): Promise<void>;
package/dist/index.js CHANGED
@@ -964,8 +964,19 @@ var netlifySiteApi = {
964
964
  return snippets;
965
965
  });
966
966
  },
967
- createSiteByInstallationId(name, repositoryFullName, installationId, branch, authorization) {
968
- return __async(this, null, function* () {
967
+ createSiteByInstallationId(name, repositoryFullName, target, installationId, branch, authorization) {
968
+ return __async(this, null, function* () {
969
+ const config = target === "nextjs" ? {
970
+ repo: ["@netlify/plugin-nextjs"],
971
+ package: [{ package: "@netlify/plugin-nextjs" }],
972
+ dir: ".next",
973
+ cmd: "npm run build"
974
+ } : {
975
+ repo: [],
976
+ package: [],
977
+ dir: "dist",
978
+ cmd: "npm run build"
979
+ };
969
980
  const response = yield netlifyClientInstance.post(
970
981
  `/sites`,
971
982
  {
@@ -977,13 +988,13 @@ var netlifySiteApi = {
977
988
  private: true,
978
989
  installation_id: installationId,
979
990
  owner_type: "User",
980
- plugins: ["@netlify/plugin-nextjs"],
981
991
  env: {},
982
- dir: ".next",
983
- cmd: "npm run build"
992
+ plugins: config.repo,
993
+ dir: config.dir,
994
+ cmd: config.cmd
984
995
  },
985
996
  default_hooks_data: {},
986
- plugins: [{ package: "@netlify/plugin-nextjs" }],
997
+ plugins: config.package,
987
998
  created_via: ""
988
999
  },
989
1000
  getNetlifyClientConfig(__spreadProps(__spreadValues({}, authorization), {
package/dist/index.mjs CHANGED
@@ -880,8 +880,19 @@ var netlifySiteApi = {
880
880
  return snippets;
881
881
  });
882
882
  },
883
- createSiteByInstallationId(name, repositoryFullName, installationId, branch, authorization) {
884
- return __async(this, null, function* () {
883
+ createSiteByInstallationId(name, repositoryFullName, target, installationId, branch, authorization) {
884
+ return __async(this, null, function* () {
885
+ const config = target === "nextjs" ? {
886
+ repo: ["@netlify/plugin-nextjs"],
887
+ package: [{ package: "@netlify/plugin-nextjs" }],
888
+ dir: ".next",
889
+ cmd: "npm run build"
890
+ } : {
891
+ repo: [],
892
+ package: [],
893
+ dir: "dist",
894
+ cmd: "npm run build"
895
+ };
885
896
  const response = yield netlifyClientInstance.post(
886
897
  `/sites`,
887
898
  {
@@ -893,13 +904,13 @@ var netlifySiteApi = {
893
904
  private: true,
894
905
  installation_id: installationId,
895
906
  owner_type: "User",
896
- plugins: ["@netlify/plugin-nextjs"],
897
907
  env: {},
898
- dir: ".next",
899
- cmd: "npm run build"
908
+ plugins: config.repo,
909
+ dir: config.dir,
910
+ cmd: config.cmd
900
911
  },
901
912
  default_hooks_data: {},
902
- plugins: [{ package: "@netlify/plugin-nextjs" }],
913
+ plugins: config.package,
903
914
  created_via: ""
904
915
  },
905
916
  getNetlifyClientConfig(__spreadProps(__spreadValues({}, authorization), {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livechat/developer-studio-api",
3
- "version": "2.0.9",
3
+ "version": "2.0.11",
4
4
  "description": "This project is API for LiveChat Developer Studio.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -18,9 +18,9 @@
18
18
  "tsup": "^7.1.0",
19
19
  "typescript": "^5.1.6",
20
20
  "config": "0.0.0",
21
- "eslint-config-custom-lib": "0.0.1",
21
+ "tsconfig": "0.0.0",
22
22
  "types": "0.0.1",
23
- "tsconfig": "0.0.0"
23
+ "eslint-config-custom-lib": "0.0.1"
24
24
  },
25
25
  "scripts": {
26
26
  "build": "tsup src/index.ts --format esm,cjs --dts",