@osdk/cli 0.4.0 → 0.6.0

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.
Files changed (57) hide show
  1. package/build/js/chunk-DQYIDDJN.cjs +17 -0
  2. package/build/js/chunk-DQYIDDJN.cjs.map +1 -0
  3. package/build/js/chunk-IV3QY3PZ.mjs +15 -0
  4. package/build/js/chunk-IV3QY3PZ.mjs.map +1 -0
  5. package/build/js/{handleGenerate-A7X2XAGW.mjs → handleGenerate-7QGFIWKO.mjs} +2 -2
  6. package/build/js/{handleGenerate-WOW33WYG.cjs → handleGenerate-FHM4MFPH.cjs} +2 -2
  7. package/build/js/index.cjs +72 -85
  8. package/build/js/index.cjs.map +1 -1
  9. package/build/js/index.mjs +67 -80
  10. package/build/js/index.mjs.map +1 -1
  11. package/build/js/{siteDeployCommand-HSR3QDAT.mjs → siteDeployCommand-4S2UQKJP.mjs} +60 -9
  12. package/build/js/siteDeployCommand-4S2UQKJP.mjs.map +1 -0
  13. package/build/js/{siteDeployCommand-MXKGJFFB.cjs → siteDeployCommand-QKPJEL4X.cjs} +60 -8
  14. package/build/js/siteDeployCommand-QKPJEL4X.cjs.map +1 -0
  15. package/build/js/{versionDeleteCommand-6BJL5XLG.mjs → versionDeleteCommand-DGB5NTFM.mjs} +11 -1
  16. package/build/js/versionDeleteCommand-DGB5NTFM.mjs.map +1 -0
  17. package/build/js/{versionDeleteCommand-RLU7UUYD.cjs → versionDeleteCommand-S7AXTY46.cjs} +11 -1
  18. package/build/js/versionDeleteCommand-S7AXTY46.cjs.map +1 -0
  19. package/build/js/{versionUnsetCommand-IJT4JWBN.mjs → versionUnsetCommand-ISMMMWWZ.mjs} +11 -1
  20. package/build/js/versionUnsetCommand-ISMMMWWZ.mjs.map +1 -0
  21. package/build/js/{versionUnsetCommand-XYBUQ6XB.cjs → versionUnsetCommand-V3ZVCGSI.cjs} +11 -1
  22. package/build/js/versionUnsetCommand-V3ZVCGSI.cjs.map +1 -0
  23. package/build/types/commands/site/deploy/logDeployCommandConfigFileOverride.d.ts +1 -1
  24. package/build/types/commands/site/logSiteCommandConfigFileOverride.d.ts +1 -1
  25. package/build/types/commands/site/version/delete/VersionDeleteArgs.d.ts +5 -0
  26. package/build/types/commands/site/version/delete/index.d.ts +2 -2
  27. package/build/types/commands/site/version/delete/versionDeleteCommand.d.mts +2 -2
  28. package/build/types/commands/site/version/get/VersionGetArgs.d.ts +3 -0
  29. package/build/types/commands/site/version/get/index.d.ts +2 -1
  30. package/build/types/commands/site/version/get/versionGetCommand.d.mts +2 -2
  31. package/build/types/commands/site/version/list/VersionListArgs.d.ts +3 -0
  32. package/build/types/commands/site/version/list/index.d.ts +2 -1
  33. package/build/types/commands/site/version/list/versionListCommand.d.mts +2 -2
  34. package/build/types/commands/site/version/set/VersionSetArgs.d.ts +4 -0
  35. package/build/types/commands/site/version/set/index.d.ts +2 -2
  36. package/build/types/commands/site/version/set/versionSetCommand.d.mts +2 -2
  37. package/build/types/commands/site/version/unset/VersionUnsetArgs.d.ts +4 -0
  38. package/build/types/commands/site/version/unset/index.d.ts +2 -1
  39. package/build/types/commands/site/version/unset/versionUnsetCommand.d.mts +2 -2
  40. package/build/types/consola/handlePromptCancel.d.ts +1 -0
  41. package/build/types/net/index.d.mts +1 -0
  42. package/changelog/0.5.0/pr-47.v2.yml +5 -0
  43. package/changelog/0.5.0/pr-49.v2.yml +5 -0
  44. package/changelog/0.5.0/pr-51.v2.yml +5 -0
  45. package/changelog/0.6.0/pr-54.v2.yml +5 -0
  46. package/changelog/0.6.0/pr-56.v2.yml +5 -0
  47. package/changelog/0.6.0/pr-58.v2.yml +5 -0
  48. package/package.json +3 -3
  49. package/build/js/siteDeployCommand-HSR3QDAT.mjs.map +0 -1
  50. package/build/js/siteDeployCommand-MXKGJFFB.cjs.map +0 -1
  51. package/build/js/versionDeleteCommand-6BJL5XLG.mjs.map +0 -1
  52. package/build/js/versionDeleteCommand-RLU7UUYD.cjs.map +0 -1
  53. package/build/js/versionUnsetCommand-IJT4JWBN.mjs.map +0 -1
  54. package/build/js/versionUnsetCommand-XYBUQ6XB.cjs.map +0 -1
  55. package/build/types/commands/site/version/SiteVersionArgs.d.ts +0 -4
  56. /package/build/js/{handleGenerate-A7X2XAGW.mjs.map → handleGenerate-7QGFIWKO.mjs.map} +0 -0
  57. /package/build/js/{handleGenerate-WOW33WYG.cjs.map → handleGenerate-FHM4MFPH.cjs.map} +0 -0
@@ -1,16 +1,26 @@
1
1
  'use strict';
2
2
 
3
+ var chunkDQYIDDJN_cjs = require('./chunk-DQYIDDJN.cjs');
3
4
  var chunkD7QHLGEU_cjs = require('./chunk-D7QHLGEU.cjs');
4
5
  require('./chunk-HYF3CTKZ.cjs');
5
6
  require('./chunk-HQDDGVB7.cjs');
6
7
  var consola = require('consola');
8
+ var utils = require('consola/utils');
7
9
 
8
10
  async function versionUnsetCommand({
11
+ yes,
9
12
  application,
10
13
  foundryUrl,
11
14
  token,
12
15
  tokenFile
13
16
  }) {
17
+ if (!yes) {
18
+ const confirmed = await consola.consola.prompt(`Are you sure you want to clear the live site version?
19
+ ${utils.colorize("bold", "Your site will no longer be accessible until a new live site version is set.")}`, {
20
+ type: "confirm"
21
+ });
22
+ chunkDQYIDDJN_cjs.handlePromptCancel(confirmed);
23
+ }
14
24
  const loadedToken = await chunkD7QHLGEU_cjs.loadToken(token, tokenFile);
15
25
  const tokenProvider = () => loadedToken;
16
26
  const clientCtx = chunkD7QHLGEU_cjs.createInternalClientContext(foundryUrl, tokenProvider);
@@ -23,4 +33,4 @@ async function versionUnsetCommand({
23
33
 
24
34
  module.exports = versionUnsetCommand;
25
35
  //# sourceMappingURL=out.js.map
26
- //# sourceMappingURL=versionUnsetCommand-XYBUQ6XB.cjs.map
36
+ //# sourceMappingURL=versionUnsetCommand-V3ZVCGSI.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/commands/site/version/unset/versionUnsetCommand.mts"],"names":[],"mappings":";;;;;;;;;;;;;;AAgBA,SAAS,eAAe;AAExB,SAAS,gBAAgB;AAGzB,eAAO,oBAA2C;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,MAAI,CAAC,KAAK;AACR,UAAM,YAAY,MAAM,QAAQ,OAAO;AAAA,EAA0D,SAAS,QAAQ,8EAA8E,CAAC,IAAI;AAAA,MACnM,MAAM;AAAA,IACR,CAAC;AACD,uBAAmB,SAAS;AAAA,EAC9B;AACA,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,UAAQ,MAAM,4BAA4B;AAC1C,QAAM,gBAAgB,MAAM,wCAA6B,0BAA0B,WAAW,WAAW;AACzG,QAAM,MAAM,qBAAqB,YAAY,kBAAkB,aAAa;AAC5E,QAAM,qCAA6B,qBAAqB,KAAK,aAAa;AAC1E,UAAQ,QAAQ,2BAA2B;AAC7C","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { ArtifactsSitesAdminV2Service, createConjureContext, createInternalClientContext, thirdPartyApplicationService } from \"#net\";\nimport { colorize } from \"consola/utils\";\nimport { handlePromptCancel } from \"../../../../consola/handlePromptCancel.js\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionUnsetCommand({\n yes,\n application,\n foundryUrl,\n token,\n tokenFile\n}) {\n if (!yes) {\n const confirmed = await consola.prompt(`Are you sure you want to clear the live site version?\\n${colorize(\"bold\", \"Your site will no longer be accessible until a new live site version is set.\")}`, {\n type: \"confirm\"\n });\n handlePromptCancel(confirmed);\n }\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n consola.start(\"Clearing live site version\");\n const repositoryRid = await thirdPartyApplicationService.fetchWebsiteRepositoryRid(clientCtx, application);\n const ctx = createConjureContext(foundryUrl, \"/artifacts/api\", tokenProvider);\n await ArtifactsSitesAdminV2Service.clearDeployedVersion(ctx, repositoryRid);\n consola.success(\"Cleared live site version\");\n}"]}
@@ -1,4 +1,4 @@
1
1
  import type { Arguments } from "yargs";
2
2
  import type { SiteConfig } from "../../../util/config.js";
3
3
  import type { SiteDeployArgs } from "./SiteDeployArgs.js";
4
- export declare function logDeployCommandConfigFileOverride(argv: Arguments<SiteDeployArgs>, config: SiteConfig | undefined): Promise<void>;
4
+ export declare function logDeployCommandConfigFileOverride(args: Arguments<SiteDeployArgs>, config: SiteConfig | undefined): Promise<void>;
@@ -1,4 +1,4 @@
1
1
  import type { Arguments } from "yargs";
2
2
  import type { FoundryConfig } from "../../util/config.js";
3
3
  import type { CommonSiteArgs } from "./CommonSiteArgs.js";
4
- export declare function logSiteCommandConfigFileOverride(argv: Arguments<CommonSiteArgs>, config: FoundryConfig | undefined): Promise<void>;
4
+ export declare function logSiteCommandConfigFileOverride(args: Arguments<CommonSiteArgs>, config: FoundryConfig | undefined): Promise<void>;
@@ -0,0 +1,5 @@
1
+ import type { CommonSiteArgs } from "../../CommonSiteArgs.js";
2
+ export interface VersionDeleteArgs extends CommonSiteArgs {
3
+ version: string;
4
+ yes?: boolean;
5
+ }
@@ -1,5 +1,5 @@
1
1
  import type { CommandModule } from "yargs";
2
2
  import type { CommonSiteArgs } from "../../CommonSiteArgs.js";
3
- import type { SiteVersionArgs } from "../SiteVersionArgs.js";
4
- declare const command: CommandModule<CommonSiteArgs, SiteVersionArgs>;
3
+ import type { VersionDeleteArgs } from "./VersionDeleteArgs.js";
4
+ declare const command: CommandModule<CommonSiteArgs, VersionDeleteArgs>;
5
5
  export default command;
@@ -1,2 +1,2 @@
1
- import type { SiteVersionArgs } from "../SiteVersionArgs.js";
2
- export default function versionDeleteCommand({ version, application, foundryUrl, token, tokenFile }: SiteVersionArgs): Promise<void>;
1
+ import type { VersionDeleteArgs } from "./VersionDeleteArgs.js";
2
+ export default function versionDeleteCommand({ version, yes, application, foundryUrl, token, tokenFile }: VersionDeleteArgs): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import type { CommonSiteArgs } from "../../CommonSiteArgs.js";
2
+ export interface VersionGetArgs extends CommonSiteArgs {
3
+ }
@@ -1,4 +1,5 @@
1
1
  import type { CommandModule } from "yargs";
2
2
  import type { CommonSiteArgs } from "../../CommonSiteArgs.js";
3
- declare const command: CommandModule<CommonSiteArgs, CommonSiteArgs>;
3
+ import type { VersionGetArgs } from "./VersionGetArgs.js";
4
+ declare const command: CommandModule<CommonSiteArgs, VersionGetArgs>;
4
5
  export default command;
@@ -1,2 +1,2 @@
1
- import type { CommonSiteArgs } from "../../CommonSiteArgs.js";
2
- export default function versionGetCommand({ foundryUrl, application, token, tokenFile }: CommonSiteArgs): Promise<void>;
1
+ import type { VersionGetArgs } from "./VersionGetArgs.js";
2
+ export default function versionGetCommand({ foundryUrl, application, token, tokenFile }: VersionGetArgs): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import type { CommonSiteArgs } from "../../CommonSiteArgs.js";
2
+ export interface VersionListArgs extends CommonSiteArgs {
3
+ }
@@ -1,4 +1,5 @@
1
1
  import type { CommandModule } from "yargs";
2
2
  import type { CommonSiteArgs } from "../../CommonSiteArgs.js";
3
- declare const command: CommandModule<CommonSiteArgs, CommonSiteArgs>;
3
+ import type { VersionListArgs } from "./VersionListArgs.js";
4
+ declare const command: CommandModule<CommonSiteArgs, VersionListArgs>;
4
5
  export default command;
@@ -1,2 +1,2 @@
1
- import type { CommonSiteArgs } from "../../CommonSiteArgs.js";
2
- export default function versionListCommand({ foundryUrl, application, token, tokenFile }: CommonSiteArgs): Promise<void>;
1
+ import type { VersionListArgs } from "./VersionListArgs.js";
2
+ export default function versionListCommand({ foundryUrl, application, token, tokenFile }: VersionListArgs): Promise<void>;
@@ -0,0 +1,4 @@
1
+ import type { CommonSiteArgs } from "../../CommonSiteArgs.js";
2
+ export interface VersionSetArgs extends CommonSiteArgs {
3
+ version: string;
4
+ }
@@ -1,5 +1,5 @@
1
1
  import type { CommandModule } from "yargs";
2
2
  import type { CommonSiteArgs } from "../../CommonSiteArgs.js";
3
- import type { SiteVersionArgs } from "../SiteVersionArgs.js";
4
- declare const command: CommandModule<CommonSiteArgs, SiteVersionArgs>;
3
+ import type { VersionSetArgs } from "./VersionSetArgs.js";
4
+ declare const command: CommandModule<CommonSiteArgs, VersionSetArgs>;
5
5
  export default command;
@@ -1,2 +1,2 @@
1
- import type { SiteVersionArgs } from "../SiteVersionArgs.js";
2
- export default function versionSetCommand({ version, application, foundryUrl, token, tokenFile }: SiteVersionArgs): Promise<void>;
1
+ import type { VersionSetArgs } from "./VersionSetArgs.js";
2
+ export default function versionSetCommand({ version, application, foundryUrl, token, tokenFile }: VersionSetArgs): Promise<void>;
@@ -0,0 +1,4 @@
1
+ import type { CommonSiteArgs } from "../../CommonSiteArgs.js";
2
+ export interface VersionUnsetArgs extends CommonSiteArgs {
3
+ yes?: boolean;
4
+ }
@@ -1,4 +1,5 @@
1
1
  import type { CommandModule } from "yargs";
2
2
  import type { CommonSiteArgs } from "../../CommonSiteArgs.js";
3
- declare const command: CommandModule<CommonSiteArgs, CommonSiteArgs>;
3
+ import type { VersionUnsetArgs } from "./VersionUnsetArgs.js";
4
+ declare const command: CommandModule<CommonSiteArgs, VersionUnsetArgs>;
4
5
  export default command;
@@ -1,2 +1,2 @@
1
- import type { CommonSiteArgs } from "../../CommonSiteArgs.js";
2
- export default function versionUnsetCommand({ application, foundryUrl, token, tokenFile }: CommonSiteArgs): Promise<void>;
1
+ import type { VersionUnsetArgs } from "./VersionUnsetArgs.js";
2
+ export default function versionUnsetCommand({ yes, application, foundryUrl, token, tokenFile }: VersionUnsetArgs): Promise<void>;
@@ -0,0 +1 @@
1
+ export declare function handlePromptCancel(promptResponse: any): void;
@@ -1,4 +1,5 @@
1
1
  export { ArtifactsSitesAdminV2Service } from "../generated/artifacts-sites/index.js";
2
+ export type { SiteDomainInfo } from "../generated/artifacts-sites/SiteDomainInfo.js";
2
3
  export * as artifacts from "./artifacts/index.mjs";
3
4
  export { createConjureContext } from "./createConjureContext.mjs";
4
5
  export { createInternalClientContext } from "./createInternalClientContext.mjs";
@@ -0,0 +1,5 @@
1
+ type: improvement
2
+ improvement:
3
+ description: Increase CLI max width to 150 columns
4
+ links:
5
+ - https://github.com/palantir/osdk-ts/pull/47
@@ -0,0 +1,5 @@
1
+ type: improvement
2
+ improvement:
3
+ description: Debug log site zip stats
4
+ links:
5
+ - https://github.com/palantir/osdk-ts/pull/49
@@ -0,0 +1,5 @@
1
+ type: improvement
2
+ improvement:
3
+ description: Clean up yargs handling and consola imports
4
+ links:
5
+ - https://github.com/palantir/osdk-ts/pull/51
@@ -0,0 +1,5 @@
1
+ type: improvement
2
+ improvement:
3
+ description: Review CLI docs wording
4
+ links:
5
+ - https://github.com/palantir/osdk-ts/pull/54
@@ -0,0 +1,5 @@
1
+ type: improvement
2
+ improvement:
3
+ description: Prompt user for destructive CLI commands
4
+ links:
5
+ - https://github.com/palantir/osdk-ts/pull/56
@@ -0,0 +1,5 @@
1
+ type: improvement
2
+ improvement:
3
+ description: Display site link after CLI site deploy command
4
+ links:
5
+ - https://github.com/palantir/osdk-ts/pull/58
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdk/cli",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "",
5
5
  "access": "public",
6
6
  "license": "Apache-2.0",
@@ -25,9 +25,9 @@
25
25
  "open": "^9.1.0",
26
26
  "yargs": "^17.7.2",
27
27
  "@osdk/api": "1.1.1",
28
- "@osdk/gateway": "1.1.1",
29
28
  "@osdk/generator": "1.3.0",
30
- "@osdk/shared.net": "1.2.0"
29
+ "@osdk/shared.net": "1.2.0",
30
+ "@osdk/gateway": "1.1.1"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/archiver": "^6.0.0",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/commands/site/deploy/siteDeployCommand.mts","../../src/util/autoVersion.ts"],"names":["autoVersion"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,SAAS,eAAe;AAExB,OAAO,cAAc;AACrB,YAAY,QAAQ;AACpB,SAAS,gBAAgB;;;ACJzB,SAAS,gBAAgB;AAWzB,eAAsB,YAAY,YAAY,IAAI;AAChD,QAAM,CAAC,aAAa,WAAW,IAAI,cAAc,KAAK,CAAC,WAAW,IAAI,OAAO,IAAI,SAAS,EAAE,CAAC,IAAI,CAAC,QAAW,IAAI,OAAO,KAAK,CAAC;AAC9H,MAAI;AACF,UAAM,aAAa,SAAS,6CAA6C,eAAe,OAAO,aAAa,WAAW,OAAO,EAAE,IAAI;AAAA,MAClI,UAAU;AAAA,IACZ,CAAC;AACD,UAAM,UAAU,WAAW,KAAK,EAAE,QAAQ,aAAa,EAAE;AACzD,QAAI,CAAC,cAAc,OAAO,GAAG;AAC3B,YAAM,IAAI,iBAAiB,GAAG,sBAAsB,OAAO,2BAA2B;AAAA,IACxF;AACA,WAAO;AAAA,EACT,SAAS,OAAO;AACd,UAAM,IAAI,iBAAiB,GAAG,sFAAsF,KAAK,EAAE;AAAA,EAC7H;AACF;;;ADjBA,eAAO,kBAAyC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,MAAI,WAAW,QAAQA,gBAAe,MAAM;AAC1C,UAAM,IAAI,MAAM,iDAAiD;AAAA,EACnE;AACA,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AAKpD,MAAI;AACJ,MAAI,WAAW,MAAM;AACnB,kBAAc;AAAA,EAChB,OAAO;AACL,kBAAc,MAAM,YAAgB,YAAY;AAChD,YAAQ,KAAK,6CAA6C,WAAW,EAAE;AAAA,EACzE;AACA,QAAM,OAAO,MAAS,YAAS,KAAK,SAAS;AAC7C,MAAI,CAAC,KAAK,YAAY,GAAG;AACvB,YAAQ,MAAM,mCAAmC;AACjD,UAAM,IAAI,iBAAiB,CAAC;AAAA,EAC9B;AACA,UAAQ,MAAM,qBAAqB;AACnC,QAAM,UAAU,SAAS,KAAK,EAAE,UAAU,WAAW,KAAK;AAC1D,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,QAAM,QAAQ,IAAI,CAAC,kBAAU,0BAA0B,sBAAsB,WAAW;AAAA,IACtF;AAAA,IACA,SAAS;AAAA,IACT,SAAS,SAAS,MAAM,OAAO;AAAA;AAAA,EACjC,CAAC,GAAG,QAAQ,SAAS,CAAC,CAAC;AACvB,UAAQ,QAAQ,iBAAiB;AACjC,MAAI,CAAC,YAAY;AACf,UAAM,gBAAgB,MAAM,wCAA6B,0BAA0B,WAAW,WAAW;AACzG,UAAM,MAAM,qBAAqB,YAAY,kBAAkB,aAAa;AAC5E,UAAM,qCAA6B,sBAAsB,KAAK,eAAe;AAAA,MAC3E,aAAa;AAAA,QACX,SAAS;AAAA,MACX;AAAA,IACF,CAAC;AACD,YAAQ,QAAQ,YAAY,WAAW,eAAe;AAAA,EACxD,OAAO;AACL,YAAQ,MAAM,+CAA+C;AAAA,EAC/D;AACF","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { artifacts, ArtifactsSitesAdminV2Service, createConjureContext, createInternalClientContext, thirdPartyApplicationService } from \"#net\";\nimport archiver from \"archiver\";\nimport * as fs from \"node:fs\";\nimport { Readable } from \"node:stream\";\nimport { ExitProcessError } from \"../../../ExitProcessError.js\";\nimport { autoVersion as findAutoVersion } from \"../../../util/autoVersion.js\";\nimport { loadToken } from \"../../../util/token.js\";\nexport default async function siteDeployCommand({\n version,\n application,\n foundryUrl,\n autoVersion,\n gitTagPrefix,\n uploadOnly,\n directory,\n token,\n tokenFile\n}) {\n if (version == null && autoVersion == null) {\n throw new Error(\"Either version or autoVersion must be specified\");\n }\n const loadedToken = await loadToken(token, tokenFile);\n\n // version has a priority over autoVersion. Both could be defined at the same time when\n // autoVersion is present in the config file (it assigns that as a default value to argv.autoVersion)\n // and --version is passed as an argument\n let siteVersion;\n if (version != null) {\n siteVersion = version;\n } else {\n siteVersion = await findAutoVersion(gitTagPrefix);\n consola.info(`Auto version inferred next version to be: ${siteVersion}`);\n }\n const stat = await fs.promises.stat(directory);\n if (!stat.isDirectory()) {\n consola.error(\"Specified path is not a directory\");\n throw new ExitProcessError(2);\n }\n consola.start(\"Zippping site files\");\n const archive = archiver(\"zip\").directory(directory, false);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n await Promise.all([artifacts.SiteAssetArtifactsService.uploadZippedSiteAsset(clientCtx, {\n application,\n version: siteVersion,\n zipFile: Readable.toWeb(archive) // This cast is because the dom fetch doesnt align type wise with streams\n }), archive.finalize()]);\n consola.success(\"Upload complete\");\n if (!uploadOnly) {\n const repositoryRid = await thirdPartyApplicationService.fetchWebsiteRepositoryRid(clientCtx, application);\n const ctx = createConjureContext(foundryUrl, \"/artifacts/api\", tokenProvider);\n await ArtifactsSitesAdminV2Service.updateDeployedVersion(ctx, repositoryRid, {\n siteVersion: {\n version: siteVersion\n }\n });\n consola.success(`Deployed ${siteVersion} successfully`);\n } else {\n consola.debug(\"Upload only mode enabled, skipping deployment\");\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { execSync } from \"node:child_process\";\nimport { ExitProcessError } from \"../ExitProcessError.js\";\nimport { isValidSemver } from \"./isValidSemver.js\";\n\n/**\n * Gets the version string using git describe. If the @param tagPrefix is empty, git describe will return the\n * latest tag (without any filtering) and if the tag starts with \"v\", it will be removed.\n * @param tagPrefix The prefix to use for matching against tags. Defaults to an empty string.\n * @returns A promise that resolves to the version string.\n * @throws An error if the version string is not SemVer compliant or if the version cannot be determined.\n */\nexport async function autoVersion(tagPrefix = \"\") {\n const [matchPrefix, prefixRegex] = tagPrefix !== \"\" ? [tagPrefix, new RegExp(`^${tagPrefix}`)] : [undefined, new RegExp(`^v?`)];\n try {\n const gitVersion = execSync(`git describe --tags --first-parent --dirty${matchPrefix != null ? ` --match=\"${matchPrefix}*\"` : \"\"}`, {\n encoding: \"utf8\"\n });\n const version = gitVersion.trim().replace(prefixRegex, \"\");\n if (!isValidSemver(version)) {\n throw new ExitProcessError(2, `The version string ${version} is not SemVer compliant.`);\n }\n return version;\n } catch (error) {\n throw new ExitProcessError(2, `Unable to determine the version automatically. Please supply a --version argument. ${error}`);\n }\n}"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/commands/site/deploy/siteDeployCommand.mts","../../src/util/autoVersion.ts"],"names":["autoVersion"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,SAAS,eAAe;AAExB,OAAO,cAAc;AACrB,YAAY,QAAQ;AACpB,SAAS,gBAAgB;;;ACJzB,SAAS,gBAAgB;AAWzB,eAAsB,YAAY,YAAY,IAAI;AAChD,QAAM,CAAC,aAAa,WAAW,IAAI,cAAc,KAAK,CAAC,WAAW,IAAI,OAAO,IAAI,SAAS,EAAE,CAAC,IAAI,CAAC,QAAW,IAAI,OAAO,KAAK,CAAC;AAC9H,MAAI;AACF,UAAM,aAAa,SAAS,6CAA6C,eAAe,OAAO,aAAa,WAAW,OAAO,EAAE,IAAI;AAAA,MAClI,UAAU;AAAA,IACZ,CAAC;AACD,UAAM,UAAU,WAAW,KAAK,EAAE,QAAQ,aAAa,EAAE;AACzD,QAAI,CAAC,cAAc,OAAO,GAAG;AAC3B,YAAM,IAAI,iBAAiB,GAAG,sBAAsB,OAAO,2BAA2B;AAAA,IACxF;AACA,WAAO;AAAA,EACT,SAAS,OAAO;AACd,UAAM,IAAI,iBAAiB,GAAG,sFAAsF,KAAK,EAAE;AAAA,EAC7H;AACF;;;ADjBA,eAAO,kBAAyC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,MAAI,WAAW,QAAQA,gBAAe,MAAM;AAC1C,UAAM,IAAI,MAAM,iDAAiD;AAAA,EACnE;AACA,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AAKpD,MAAI;AACJ,MAAI,WAAW,MAAM;AACnB,kBAAc;AAAA,EAChB,OAAO;AACL,kBAAc,MAAM,YAAgB,YAAY;AAChD,YAAQ,KAAK,6CAA6C,WAAW,EAAE;AAAA,EACzE;AACA,QAAM,OAAO,MAAS,YAAS,KAAK,SAAS;AAC7C,MAAI,CAAC,KAAK,YAAY,GAAG;AACvB,YAAQ,MAAM,mCAAmC;AACjD,UAAM,IAAI,iBAAiB,CAAC;AAAA,EAC9B;AACA,UAAQ,MAAM,qBAAqB;AACnC,QAAM,UAAU,SAAS,KAAK,EAAE,UAAU,WAAW,KAAK;AAC1D,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,QAAM,QAAQ,IAAI,CAAC,kBAAU,0BAA0B,sBAAsB,WAAW;AAAA,IACtF;AAAA,IACA,SAAS;AAAA,IACT,SAAS,SAAS,MAAM,OAAO;AAAA;AAAA,EACjC,CAAC,GAAG,QAAQ,SAAS,CAAC,CAAC;AACvB,UAAQ,QAAQ,iBAAiB;AACjC,MAAI,CAAC,YAAY;AACf,UAAM,gBAAgB,MAAM,wCAA6B,0BAA0B,WAAW,WAAW;AACzG,UAAM,MAAM,qBAAqB,YAAY,kBAAkB,aAAa;AAC5E,UAAM,qCAA6B,sBAAsB,KAAK,eAAe;AAAA,MAC3E,aAAa;AAAA,QACX,SAAS;AAAA,MACX;AAAA,IACF,CAAC;AACD,YAAQ,QAAQ,YAAY,WAAW,eAAe;AAAA,EACxD,OAAO;AACL,YAAQ,MAAM,+CAA+C;AAAA,EAC/D;AACF","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { artifacts, ArtifactsSitesAdminV2Service, createConjureContext, createInternalClientContext, thirdPartyApplicationService } from \"#net\";\nimport archiver from \"archiver\";\nimport * as fs from \"node:fs\";\nimport { Readable } from \"node:stream\";\nimport { ExitProcessError } from \"../../../ExitProcessError.js\";\nimport { autoVersion as findAutoVersion } from \"../../../util/autoVersion.js\";\nimport { loadToken } from \"../../../util/token.js\";\nexport default async function siteDeployCommand({\n version,\n application,\n foundryUrl,\n autoVersion,\n gitTagPrefix,\n uploadOnly,\n directory,\n token,\n tokenFile\n}) {\n if (version == null && autoVersion == null) {\n throw new Error(\"Either version or autoVersion must be specified\");\n }\n const loadedToken = await loadToken(token, tokenFile);\n\n // version has a priority over autoVersion. Both could be defined at the same time when\n // autoVersion is present in the config file (it assigns that as a default value to argv.autoVersion)\n // and --version is passed as an argument\n let siteVersion;\n if (version != null) {\n siteVersion = version;\n } else {\n siteVersion = await findAutoVersion(gitTagPrefix);\n consola.info(`Auto version inferred next version to be: ${siteVersion}`);\n }\n const stat = await fs.promises.stat(directory);\n if (!stat.isDirectory()) {\n consola.error(\"Specified path is not a directory\");\n throw new ExitProcessError(2);\n }\n consola.start(\"Zippping site files\");\n const archive = archiver(\"zip\").directory(directory, false);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n await Promise.all([artifacts.SiteAssetArtifactsService.uploadZippedSiteAsset(clientCtx, {\n application,\n version: siteVersion,\n zipFile: Readable.toWeb(archive) // This cast is because the dom fetch doesnt align type wise with streams\n }), archive.finalize()]);\n consola.success(\"Upload complete\");\n if (!uploadOnly) {\n const repositoryRid = await thirdPartyApplicationService.fetchWebsiteRepositoryRid(clientCtx, application);\n const ctx = createConjureContext(foundryUrl, \"/artifacts/api\", tokenProvider);\n await ArtifactsSitesAdminV2Service.updateDeployedVersion(ctx, repositoryRid, {\n siteVersion: {\n version: siteVersion\n }\n });\n consola.success(`Deployed ${siteVersion} successfully`);\n } else {\n consola.debug(\"Upload only mode enabled, skipping deployment\");\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { execSync } from \"node:child_process\";\nimport { ExitProcessError } from \"../ExitProcessError.js\";\nimport { isValidSemver } from \"./isValidSemver.js\";\n\n/**\n * Gets the version string using git describe. If the @param tagPrefix is empty, git describe will return the\n * latest tag (without any filtering) and if the tag starts with \"v\", it will be removed.\n * @param tagPrefix The prefix to use for matching against tags. Defaults to an empty string.\n * @returns A promise that resolves to the version string.\n * @throws An error if the version string is not SemVer compliant or if the version cannot be determined.\n */\nexport async function autoVersion(tagPrefix = \"\") {\n const [matchPrefix, prefixRegex] = tagPrefix !== \"\" ? [tagPrefix, new RegExp(`^${tagPrefix}`)] : [undefined, new RegExp(`^v?`)];\n try {\n const gitVersion = execSync(`git describe --tags --first-parent --dirty${matchPrefix != null ? ` --match=\"${matchPrefix}*\"` : \"\"}`, {\n encoding: \"utf8\"\n });\n const version = gitVersion.trim().replace(prefixRegex, \"\");\n if (!isValidSemver(version)) {\n throw new ExitProcessError(2, `The version string ${version} is not SemVer compliant.`);\n }\n return version;\n } catch (error) {\n throw new ExitProcessError(2, `Unable to determine the version automatically. Please supply a --version argument. ${error}`);\n }\n}"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/commands/site/version/delete/versionDeleteCommand.mts"],"names":[],"mappings":";;;;;;;;;AAiBA,SAAS,eAAe;AAExB,eAAO,qBAA4C;AAAA,EACjD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,UAAQ,MAAM,oBAAoB,OAAO,EAAE;AAC3C,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,QAAM,kBAAU,0BAA0B,kBAAkB,WAAW;AAAA,IACrE;AAAA,IACA;AAAA,EACF,CAAC;AACD,UAAQ,QAAQ,mBAAmB,OAAO,EAAE;AAC9C","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { artifacts, createInternalClientContext } from \"#net\";\nimport { consola } from \"consola\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionDeleteCommand({\n version,\n application,\n foundryUrl,\n token,\n tokenFile\n}) {\n consola.start(`Deleting version ${version}`);\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n await artifacts.SiteAssetArtifactsService.deleteSiteVersion(clientCtx, {\n application,\n version\n });\n consola.success(`Deleted version ${version}`);\n}"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/commands/site/version/delete/versionDeleteCommand.mts"],"names":[],"mappings":";;;;;;;;;AAiBA,SAAS,eAAe;AAExB,eAAO,qBAA4C;AAAA,EACjD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,UAAQ,MAAM,oBAAoB,OAAO,EAAE;AAC3C,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,QAAM,kBAAU,0BAA0B,kBAAkB,WAAW;AAAA,IACrE;AAAA,IACA;AAAA,EACF,CAAC;AACD,UAAQ,QAAQ,mBAAmB,OAAO,EAAE;AAC9C","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { artifacts, createInternalClientContext } from \"#net\";\nimport { consola } from \"consola\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionDeleteCommand({\n version,\n application,\n foundryUrl,\n token,\n tokenFile\n}) {\n consola.start(`Deleting version ${version}`);\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n await artifacts.SiteAssetArtifactsService.deleteSiteVersion(clientCtx, {\n application,\n version\n });\n consola.success(`Deleted version ${version}`);\n}"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/commands/site/version/unset/versionUnsetCommand.mts"],"names":[],"mappings":";;;;;;;;;;;AAgBA,SAAS,eAAe;AAGxB,eAAO,oBAA2C;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,UAAQ,MAAM,4BAA4B;AAC1C,QAAM,gBAAgB,MAAM,wCAA6B,0BAA0B,WAAW,WAAW;AACzG,QAAM,MAAM,qBAAqB,YAAY,kBAAkB,aAAa;AAC5E,QAAM,qCAA6B,qBAAqB,KAAK,aAAa;AAC1E,UAAQ,QAAQ,2BAA2B;AAC7C","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { ArtifactsSitesAdminV2Service, createConjureContext, createInternalClientContext, thirdPartyApplicationService } from \"#net\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionUnsetCommand({\n application,\n foundryUrl,\n token,\n tokenFile\n}) {\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n consola.start(\"Clearing live site version\");\n const repositoryRid = await thirdPartyApplicationService.fetchWebsiteRepositoryRid(clientCtx, application);\n const ctx = createConjureContext(foundryUrl, \"/artifacts/api\", tokenProvider);\n await ArtifactsSitesAdminV2Service.clearDeployedVersion(ctx, repositoryRid);\n consola.success(\"Cleared live site version\");\n}"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/commands/site/version/unset/versionUnsetCommand.mts"],"names":[],"mappings":";;;;;;;;;;;AAgBA,SAAS,eAAe;AAGxB,eAAO,oBAA2C;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,UAAQ,MAAM,4BAA4B;AAC1C,QAAM,gBAAgB,MAAM,wCAA6B,0BAA0B,WAAW,WAAW;AACzG,QAAM,MAAM,qBAAqB,YAAY,kBAAkB,aAAa;AAC5E,QAAM,qCAA6B,qBAAqB,KAAK,aAAa;AAC1E,UAAQ,QAAQ,2BAA2B;AAC7C","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { ArtifactsSitesAdminV2Service, createConjureContext, createInternalClientContext, thirdPartyApplicationService } from \"#net\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionUnsetCommand({\n application,\n foundryUrl,\n token,\n tokenFile\n}) {\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n consola.start(\"Clearing live site version\");\n const repositoryRid = await thirdPartyApplicationService.fetchWebsiteRepositoryRid(clientCtx, application);\n const ctx = createConjureContext(foundryUrl, \"/artifacts/api\", tokenProvider);\n await ArtifactsSitesAdminV2Service.clearDeployedVersion(ctx, repositoryRid);\n consola.success(\"Cleared live site version\");\n}"]}
@@ -1,4 +0,0 @@
1
- import type { CommonSiteArgs } from "../CommonSiteArgs.js";
2
- export interface SiteVersionArgs extends CommonSiteArgs {
3
- version: string;
4
- }