@elevasis/sdk 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +59 -3
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -40701,12 +40701,19 @@ function registerDescribeCommand(program3) {
|
|
|
40701
40701
|
// src/cli/commands/init.ts
|
|
40702
40702
|
var import_path3 = require("path");
|
|
40703
40703
|
var import_promises2 = require("fs/promises");
|
|
40704
|
+
|
|
40705
|
+
// src/cli/version.ts
|
|
40706
|
+
var SDK_VERSION = "0.3.3";
|
|
40707
|
+
|
|
40708
|
+
// src/cli/commands/init.ts
|
|
40704
40709
|
var SCAFFOLD_FILES = [
|
|
40705
40710
|
"elevasis.config.ts",
|
|
40706
40711
|
"package.json",
|
|
40712
|
+
"pnpm-workspace.yaml",
|
|
40707
40713
|
"tsconfig.json",
|
|
40708
40714
|
".env",
|
|
40709
40715
|
".gitignore",
|
|
40716
|
+
"README.md",
|
|
40710
40717
|
"src/index.ts"
|
|
40711
40718
|
];
|
|
40712
40719
|
function registerInitCommand(program3) {
|
|
@@ -40735,9 +40742,11 @@ function registerInitCommand(program3) {
|
|
|
40735
40742
|
const files = {
|
|
40736
40743
|
"elevasis.config.ts": configTemplate(orgSlug),
|
|
40737
40744
|
"package.json": packageJsonTemplate(orgSlug),
|
|
40745
|
+
"pnpm-workspace.yaml": pnpmWorkspaceTemplate(),
|
|
40738
40746
|
"tsconfig.json": tsconfigTemplate(),
|
|
40739
40747
|
".env": envTemplate(),
|
|
40740
40748
|
".gitignore": gitignoreTemplate(),
|
|
40749
|
+
"README.md": readmeTemplate(orgSlug),
|
|
40741
40750
|
"src/index.ts": starterTemplate()
|
|
40742
40751
|
};
|
|
40743
40752
|
for (const [filePath, content] of Object.entries(files)) {
|
|
@@ -40749,7 +40758,7 @@ function registerInitCommand(program3) {
|
|
|
40749
40758
|
if (directory) {
|
|
40750
40759
|
console.log(source_default.gray(` cd ${directory}`));
|
|
40751
40760
|
}
|
|
40752
|
-
console.log(source_default.gray("
|
|
40761
|
+
console.log(source_default.gray(" pnpm install"));
|
|
40753
40762
|
console.log(source_default.gray(" # Add your ELEVASIS_API_KEY to .env"));
|
|
40754
40763
|
console.log(source_default.gray(" elevasis check"));
|
|
40755
40764
|
console.log(source_default.gray(" elevasis deploy"));
|
|
@@ -40777,7 +40786,7 @@ function packageJsonTemplate(organization) {
|
|
|
40777
40786
|
deploy: "elevasis deploy"
|
|
40778
40787
|
},
|
|
40779
40788
|
dependencies: {
|
|
40780
|
-
"@elevasis/sdk":
|
|
40789
|
+
"@elevasis/sdk": `^${SDK_VERSION}`
|
|
40781
40790
|
},
|
|
40782
40791
|
devDependencies: {
|
|
40783
40792
|
typescript: "5.9.2",
|
|
@@ -40785,6 +40794,10 @@ function packageJsonTemplate(organization) {
|
|
|
40785
40794
|
}
|
|
40786
40795
|
}, null, 2) + "\n";
|
|
40787
40796
|
}
|
|
40797
|
+
function pnpmWorkspaceTemplate() {
|
|
40798
|
+
return `packages: []
|
|
40799
|
+
`;
|
|
40800
|
+
}
|
|
40788
40801
|
function tsconfigTemplate() {
|
|
40789
40802
|
return JSON.stringify({
|
|
40790
40803
|
compilerOptions: {
|
|
@@ -40815,6 +40828,49 @@ function gitignoreTemplate() {
|
|
|
40815
40828
|
dist/
|
|
40816
40829
|
`;
|
|
40817
40830
|
}
|
|
40831
|
+
function readmeTemplate(organization) {
|
|
40832
|
+
return `# ${organization}
|
|
40833
|
+
|
|
40834
|
+
An [Elevasis](https://elevasis.io) project built with the \`@elevasis/sdk\`.
|
|
40835
|
+
|
|
40836
|
+
## Setup
|
|
40837
|
+
|
|
40838
|
+
\`\`\`bash
|
|
40839
|
+
pnpm install
|
|
40840
|
+
\`\`\`
|
|
40841
|
+
|
|
40842
|
+
Add your API key to \`.env\`:
|
|
40843
|
+
|
|
40844
|
+
\`\`\`
|
|
40845
|
+
ELEVASIS_API_KEY=sk_...
|
|
40846
|
+
\`\`\`
|
|
40847
|
+
|
|
40848
|
+
## Development
|
|
40849
|
+
|
|
40850
|
+
\`\`\`bash
|
|
40851
|
+
# Validate resources (checks schemas, config, and structure)
|
|
40852
|
+
elevasis check
|
|
40853
|
+
|
|
40854
|
+
# Deploy to the platform
|
|
40855
|
+
elevasis deploy
|
|
40856
|
+
|
|
40857
|
+
# Execute a resource
|
|
40858
|
+
elevasis exec <resourceId> --input '{"key": "value"}'
|
|
40859
|
+
|
|
40860
|
+
# List deployed resources
|
|
40861
|
+
elevasis resources
|
|
40862
|
+
|
|
40863
|
+
# View execution history
|
|
40864
|
+
elevasis executions <resourceId>
|
|
40865
|
+
\`\`\`
|
|
40866
|
+
|
|
40867
|
+
## Project Structure
|
|
40868
|
+
|
|
40869
|
+
- \`elevasis.config.ts\` -- Organization config
|
|
40870
|
+
- \`src/index.ts\` -- Resource definitions (workflows, agents)
|
|
40871
|
+
- \`.env\` -- API key and environment variables
|
|
40872
|
+
`;
|
|
40873
|
+
}
|
|
40818
40874
|
function starterTemplate() {
|
|
40819
40875
|
return `import type { WorkflowDefinition, OrganizationResources } from '@elevasis/sdk'
|
|
40820
40876
|
import { z } from 'zod'
|
|
@@ -40877,7 +40933,7 @@ Commands:
|
|
|
40877
40933
|
elevasis init [directory] Scaffold a new project
|
|
40878
40934
|
|
|
40879
40935
|
Use "elevasis <command> --help" for more information about a command.`
|
|
40880
|
-
).version(
|
|
40936
|
+
).version(SDK_VERSION);
|
|
40881
40937
|
registerCheckCommand(program2);
|
|
40882
40938
|
registerDeployCommand(program2);
|
|
40883
40939
|
registerExecCommand(program2);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elevasis/sdk",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "SDK for building Elevasis organization resources",
|
|
5
5
|
"comment:bin": "IMPORTANT: This package shares the 'elevasis' binary name with @repo/cli. They never conflict because @elevasis/sdk must NEVER be added as a dependency of any workspace package (apps/*, packages/*, organizations/*). Workspace projects use @repo/cli for the 'elevasis' binary. External developers (outside the workspace) get this SDK's binary via npm install.",
|
|
6
6
|
"type": "module",
|