@osdk/cli 0.0.3 → 0.0.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.
Files changed (117) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/build/js/chunk-2LNCUMIA.cjs +8 -0
  3. package/build/js/chunk-2LNCUMIA.cjs.map +1 -0
  4. package/build/js/chunk-AFLYFRYO.cjs +16 -0
  5. package/build/js/chunk-AFLYFRYO.cjs.map +1 -0
  6. package/build/js/chunk-LBGQDFFN.js +5 -0
  7. package/build/js/chunk-LBGQDFFN.js.map +1 -0
  8. package/build/js/chunk-NOVNYG3L.js +11 -0
  9. package/build/js/chunk-NOVNYG3L.js.map +1 -0
  10. package/build/js/handleSiteDeploy-2C2WC2A7.js +9 -0
  11. package/build/js/handleSiteDeploy-2C2WC2A7.js.map +1 -0
  12. package/build/js/handleSiteDeploy-4O4DUUB6.cjs +11 -0
  13. package/build/js/handleSiteDeploy-4O4DUUB6.cjs.map +1 -0
  14. package/build/js/index.cjs +35 -0
  15. package/build/js/index.cjs.map +1 -0
  16. package/build/js/index.js +6 -11
  17. package/build/js/index.js.map +1 -1
  18. package/build/js/siteDeleteCommand-GQCHP3EN.js +9 -0
  19. package/build/js/siteDeleteCommand-GQCHP3EN.js.map +1 -0
  20. package/build/js/siteDeleteCommand-ZXXHDOOM.cjs +11 -0
  21. package/build/js/siteDeleteCommand-ZXXHDOOM.cjs.map +1 -0
  22. package/build/js/siteUploadCommand-4ZL5TAIW.js +12 -0
  23. package/build/js/siteUploadCommand-4ZL5TAIW.js.map +1 -0
  24. package/build/js/siteUploadCommand-5AYNOXAT.cjs +37 -0
  25. package/build/js/siteUploadCommand-5AYNOXAT.cjs.map +1 -0
  26. package/build/js/siteVersionsCommand-ZUFBC6EH.js +10 -0
  27. package/build/js/siteVersionsCommand-ZUFBC6EH.js.map +1 -0
  28. package/build/js/siteVersionsCommand-ZVHYGOAQ.cjs +12 -0
  29. package/build/js/siteVersionsCommand-ZVHYGOAQ.cjs.map +1 -0
  30. package/build/types/CliCommonArgs.d.ts +3 -0
  31. package/build/types/cli.d.ts +1 -0
  32. package/build/types/commands/site/CommonSiteArgs.d.ts +6 -0
  33. package/build/types/commands/site/delete/DeleteArgs.d.ts +4 -0
  34. package/build/types/commands/site/delete/index.d.ts +5 -0
  35. package/build/types/commands/site/delete/siteDeleteCommand.d.mts +2 -0
  36. package/build/types/commands/site/deploy/SiteDeployArgs.d.ts +5 -0
  37. package/build/types/commands/site/deploy/handleSiteDeploy.d.mts +2 -0
  38. package/build/types/commands/site/deploy/index.d.ts +5 -0
  39. package/build/types/commands/site/index.d.ts +5 -0
  40. package/build/types/commands/site/upload/UploadArgs.d.ts +1 -1
  41. package/build/types/commands/site/upload/index.d.ts +2 -2
  42. package/build/types/commands/site/versions/index.d.ts +1 -1
  43. package/build/types/commands/site/versions/siteVersionsCommand.d.mts +2 -2
  44. package/build/types/generated/artifacts-admin/ArtifactsAdminService/clearDeletedUserRepositories.d.ts +3 -0
  45. package/build/types/generated/artifacts-admin/ArtifactsAdminService/getContainerRegistryDomain.d.ts +3 -0
  46. package/build/types/generated/artifacts-admin/ArtifactsAdminService.d.ts +2 -0
  47. package/build/types/generated/artifacts-admin/ClearDeletedUserRepositoriesRequest.d.ts +3 -0
  48. package/build/types/generated/artifacts-admin/ContainerRegistryDomainResponse.d.ts +3 -0
  49. package/build/types/generated/artifacts-admin/index.d.ts +3 -0
  50. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminService/deleteSiteDeployment.d.ts +2 -0
  51. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminService/deploySite.d.ts +3 -0
  52. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminService/getDeployedVersion.d.ts +3 -0
  53. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminService.d.ts +3 -0
  54. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/clearDeployedVersion.d.ts +2 -0
  55. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getContentSecurityPolicyAdditions.d.ts +3 -0
  56. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getDeployedVersion.d.ts +3 -0
  57. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getRegisteredSiteDomains.d.ts +3 -0
  58. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getRequestedSiteDomains.d.ts +3 -0
  59. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/previewContentSecurityPolicy.d.ts +4 -0
  60. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/putContentSecurityPolicyAdditions.d.ts +3 -0
  61. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/requestSiteDomainForRepository.d.ts +4 -0
  62. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/unregisterSiteDomain.d.ts +3 -0
  63. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/updateDeployedVersion.d.ts +3 -0
  64. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service.d.ts +10 -0
  65. package/build/types/generated/artifacts-sites/ContentSecurityPolicyAdditions.d.ts +3 -0
  66. package/build/types/generated/artifacts-sites/ContentSecurityPolicyDirectiveName.d.ts +1 -0
  67. package/build/types/generated/artifacts-sites/ContentSecurityPolicyDirectiveValue.d.ts +1 -0
  68. package/build/types/generated/artifacts-sites/ContentSecurityPolicyHeaderValue.d.ts +1 -0
  69. package/build/types/generated/artifacts-sites/ControlPanelManagedDomainInfo.d.ts +6 -0
  70. package/build/types/generated/artifacts-sites/DeploySiteRequest.d.ts +7 -0
  71. package/build/types/generated/artifacts-sites/DeploymentInfo.d.ts +6 -0
  72. package/build/types/generated/artifacts-sites/DomainName.d.ts +3 -0
  73. package/build/types/generated/artifacts-sites/PreviewContentSecurityPolicyRequest.d.ts +4 -0
  74. package/build/types/generated/artifacts-sites/SiteDomainInfo.d.ts +6 -0
  75. package/build/types/generated/artifacts-sites/SiteDomainRegistrationRequestRid.d.ts +1 -0
  76. package/build/types/generated/artifacts-sites/SiteVersion.d.ts +3 -0
  77. package/build/types/generated/artifacts-sites/SitesDomainRegistryService/getRegisteredDomains.d.ts +2 -0
  78. package/build/types/generated/artifacts-sites/SitesDomainRegistryService.d.ts +1 -0
  79. package/build/types/generated/artifacts-sites/SubmitDomainRegistrationRequest.d.ts +7 -0
  80. package/build/types/generated/artifacts-sites/UnregisterDomainRequest.d.ts +4 -0
  81. package/build/types/generated/artifacts-sites/UpdateDeployedVersionRequest.d.ts +4 -0
  82. package/build/types/generated/artifacts-sites/index.d.ts +18 -0
  83. package/build/types/index.d.ts +1 -1
  84. package/build/types/net/artifacts/SiteAssetArtifactsService/SiteAssetVersions.d.mts +3 -0
  85. package/build/types/net/artifacts/SiteAssetArtifactsService/deleteSiteVersion.d.mts +2 -0
  86. package/build/types/net/artifacts/SiteAssetArtifactsService/fetchSiteVersions.d.mts +2 -0
  87. package/build/types/net/artifacts/SiteAssetArtifactsService/index.d.mts +4 -0
  88. package/build/types/net/{uploadSiteVersion.d.mts → artifacts/SiteAssetArtifactsService/uploadSiteVersion.d.mts} +1 -4
  89. package/build/types/net/artifacts/index.d.mts +1 -0
  90. package/build/types/net/createConjureContext.d.mts +2 -0
  91. package/build/types/net/index.d.mts +4 -0
  92. package/build/types/net/{fetchWebsiteRepositoryRid.d.mts → third-party-application-service/fetchWebsiteRepositoryRid.d.mts} +2 -2
  93. package/build/types/net/third-party-application-service/index.d.mts +1 -0
  94. package/build/types/readCliVersionFromPackageJson.d.ts +1 -0
  95. package/build/types/yargs/logVersionMiddleware.d.ts +2 -0
  96. package/package.json +8 -2
  97. package/build/js/chunk-2DJZUIFP.js +0 -7
  98. package/build/js/chunk-2DJZUIFP.js.map +0 -1
  99. package/build/js/chunk-6PVNK2PW.js +0 -13
  100. package/build/js/chunk-6PVNK2PW.js.map +0 -1
  101. package/build/js/chunk-MGT3UGXW.mjs +0 -5
  102. package/build/js/chunk-MGT3UGXW.mjs.map +0 -1
  103. package/build/js/chunk-YEWM6TCR.mjs +0 -9
  104. package/build/js/chunk-YEWM6TCR.mjs.map +0 -1
  105. package/build/js/index.mjs +0 -9
  106. package/build/js/index.mjs.map +0 -1
  107. package/build/js/siteUploadCommand-36HAEYDG.js +0 -37
  108. package/build/js/siteUploadCommand-36HAEYDG.js.map +0 -1
  109. package/build/js/siteUploadCommand-L3QDNVWX.mjs +0 -12
  110. package/build/js/siteUploadCommand-L3QDNVWX.mjs.map +0 -1
  111. package/build/js/siteVersionsCommand-BQMPCMGZ.mjs +0 -10
  112. package/build/js/siteVersionsCommand-BQMPCMGZ.mjs.map +0 -1
  113. package/build/js/siteVersionsCommand-YSV7HQJK.js +0 -12
  114. package/build/js/siteVersionsCommand-YSV7HQJK.js.map +0 -1
  115. package/build/types/commands/site/addSiteCommand.d.ts +0 -7
  116. package/build/types/net/getSiteVersions.d.mts +0 -5
  117. /package/build/types/net/{getSiteAssetBaseUrl.d.mts → artifacts/SiteAssetArtifactsService/getSiteAssetBaseUrl.d.mts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/commands/site/versions/siteVersionsCommand.mts"],"names":["consola","colorize","siteVersionsCommand","baseUrl","appRid","repositoryRid","third_party_application_service_exports","ctx","createConjureContext","versions","deployedVersion","artifacts_exports","ArtifactsSitesAdminV2Service_exports","version"],"mappings":"yFAiBA,OAAS,WAAAA,MAAe,UACxB,OAAS,YAAAC,MAAgB,gBACzB,eAAOC,EAA2C,CAChD,QAAAC,EACA,OAAAC,CACF,EAAG,CACDJ,EAAQ,MAAM,sCAAsC,EACpD,IAAMK,EAAgB,MAAMC,EAA6B,0BAA0BH,EAASC,CAAM,EAC5FG,EAAMC,EAAqBL,EAAS,gBAAgB,EACpD,CAACM,EAAUC,CAAe,EAAI,MAAM,QAAQ,IAAI,CAACC,EAAU,0BAA0B,kBAAkBR,EAASC,CAAM,EAAGQ,EAA6B,mBAAmBL,EAAKF,CAAa,CAAC,CAAC,EACnM,GAAII,EAAS,QAAU,EAAG,CACxBT,EAAQ,KAAK,+DAA+D,EAC5E,MACF,CACAA,EAAQ,QAAQ,iBAAiB,EACjC,QAAWa,KAAWJ,EACpBT,EAAQ,IAAI,SAASa,CAAO,GAAGH,GAAmBG,IAAYH,EAAgB,QAAUT,EAAS,QAAS,aAAa,EAAI,EAAE,EAAE,CAEnI","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, ArtifactsSitesAdminV2Service, createConjureContext, thirdPartyApplicationService } from \"#net\";\nimport { consola } from \"consola\";\nimport { colorize } from \"consola/utils\";\nexport default async function siteVersionsCommand({\n baseUrl,\n appRid\n}) {\n consola.start(\"Fetching versions & deployed version\");\n const repositoryRid = await thirdPartyApplicationService.fetchWebsiteRepositoryRid(baseUrl, appRid);\n const ctx = createConjureContext(baseUrl, \"/artifacts/api\");\n const [versions, deployedVersion] = await Promise.all([artifacts.SiteAssetArtifactsService.fetchSiteVersions(baseUrl, appRid), ArtifactsSitesAdminV2Service.getDeployedVersion(ctx, repositoryRid)]);\n if (versions.length == 0) {\n consola.warn(\"Successfully connected to server, but no versions were found.\");\n return;\n }\n consola.success(\"Found versions:\");\n for (const version of versions) {\n consola.log(` - ${version}${deployedVersion && version === deployedVersion.version ? colorize(\"green\", ` (deployed)`) : \"\"}`);\n }\n}"]}
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ var chunkAFLYFRYO_cjs = require('./chunk-AFLYFRYO.cjs');
4
+ require('./chunk-2LNCUMIA.cjs');
5
+ var consola = require('consola');
6
+ var utils = require('consola/utils');
7
+
8
+ async function v({baseUrl:o,appRid:t}){consola.consola.start("Fetching versions & deployed version");let d=await chunkAFLYFRYO_cjs.d.fetchWebsiteRepositoryRid(o,t),l=chunkAFLYFRYO_cjs.c(o,"/artifacts/api"),[i,r]=await Promise.all([chunkAFLYFRYO_cjs.b.SiteAssetArtifactsService.fetchSiteVersions(o,t),chunkAFLYFRYO_cjs.a.getDeployedVersion(l,d)]);if(i.length==0){consola.consola.warn("Successfully connected to server, but no versions were found.");return}consola.consola.success("Found versions:");for(let s of i)consola.consola.log(` - ${s}${r&&s===r.version?utils.colorize("green"," (deployed)"):""}`);}
9
+
10
+ module.exports = v;
11
+ //# sourceMappingURL=out.js.map
12
+ //# sourceMappingURL=siteVersionsCommand-ZVHYGOAQ.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/commands/site/versions/siteVersionsCommand.mts"],"names":["consola","colorize","siteVersionsCommand","baseUrl","appRid","repositoryRid","third_party_application_service_exports","ctx","createConjureContext","versions","deployedVersion","artifacts_exports","ArtifactsSitesAdminV2Service_exports","version"],"mappings":"2FAiBA,OAAS,WAAAA,MAAe,UACxB,OAAS,YAAAC,MAAgB,gBACzB,eAAOC,EAA2C,CAChD,QAAAC,EACA,OAAAC,CACF,EAAG,CACDJ,EAAQ,MAAM,sCAAsC,EACpD,IAAMK,EAAgB,MAAMC,EAA6B,0BAA0BH,EAASC,CAAM,EAC5FG,EAAMC,EAAqBL,EAAS,gBAAgB,EACpD,CAACM,EAAUC,CAAe,EAAI,MAAM,QAAQ,IAAI,CAACC,EAAU,0BAA0B,kBAAkBR,EAASC,CAAM,EAAGQ,EAA6B,mBAAmBL,EAAKF,CAAa,CAAC,CAAC,EACnM,GAAII,EAAS,QAAU,EAAG,CACxBT,EAAQ,KAAK,+DAA+D,EAC5E,MACF,CACAA,EAAQ,QAAQ,iBAAiB,EACjC,QAAWa,KAAWJ,EACpBT,EAAQ,IAAI,SAASa,CAAO,GAAGH,GAAmBG,IAAYH,EAAgB,QAAUT,EAAS,QAAS,aAAa,EAAI,EAAE,EAAE,CAEnI","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, ArtifactsSitesAdminV2Service, createConjureContext, thirdPartyApplicationService } from \"#net\";\nimport { consola } from \"consola\";\nimport { colorize } from \"consola/utils\";\nexport default async function siteVersionsCommand({\n baseUrl,\n appRid\n}) {\n consola.start(\"Fetching versions & deployed version\");\n const repositoryRid = await thirdPartyApplicationService.fetchWebsiteRepositoryRid(baseUrl, appRid);\n const ctx = createConjureContext(baseUrl, \"/artifacts/api\");\n const [versions, deployedVersion] = await Promise.all([artifacts.SiteAssetArtifactsService.fetchSiteVersions(baseUrl, appRid), ArtifactsSitesAdminV2Service.getDeployedVersion(ctx, repositoryRid)]);\n if (versions.length == 0) {\n consola.warn(\"Successfully connected to server, but no versions were found.\");\n return;\n }\n consola.success(\"Found versions:\");\n for (const version of versions) {\n consola.log(` - ${version}${deployedVersion && version === deployedVersion.version ? colorize(\"green\", ` (deployed)`) : \"\"}`);\n }\n}"]}
@@ -0,0 +1,3 @@
1
+ export interface CliCommonArgs {
2
+ verbose: number;
3
+ }
@@ -1,5 +1,6 @@
1
1
  export declare function cli(args?: string[]): Promise<{
2
2
  [x: string]: unknown;
3
+ verbose: number;
3
4
  _: (string | number)[];
4
5
  $0: string;
5
6
  } | undefined>;
@@ -0,0 +1,6 @@
1
+ import type { CliCommonArgs } from "../../CliCommonArgs.js";
2
+ import type { ThirdPartyAppRid } from "../../net/ThirdPartyAppRid.js";
3
+ export interface CommonSiteArgs extends CliCommonArgs {
4
+ appRid: ThirdPartyAppRid;
5
+ baseUrl: string;
6
+ }
@@ -0,0 +1,4 @@
1
+ import type { CommonSiteArgs } from "../CommonSiteArgs.js";
2
+ export interface DeleteArgs extends CommonSiteArgs {
3
+ siteVersion: string;
4
+ }
@@ -0,0 +1,5 @@
1
+ import type { CommandModule } from "yargs";
2
+ import type { CommonSiteArgs } from "../CommonSiteArgs.js";
3
+ import type { DeleteArgs } from "./DeleteArgs.js";
4
+ export declare const command: CommandModule<CommonSiteArgs, DeleteArgs>;
5
+ export default command;
@@ -0,0 +1,2 @@
1
+ import type { DeleteArgs } from "./DeleteArgs.js";
2
+ export default function siteDeleteCommand(args: DeleteArgs): Promise<void>;
@@ -0,0 +1,5 @@
1
+ import type { CommonSiteArgs } from "../CommonSiteArgs.js";
2
+ export interface SiteDeployArgs extends CommonSiteArgs {
3
+ siteVersion?: string;
4
+ clearVersion?: boolean;
5
+ }
@@ -0,0 +1,2 @@
1
+ import type { SiteDeployArgs } from "./SiteDeployArgs.js";
2
+ export default function handleSiteDeploy({ siteVersion: version, appRid, baseUrl, clearVersion }: SiteDeployArgs): Promise<void>;
@@ -0,0 +1,5 @@
1
+ import type { CommandModule } from "yargs";
2
+ import type { CommonSiteArgs } from "../CommonSiteArgs.js";
3
+ import type { SiteDeployArgs } from "./SiteDeployArgs.js";
4
+ export declare const command: CommandModule<CommonSiteArgs, SiteDeployArgs>;
5
+ export default command;
@@ -0,0 +1,5 @@
1
+ import type * as yargs from "yargs";
2
+ import type { CliCommonArgs } from "../../CliCommonArgs.js";
3
+ import type { CommonSiteArgs } from "./CommonSiteArgs.js";
4
+ declare const site: yargs.CommandModule<CliCommonArgs, CommonSiteArgs>;
5
+ export default site;
@@ -1,4 +1,4 @@
1
- import type { CommonSiteArgs } from "../addSiteCommand";
1
+ import type { CommonSiteArgs } from "../CommonSiteArgs.js";
2
2
  export interface UploadArgs extends CommonSiteArgs {
3
3
  siteVersion: string;
4
4
  dir?: string;
@@ -1,5 +1,5 @@
1
1
  import type { CommandModule } from "yargs";
2
- import type { CommonSiteArgs } from "../addSiteCommand";
3
- import type { UploadArgs } from "./UploadArgs";
2
+ import type { CommonSiteArgs } from "../CommonSiteArgs.js";
3
+ import type { UploadArgs } from "./UploadArgs.js";
4
4
  export declare const command: CommandModule<CommonSiteArgs, UploadArgs>;
5
5
  export default command;
@@ -1,4 +1,4 @@
1
1
  import type { CommandModule } from "yargs";
2
- import type { CommonSiteArgs } from "../addSiteCommand.js";
2
+ import type { CommonSiteArgs } from "../CommonSiteArgs.js";
3
3
  export declare const command: CommandModule<CommonSiteArgs, CommonSiteArgs>;
4
4
  export default command;
@@ -1,2 +1,2 @@
1
- import type { CommonSiteArgs } from "../addSiteCommand.js";
2
- export default function invokeSiteVersionsCommand(args: CommonSiteArgs): Promise<void>;
1
+ import type { CommonSiteArgs } from "../CommonSiteArgs.js";
2
+ export default function siteVersionsCommand({ baseUrl, appRid }: CommonSiteArgs): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import { type ConjureContext } from "conjure-lite";
2
+ import type { ClearDeletedUserRepositoriesRequest } from "../ClearDeletedUserRepositoriesRequest.js";
3
+ export declare function clearDeletedUserRepositories(ctx: ConjureContext, request: ClearDeletedUserRepositoriesRequest): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import { type ConjureContext } from "conjure-lite";
2
+ import type { ContainerRegistryDomainResponse } from "../ContainerRegistryDomainResponse.js";
3
+ export declare function getContainerRegistryDomain(ctx: ConjureContext): Promise<ContainerRegistryDomainResponse>;
@@ -0,0 +1,2 @@
1
+ export { clearDeletedUserRepositories } from "./ArtifactsAdminService/clearDeletedUserRepositories.js";
2
+ export { getContainerRegistryDomain } from "./ArtifactsAdminService/getContainerRegistryDomain.js";
@@ -0,0 +1,3 @@
1
+ export interface ClearDeletedUserRepositoriesRequest {
2
+ dryRun: boolean;
3
+ }
@@ -0,0 +1,3 @@
1
+ export interface ContainerRegistryDomainResponse {
2
+ domain: string;
3
+ }
@@ -0,0 +1,3 @@
1
+ export * as ArtifactsAdminService from "./ArtifactsAdminService.js";
2
+ export type { ClearDeletedUserRepositoriesRequest } from "./ClearDeletedUserRepositoriesRequest.js";
3
+ export type { ContainerRegistryDomainResponse } from "./ContainerRegistryDomainResponse.js";
@@ -0,0 +1,2 @@
1
+ import { type ConjureContext } from "conjure-lite";
2
+ export declare function deleteSiteDeployment(ctx: ConjureContext, repositoryRid: string): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import { type ConjureContext } from "conjure-lite";
2
+ import type { DeploySiteRequest } from "../DeploySiteRequest.js";
3
+ export declare function deploySite(ctx: ConjureContext, deploySiteRequest: DeploySiteRequest): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import { type ConjureContext } from "conjure-lite";
2
+ import type { DeploymentInfo } from "../DeploymentInfo.js";
3
+ export declare function getDeployedVersion(ctx: ConjureContext, repositoryRid: string): Promise<DeploymentInfo | undefined>;
@@ -0,0 +1,3 @@
1
+ export { deleteSiteDeployment } from "./ArtifactsSitesAdminService/deleteSiteDeployment.js";
2
+ export { deploySite } from "./ArtifactsSitesAdminService/deploySite.js";
3
+ export { getDeployedVersion } from "./ArtifactsSitesAdminService/getDeployedVersion.js";
@@ -0,0 +1,2 @@
1
+ import { type ConjureContext } from "conjure-lite";
2
+ export declare function clearDeployedVersion(ctx: ConjureContext, repositoryRid: string): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import { type ConjureContext } from "conjure-lite";
2
+ import type { ContentSecurityPolicyAdditions } from "../ContentSecurityPolicyAdditions.js";
3
+ export declare function getContentSecurityPolicyAdditions(ctx: ConjureContext, repositoryRid: string): Promise<ContentSecurityPolicyAdditions>;
@@ -0,0 +1,3 @@
1
+ import { type ConjureContext } from "conjure-lite";
2
+ import type { SiteVersion } from "../SiteVersion.js";
3
+ export declare function getDeployedVersion(ctx: ConjureContext, repositoryRid: string): Promise<SiteVersion | undefined>;
@@ -0,0 +1,3 @@
1
+ import { type ConjureContext } from "conjure-lite";
2
+ import type { SiteDomainInfo } from "../SiteDomainInfo.js";
3
+ export declare function getRegisteredSiteDomains(ctx: ConjureContext, repositoryRid: string): Promise<Array<SiteDomainInfo>>;
@@ -0,0 +1,3 @@
1
+ import { type ConjureContext } from "conjure-lite";
2
+ import type { SiteDomainInfo } from "../SiteDomainInfo.js";
3
+ export declare function getRequestedSiteDomains(ctx: ConjureContext, repositoryRid: string): Promise<Array<SiteDomainInfo>>;
@@ -0,0 +1,4 @@
1
+ import { type ConjureContext } from "conjure-lite";
2
+ import type { ContentSecurityPolicyHeaderValue } from "../ContentSecurityPolicyHeaderValue.js";
3
+ import type { PreviewContentSecurityPolicyRequest } from "../PreviewContentSecurityPolicyRequest.js";
4
+ export declare function previewContentSecurityPolicy(ctx: ConjureContext, repositoryRid: string, request: PreviewContentSecurityPolicyRequest): Promise<ContentSecurityPolicyHeaderValue>;
@@ -0,0 +1,3 @@
1
+ import { type ConjureContext } from "conjure-lite";
2
+ import type { ContentSecurityPolicyAdditions } from "../ContentSecurityPolicyAdditions.js";
3
+ export declare function putContentSecurityPolicyAdditions(ctx: ConjureContext, repositoryRid: string, contentSecurityPolicyAdditions: ContentSecurityPolicyAdditions): Promise<void>;
@@ -0,0 +1,4 @@
1
+ import { type ConjureContext } from "conjure-lite";
2
+ import type { SiteDomainInfo } from "../SiteDomainInfo.js";
3
+ import type { SubmitDomainRegistrationRequest } from "../SubmitDomainRegistrationRequest.js";
4
+ export declare function requestSiteDomainForRepository(ctx: ConjureContext, repositoryRid: string, request: SubmitDomainRegistrationRequest): Promise<SiteDomainInfo>;
@@ -0,0 +1,3 @@
1
+ import { type ConjureContext } from "conjure-lite";
2
+ import type { UnregisterDomainRequest } from "../UnregisterDomainRequest.js";
3
+ export declare function unregisterSiteDomain(ctx: ConjureContext, repositoryRid: string, request: UnregisterDomainRequest): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import { type ConjureContext } from "conjure-lite";
2
+ import type { UpdateDeployedVersionRequest } from "../UpdateDeployedVersionRequest.js";
3
+ export declare function updateDeployedVersion(ctx: ConjureContext, repositoryRid: string, version: UpdateDeployedVersionRequest): Promise<void>;
@@ -0,0 +1,10 @@
1
+ export { clearDeployedVersion } from "./ArtifactsSitesAdminV2Service/clearDeployedVersion.js";
2
+ export { getContentSecurityPolicyAdditions } from "./ArtifactsSitesAdminV2Service/getContentSecurityPolicyAdditions.js";
3
+ export { getDeployedVersion } from "./ArtifactsSitesAdminV2Service/getDeployedVersion.js";
4
+ export { getRegisteredSiteDomains } from "./ArtifactsSitesAdminV2Service/getRegisteredSiteDomains.js";
5
+ export { getRequestedSiteDomains } from "./ArtifactsSitesAdminV2Service/getRequestedSiteDomains.js";
6
+ export { previewContentSecurityPolicy } from "./ArtifactsSitesAdminV2Service/previewContentSecurityPolicy.js";
7
+ export { putContentSecurityPolicyAdditions } from "./ArtifactsSitesAdminV2Service/putContentSecurityPolicyAdditions.js";
8
+ export { requestSiteDomainForRepository } from "./ArtifactsSitesAdminV2Service/requestSiteDomainForRepository.js";
9
+ export { unregisterSiteDomain } from "./ArtifactsSitesAdminV2Service/unregisterSiteDomain.js";
10
+ export { updateDeployedVersion } from "./ArtifactsSitesAdminV2Service/updateDeployedVersion.js";
@@ -0,0 +1,3 @@
1
+ export interface ContentSecurityPolicyAdditions {
2
+ policy: any;
3
+ }
@@ -0,0 +1 @@
1
+ export type ContentSecurityPolicyDirectiveName = "CONNECT_SRC" | "FRAME_SRC" | "IMG_SRC" | "SCRIPT_SRC";
@@ -0,0 +1 @@
1
+ export type ContentSecurityPolicyDirectiveValue = string;
@@ -0,0 +1 @@
1
+ export type ContentSecurityPolicyHeaderValue = string;
@@ -0,0 +1,6 @@
1
+ import type { DomainName } from "./DomainName.js";
2
+ import type { SiteDomainRegistrationRequestRid } from "./SiteDomainRegistrationRequestRid.js";
3
+ export interface ControlPanelManagedDomainInfo {
4
+ requestRid: SiteDomainRegistrationRequestRid;
5
+ siteDomain: DomainName;
6
+ }
@@ -0,0 +1,7 @@
1
+ import type { DomainName } from "./DomainName.js";
2
+ import type { SiteVersion } from "./SiteVersion.js";
3
+ export interface DeploySiteRequest {
4
+ repositoryRid: string;
5
+ siteDomain: DomainName;
6
+ siteVersion: SiteVersion;
7
+ }
@@ -0,0 +1,6 @@
1
+ import type { DomainName } from "./DomainName.js";
2
+ import type { SiteVersion } from "./SiteVersion.js";
3
+ export interface DeploymentInfo {
4
+ siteDomain: DomainName;
5
+ siteVersion: SiteVersion;
6
+ }
@@ -0,0 +1,3 @@
1
+ export interface DomainName {
2
+ domain: string;
3
+ }
@@ -0,0 +1,4 @@
1
+ import type { DomainName } from "./DomainName.js";
2
+ export interface PreviewContentSecurityPolicyRequest {
3
+ baseDomain: DomainName;
4
+ }
@@ -0,0 +1,6 @@
1
+ import type { ControlPanelManagedDomainInfo } from "./ControlPanelManagedDomainInfo.js";
2
+ export interface SiteDomainInfo_controlPanelManaged {
3
+ type: "controlPanelManaged";
4
+ controlPanelManaged: ControlPanelManagedDomainInfo;
5
+ }
6
+ export type SiteDomainInfo = SiteDomainInfo_controlPanelManaged;
@@ -0,0 +1 @@
1
+ export type SiteDomainRegistrationRequestRid = string;
@@ -0,0 +1,3 @@
1
+ export interface SiteVersion {
2
+ version: string;
3
+ }
@@ -0,0 +1,2 @@
1
+ import { type ConjureContext } from "conjure-lite";
2
+ export declare function getRegisteredDomains(ctx: ConjureContext): Promise<Array<string>>;
@@ -0,0 +1 @@
1
+ export { getRegisteredDomains } from "./SitesDomainRegistryService/getRegisteredDomains.js";
@@ -0,0 +1,7 @@
1
+ import type { DomainName } from "./DomainName.js";
2
+ export interface SubmitDomainRegistrationRequest {
3
+ siteDomain: DomainName;
4
+ baseDomain: DomainName;
5
+ requestTitle: string;
6
+ requestDescription: string | undefined;
7
+ }
@@ -0,0 +1,4 @@
1
+ import type { DomainName } from "./DomainName.js";
2
+ export interface UnregisterDomainRequest {
3
+ siteDomain: DomainName;
4
+ }
@@ -0,0 +1,4 @@
1
+ import type { SiteVersion } from "./SiteVersion.js";
2
+ export interface UpdateDeployedVersionRequest {
3
+ siteVersion: SiteVersion;
4
+ }
@@ -0,0 +1,18 @@
1
+ export * as ArtifactsSitesAdminService from "./ArtifactsSitesAdminService.js";
2
+ export * as ArtifactsSitesAdminV2Service from "./ArtifactsSitesAdminV2Service.js";
3
+ export * as SitesDomainRegistryService from "./SitesDomainRegistryService.js";
4
+ export type { ContentSecurityPolicyAdditions } from "./ContentSecurityPolicyAdditions.js";
5
+ export type { ContentSecurityPolicyDirectiveName } from "./ContentSecurityPolicyDirectiveName.js";
6
+ export type { ContentSecurityPolicyDirectiveValue } from "./ContentSecurityPolicyDirectiveValue.js";
7
+ export type { ContentSecurityPolicyHeaderValue } from "./ContentSecurityPolicyHeaderValue.js";
8
+ export type { ControlPanelManagedDomainInfo } from "./ControlPanelManagedDomainInfo.js";
9
+ export type { DeploymentInfo } from "./DeploymentInfo.js";
10
+ export type { DeploySiteRequest } from "./DeploySiteRequest.js";
11
+ export type { DomainName } from "./DomainName.js";
12
+ export type { PreviewContentSecurityPolicyRequest } from "./PreviewContentSecurityPolicyRequest.js";
13
+ export type { SiteDomainInfo } from "./SiteDomainInfo.js";
14
+ export type { SiteDomainRegistrationRequestRid } from "./SiteDomainRegistrationRequestRid.js";
15
+ export type { SiteVersion } from "./SiteVersion.js";
16
+ export type { SubmitDomainRegistrationRequest } from "./SubmitDomainRegistrationRequest.js";
17
+ export type { UnregisterDomainRequest } from "./UnregisterDomainRequest.js";
18
+ export type { UpdateDeployedVersionRequest } from "./UpdateDeployedVersionRequest.js";
@@ -1 +1 @@
1
- export { cli } from "./cli";
1
+ export { cli } from "./cli.js";
@@ -0,0 +1,3 @@
1
+ export interface SiteAssetVersions {
2
+ versions: string[];
3
+ }
@@ -0,0 +1,2 @@
1
+ import type { ThirdPartyAppRid } from "../../ThirdPartyAppRid.js";
2
+ export declare function deleteSiteVersion(baseUrl: string, thirdPartyAppRid: ThirdPartyAppRid, version: string): Promise<boolean>;
@@ -0,0 +1,2 @@
1
+ import type { ThirdPartyAppRid } from "../../ThirdPartyAppRid.js";
2
+ export declare function fetchSiteVersions(baseUrl: string, thirdPartyAppRid: ThirdPartyAppRid): Promise<string[]>;
@@ -0,0 +1,4 @@
1
+ export { deleteSiteVersion } from "./deleteSiteVersion.mjs";
2
+ export { fetchSiteVersions } from "./fetchSiteVersions.mjs";
3
+ export type { SiteAssetVersions } from "./SiteAssetVersions.mjs";
4
+ export { uploadZippedSiteAsset } from "./uploadSiteVersion.mjs";
@@ -1,5 +1,2 @@
1
- import type { ThirdPartyAppRid } from "./ThirdPartyAppRid.js";
2
- export interface SiteAssetVersions {
3
- versions: string[];
4
- }
1
+ import type { ThirdPartyAppRid } from "../../ThirdPartyAppRid.js";
5
2
  export declare function uploadZippedSiteAsset(baseUrl: string, thirdPartyAppRid: ThirdPartyAppRid, version: string, zipFile: ReadableStream | Blob | BufferSource): Promise<boolean>;
@@ -0,0 +1 @@
1
+ export * as SiteAssetArtifactsService from "./SiteAssetArtifactsService/index.mjs";
@@ -0,0 +1,2 @@
1
+ import type { ConjureContext } from "conjure-lite";
2
+ export declare function createConjureContext(baseUrl: string, servicePath: "/artifacts/api"): ConjureContext;
@@ -0,0 +1,4 @@
1
+ export { ArtifactsSitesAdminV2Service } from "../generated/artifacts-sites/index.js";
2
+ export * as artifacts from "./artifacts/index.mjs";
3
+ export { createConjureContext } from "./createConjureContext.mjs";
4
+ export * as thirdPartyApplicationService from "./third-party-application-service/index.mjs";
@@ -1,3 +1,3 @@
1
- import type { RepositoryRid } from "./RepositoryRid.js";
2
- import type { ThirdPartyAppRid } from "./ThirdPartyAppRid.js";
1
+ import type { RepositoryRid } from "../RepositoryRid.js";
2
+ import type { ThirdPartyAppRid } from "../ThirdPartyAppRid.js";
3
3
  export declare function fetchWebsiteRepositoryRid(baseUrl: string, thirdPartyAppRid: ThirdPartyAppRid): Promise<RepositoryRid>;
@@ -0,0 +1 @@
1
+ export { fetchWebsiteRepositoryRid } from "./fetchWebsiteRepositoryRid.mjs";
@@ -0,0 +1 @@
1
+ export declare function readCliVersionFromPackageJson(): Promise<string>;
@@ -0,0 +1,2 @@
1
+ import type { CliCommonArgs } from "../CliCommonArgs.js";
2
+ export declare function logVersionMiddleware(args: CliCommonArgs): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdk/cli",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "",
5
5
  "access": "public",
6
6
  "license": "Apache-2.0",
@@ -18,9 +18,11 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "archiver": "^6.0.1",
21
+ "conjure-lite": "0.0.5",
21
22
  "consola": "^3.2.3",
23
+ "find-up": "^6.3.0",
22
24
  "yargs": "^17.7.2",
23
- "@osdk/api": "0.0.7"
25
+ "@osdk/api": "0.0.9"
24
26
  },
25
27
  "devDependencies": {
26
28
  "@types/archiver": "^6.0.0",
@@ -34,6 +36,9 @@
34
36
  "publishConfig": {
35
37
  "access": "public"
36
38
  },
39
+ "imports": {
40
+ "#net": "./src/net/index.mts"
41
+ },
37
42
  "keywords": [],
38
43
  "bin": {
39
44
  "osdk": "./build/js/cli.js"
@@ -44,6 +49,7 @@
44
49
  "CHANGELOG.md",
45
50
  "package.json"
46
51
  ],
52
+ "type": "module",
47
53
  "scripts": {
48
54
  "clean": "rm -rf lib dist types build tsconfig.tsbuildinfo",
49
55
  "dev:transpile": "tsup --watch",
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- var r=class extends Error{constructor(e,o){super(o),this.errorCode=e;}};
4
-
5
- exports.a = r;
6
- //# sourceMappingURL=out.js.map
7
- //# sourceMappingURL=chunk-2DJZUIFP.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/ExitProcessError.ts"],"names":["ExitProcessError","errorCode","msg"],"mappings":"AAgBO,IAAMA,EAAN,cAA+B,KAAM,CAC1C,YAAYC,EAAWC,EAAK,CAC1B,MAAMA,CAAG,EACT,KAAK,UAAYD,CACnB,CACF","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\nexport class ExitProcessError extends Error {\n constructor(errorCode, msg) {\n super(msg);\n this.errorCode = errorCode;\n }\n}"]}
@@ -1,13 +0,0 @@
1
- 'use strict';
2
-
3
- var utils = require('@osdk/api/utils');
4
- var consola = require('consola');
5
-
6
- function c(e,o=fetch){return utils.createFetchHeaderMutator(u(o),async t=>{let s=await e();return t.set("Authorization",`Bearer ${s}`),t.set("Fetch-User-Agent",""),t})}function u(e=fetch){return function(t,s){return typeof t=="string"||t instanceof URL?consola.consola.debug(`${s?.method??"GET"}: ${t.toString().trim()}`):consola.consola.debug(`${t.method??"GET"}: ${t.url.toString().trim()}`),e(t,s).then(r=>(consola.consola.debug("Finished fetch"),r))}}async function $(e,o){let t=c(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN),s=`
7
- ${e}/third-party-application-service/api/application-websites/${o}`,r=await t(s);if(r.status>=200&&r.status<300){let i=await r.json();return consola.consola.debug(`Repository RID: ${i}`),i}throw new Error(`Unexpected response code ${r.status} (${r.statusText})`)}function b(e,o){return `${e}/artifacts/api/repositories/${o}/contents/release/siteasset`}
8
-
9
- exports.a = c;
10
- exports.b = $;
11
- exports.c = b;
12
- //# sourceMappingURL=out.js.map
13
- //# sourceMappingURL=chunk-6PVNK2PW.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/net/createFetch.mts","../../src/net/fetchWebsiteRepositoryRid.mts","../../src/net/getSiteAssetBaseUrl.mts"],"names":["createFetchHeaderMutator","consola","createFetch","tokenProvider","fetchFn","createDebugLoggingFetch","headers","token","input","init","a","fetchWebsiteRepositoryRid","baseUrl","thirdPartyAppRid","fetch","url","result","repositoryRid","getSiteAssetBaseUrl","foundryBaseUrl"],"mappings":"AAgBA,OAAS,4BAAAA,MAAgC,kBACzC,OAAS,WAAAC,MAAe,UACjB,SAASC,EAAYC,EAAeC,EAAU,MAAO,CAC1D,OAAOJ,EAAyBK,EAAwBD,CAAO,EAAG,MAAME,GAAW,CACjF,IAAMC,EAAQ,MAAMJ,EAAc,EAClC,OAAAG,EAAQ,IAAI,gBAAiB,UAAUC,CAAK,EAAE,EAC9CD,EAAQ,IAAI,mBAAoB,EAAE,EAC3BA,CACT,CAAC,CACH,CACA,SAASD,EAAwBD,EAAU,MAAO,CAChD,OAAO,SAA2BI,EAAOC,EAAM,CAC7C,OAAI,OAAOD,GAAU,UAAYA,aAAiB,IAChDP,EAAQ,MAAM,GAAGQ,GAAM,QAAU,KAAK,KAAKD,EAAM,SAAS,EAAE,KAAK,CAAC,EAAE,EAEpEP,EAAQ,MAAM,GAAGO,EAAM,QAAU,KAAK,KAAKA,EAAM,IAAI,SAAS,EAAE,KAAK,CAAC,EAAE,EAEnEJ,EAAQI,EAAOC,CAAI,EAAE,KAAKC,IAC/BT,EAAQ,MAAM,gBAAgB,EACvBS,EACR,CACH,CACF,CCtBA,OAAS,WAAAT,MAAe,UAExB,eAAsBU,EAA0BC,EAASC,EAAkB,CACzE,IAAMC,EAAQZ,EAAY,IAAM,QAAQ,IAAI,sBAAsB,EAC5Da,EAAM;AAAA,MACRH,CAAO,6DAA6DC,CAAgB,GAClFG,EAAS,MAAMF,EAAMC,CAAG,EAC9B,GAAIC,EAAO,QAAU,KAAOA,EAAO,OAAS,IAAK,CAC/C,IAAMC,EAAgB,MAAMD,EAAO,KAAK,EACxC,OAAAf,EAAQ,MAAM,mBAAmBgB,CAAa,EAAE,EACzCA,CACT,CACA,MAAM,IAAI,MAAM,4BAA4BD,EAAO,MAAM,KAAKA,EAAO,UAAU,GAAG,CACpF,CCbO,SAASE,EAAoBC,EAAgBF,EAAe,CACjE,MAAO,GAAGE,CAAc,+BAA+BF,CAAa,6BACtE","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 { createFetchHeaderMutator } from \"@osdk/api/utils\";\nimport { consola } from \"consola\";\nexport function createFetch(tokenProvider, fetchFn = fetch) {\n return createFetchHeaderMutator(createDebugLoggingFetch(fetchFn), async headers => {\n const token = await tokenProvider();\n headers.set(\"Authorization\", `Bearer ${token}`);\n headers.set(\"Fetch-User-Agent\", \"\");\n return headers;\n });\n}\nfunction createDebugLoggingFetch(fetchFn = fetch) {\n return function debugLoggingFetch(input, init) {\n if (typeof input === \"string\" || input instanceof URL) {\n consola.debug(`${init?.method ?? \"GET\"}: ${input.toString().trim()}`);\n } else {\n consola.debug(`${input.method ?? \"GET\"}: ${input.url.toString().trim()}`);\n }\n return fetchFn(input, init).then(a => {\n consola.debug(\"Finished fetch\");\n return a;\n });\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 { consola } from \"consola\";\nimport { createFetch } from \"./createFetch.mjs\";\nexport async function fetchWebsiteRepositoryRid(baseUrl, thirdPartyAppRid) {\n const fetch = createFetch(() => process.env.FOUNDRY_SDK_AUTH_TOKEN);\n const url = `\n ${baseUrl}/third-party-application-service/api/application-websites/${thirdPartyAppRid}`;\n const result = await fetch(url);\n if (result.status >= 200 && result.status < 300) {\n const repositoryRid = await result.json();\n consola.debug(`Repository RID: ${repositoryRid}`);\n return repositoryRid;\n }\n throw new Error(`Unexpected response code ${result.status} (${result.statusText})`);\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\nexport function getSiteAssetBaseUrl(foundryBaseUrl, repositoryRid) {\n return `${foundryBaseUrl}/artifacts/api/repositories/${repositoryRid}/contents/release/siteasset`;\n}"]}
@@ -1,5 +0,0 @@
1
- var r=class extends Error{constructor(e,o){super(o),this.errorCode=e;}};
2
-
3
- export { r as a };
4
- //# sourceMappingURL=out.js.map
5
- //# sourceMappingURL=chunk-MGT3UGXW.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/ExitProcessError.ts"],"names":["ExitProcessError","errorCode","msg"],"mappings":"AAgBO,IAAMA,EAAN,cAA+B,KAAM,CAC1C,YAAYC,EAAWC,EAAK,CAC1B,MAAMA,CAAG,EACT,KAAK,UAAYD,CACnB,CACF","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\nexport class ExitProcessError extends Error {\n constructor(errorCode, msg) {\n super(msg);\n this.errorCode = errorCode;\n }\n}"]}
@@ -1,9 +0,0 @@
1
- import { createFetchHeaderMutator } from '@osdk/api/utils';
2
- import { consola } from 'consola';
3
-
4
- function c(e,o=fetch){return createFetchHeaderMutator(u(o),async t=>{let s=await e();return t.set("Authorization",`Bearer ${s}`),t.set("Fetch-User-Agent",""),t})}function u(e=fetch){return function(t,s){return typeof t=="string"||t instanceof URL?consola.debug(`${s?.method??"GET"}: ${t.toString().trim()}`):consola.debug(`${t.method??"GET"}: ${t.url.toString().trim()}`),e(t,s).then(r=>(consola.debug("Finished fetch"),r))}}async function $(e,o){let t=c(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN),s=`
5
- ${e}/third-party-application-service/api/application-websites/${o}`,r=await t(s);if(r.status>=200&&r.status<300){let i=await r.json();return consola.debug(`Repository RID: ${i}`),i}throw new Error(`Unexpected response code ${r.status} (${r.statusText})`)}function b(e,o){return `${e}/artifacts/api/repositories/${o}/contents/release/siteasset`}
6
-
7
- export { c as a, $ as b, b as c };
8
- //# sourceMappingURL=out.js.map
9
- //# sourceMappingURL=chunk-YEWM6TCR.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/net/createFetch.mts","../../src/net/fetchWebsiteRepositoryRid.mts","../../src/net/getSiteAssetBaseUrl.mts"],"names":["createFetchHeaderMutator","consola","createFetch","tokenProvider","fetchFn","createDebugLoggingFetch","headers","token","input","init","a","fetchWebsiteRepositoryRid","baseUrl","thirdPartyAppRid","fetch","url","result","repositoryRid","getSiteAssetBaseUrl","foundryBaseUrl"],"mappings":"AAgBA,OAAS,4BAAAA,MAAgC,kBACzC,OAAS,WAAAC,MAAe,UACjB,SAASC,EAAYC,EAAeC,EAAU,MAAO,CAC1D,OAAOJ,EAAyBK,EAAwBD,CAAO,EAAG,MAAME,GAAW,CACjF,IAAMC,EAAQ,MAAMJ,EAAc,EAClC,OAAAG,EAAQ,IAAI,gBAAiB,UAAUC,CAAK,EAAE,EAC9CD,EAAQ,IAAI,mBAAoB,EAAE,EAC3BA,CACT,CAAC,CACH,CACA,SAASD,EAAwBD,EAAU,MAAO,CAChD,OAAO,SAA2BI,EAAOC,EAAM,CAC7C,OAAI,OAAOD,GAAU,UAAYA,aAAiB,IAChDP,EAAQ,MAAM,GAAGQ,GAAM,QAAU,KAAK,KAAKD,EAAM,SAAS,EAAE,KAAK,CAAC,EAAE,EAEpEP,EAAQ,MAAM,GAAGO,EAAM,QAAU,KAAK,KAAKA,EAAM,IAAI,SAAS,EAAE,KAAK,CAAC,EAAE,EAEnEJ,EAAQI,EAAOC,CAAI,EAAE,KAAKC,IAC/BT,EAAQ,MAAM,gBAAgB,EACvBS,EACR,CACH,CACF,CCtBA,OAAS,WAAAT,MAAe,UAExB,eAAsBU,EAA0BC,EAASC,EAAkB,CACzE,IAAMC,EAAQZ,EAAY,IAAM,QAAQ,IAAI,sBAAsB,EAC5Da,EAAM;AAAA,MACRH,CAAO,6DAA6DC,CAAgB,GAClFG,EAAS,MAAMF,EAAMC,CAAG,EAC9B,GAAIC,EAAO,QAAU,KAAOA,EAAO,OAAS,IAAK,CAC/C,IAAMC,EAAgB,MAAMD,EAAO,KAAK,EACxC,OAAAf,EAAQ,MAAM,mBAAmBgB,CAAa,EAAE,EACzCA,CACT,CACA,MAAM,IAAI,MAAM,4BAA4BD,EAAO,MAAM,KAAKA,EAAO,UAAU,GAAG,CACpF,CCbO,SAASE,EAAoBC,EAAgBF,EAAe,CACjE,MAAO,GAAGE,CAAc,+BAA+BF,CAAa,6BACtE","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 { createFetchHeaderMutator } from \"@osdk/api/utils\";\nimport { consola } from \"consola\";\nexport function createFetch(tokenProvider, fetchFn = fetch) {\n return createFetchHeaderMutator(createDebugLoggingFetch(fetchFn), async headers => {\n const token = await tokenProvider();\n headers.set(\"Authorization\", `Bearer ${token}`);\n headers.set(\"Fetch-User-Agent\", \"\");\n return headers;\n });\n}\nfunction createDebugLoggingFetch(fetchFn = fetch) {\n return function debugLoggingFetch(input, init) {\n if (typeof input === \"string\" || input instanceof URL) {\n consola.debug(`${init?.method ?? \"GET\"}: ${input.toString().trim()}`);\n } else {\n consola.debug(`${input.method ?? \"GET\"}: ${input.url.toString().trim()}`);\n }\n return fetchFn(input, init).then(a => {\n consola.debug(\"Finished fetch\");\n return a;\n });\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 { consola } from \"consola\";\nimport { createFetch } from \"./createFetch.mjs\";\nexport async function fetchWebsiteRepositoryRid(baseUrl, thirdPartyAppRid) {\n const fetch = createFetch(() => process.env.FOUNDRY_SDK_AUTH_TOKEN);\n const url = `\n ${baseUrl}/third-party-application-service/api/application-websites/${thirdPartyAppRid}`;\n const result = await fetch(url);\n if (result.status >= 200 && result.status < 300) {\n const repositoryRid = await result.json();\n consola.debug(`Repository RID: ${repositoryRid}`);\n return repositoryRid;\n }\n throw new Error(`Unexpected response code ${result.status} (${result.statusText})`);\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\nexport function getSiteAssetBaseUrl(foundryBaseUrl, repositoryRid) {\n return `${foundryBaseUrl}/artifacts/api/repositories/${repositoryRid}/contents/release/siteasset`;\n}"]}
@@ -1,9 +0,0 @@
1
- import { a as a$1 } from './chunk-MGT3UGXW.mjs';
2
- import c from 'yargs';
3
- import { hideBin } from 'yargs/helpers';
4
-
5
- var d={command:"upload",describe:"Upload an application version",builder:o=>o.option("siteVersion",{type:"string",demandOption:!0}).option("dir",{type:"string"}),handler:async o=>{await(await import('./siteUploadCommand-L3QDNVWX.mjs')).default(o);}},i=d;var s={command:"versions",describe:"List application versions",builder:o=>o,handler:async o=>{await(await import('./siteVersionsCommand-BQMPCMGZ.mjs')).default(o);}},m=s;function a(o){return o.command("site","Manage your site",t=>{let r=t.options({appRid:{type:"string",demandOption:!0,coerce:n=>n},baseUrl:{type:"string",demandOption:!0}}).demandCommand();return r.command(m),r.command(i),r},t=>{})}async function u(o=process.argv){let t=c(hideBin(o)).env("OSDK"),r=await import('consola');a(t),t.demandCommand().strict();try{return t.parseAsync()}catch(n){n instanceof a$1&&r.consola.error(n.message);}}
6
-
7
- export { u as cli };
8
- //# sourceMappingURL=out.js.map
9
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/cli.ts","../../src/commands/site/upload/index.ts","../../src/commands/site/versions/index.ts","../../src/commands/site/addSiteCommand.ts"],"names":["yargs","hideBin","command","argv","args","upload_default","versions_default","addSiteCommand","originalYargs","a","cli","base","Consola","e","ExitProcessError"],"mappings":"yCAgBA,OAAOA,MAAW,QAClB,OAAS,WAAAC,MAAe,gBCDjB,IAAMC,EAAU,CACrB,QAAS,SACT,SAAU,gCACV,QAASC,GACAA,EAAK,OAAO,cAAe,CAChC,KAAM,SACN,aAAc,EAChB,CAAC,EAAE,OAAO,MAAO,CACf,KAAM,QACR,CAAC,EAEH,QAAS,MAAMC,GAAQ,CAErB,MADgB,KAAM,QAAO,kCAAyB,GACxC,QAAQA,CAAI,CAC5B,CACF,EACOC,EAAQH,EChBR,IAAMA,EAAU,CACrB,QAAS,WACT,SAAU,4BACV,QAASC,GACAA,EAET,QAAS,MAAMC,GAAQ,CAErB,MADgB,KAAM,QAAO,oCAA2B,GAC1C,QAAQA,CAAI,CAC5B,CACF,EACOE,EAAQJ,ECTA,SAARK,EAAgCP,EAAO,CAC5C,OAAOA,EAAM,QAAQ,OAAQ,mBAAoBQ,GAAiB,CAChE,IAAMR,EAAQQ,EAAc,QAAQ,CAClC,OAAQ,CACN,KAAM,SACN,aAAc,GACd,OAAQC,GAAKA,CACf,EACA,QAAS,CACP,KAAM,SACN,aAAc,EAChB,CACF,CAAC,EAAE,cAAc,EACjB,OAAAT,EAAM,QAAQM,CAAQ,EACtBN,EAAM,QAAQK,CAAM,EACbL,CACT,EAAGI,GAAQ,CAAC,CAAC,CACf,CHfA,eAAsBM,EAAIN,EAAO,QAAQ,KAAM,CAC7C,IAAMO,EAAOX,EAAMC,EAAQG,CAAI,CAAC,EAAE,IAAI,MAAM,EACtCQ,EAAU,KAAM,QAAO,SAAS,EAGtCL,EAAeI,CAAI,EACnBA,EAAK,cAAc,EAAE,OAAO,EAC5B,GAAI,CACF,OAAOA,EAAK,WAAW,CACzB,OAASE,EAAG,CACNA,aAAaC,GACfF,EAAQ,QAAQ,MAAMC,EAAE,OAAO,CAEnC,CACF","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 yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport addSiteCommand from \"./commands/site/addSiteCommand\";\nimport { ExitProcessError } from \"./ExitProcessError.js\";\nexport async function cli(args = process.argv) {\n const base = yargs(hideBin(args)).env(\"OSDK\");\n const Consola = await import(\"consola\");\n // Consola.default.level = Consola.LogLevels.debug;\n\n addSiteCommand(base);\n base.demandCommand().strict();\n try {\n return base.parseAsync();\n } catch (e) {\n if (e instanceof ExitProcessError) {\n Consola.consola.error(e.message);\n }\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\nexport const command = {\n command: \"upload\",\n describe: \"Upload an application version\",\n builder: argv => {\n return argv.option(\"siteVersion\", {\n type: \"string\",\n demandOption: true\n }).option(\"dir\", {\n type: \"string\"\n });\n },\n handler: async args => {\n const command = await import(\"./siteUploadCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\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\nexport const command = {\n command: \"versions\",\n describe: \"List application versions\",\n builder: argv => {\n return argv;\n },\n handler: async args => {\n const command = await import(\"./siteVersionsCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\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 upload from \"./upload\";\nimport versions from \"./versions\";\nexport default function addSiteCommand(yargs) {\n return yargs.command(\"site\", \"Manage your site\", originalYargs => {\n const yargs = originalYargs.options({\n appRid: {\n type: \"string\",\n demandOption: true,\n coerce: a => a\n },\n baseUrl: {\n type: \"string\",\n demandOption: true\n }\n }).demandCommand();\n yargs.command(versions);\n yargs.command(upload);\n return yargs;\n }, args => {});\n}"]}