@ar.io/deploy 0.1.0-alpha.20260610213851.5857f96
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/LICENSE +21 -0
- package/README.md +753 -0
- package/bin/dev.js +5 -0
- package/bin/run.js +5 -0
- package/dist/chunks/cache-C1tEeUx2.js +6 -0
- package/dist/chunks/cache-C1tEeUx2.js.map +1 -0
- package/dist/chunks/display-DRcjDj9k.js +104 -0
- package/dist/chunks/display-DRcjDj9k.js.map +1 -0
- package/dist/chunks/upload-workflow-DSS5FIa5.js +204 -0
- package/dist/chunks/upload-workflow-DSS5FIa5.js.map +1 -0
- package/dist/chunks/uploader-B2tC-1Qw.js +472 -0
- package/dist/chunks/uploader-B2tC-1Qw.js.map +1 -0
- package/dist/commands/deploy.js +238 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/upload.js +126 -0
- package/dist/commands/upload.js.map +1 -0
- package/dist/constants/flags.js +268 -0
- package/dist/constants/flags.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/arns.js +86 -0
- package/dist/prompts/arns.js.map +1 -0
- package/dist/prompts/deployment.js +27 -0
- package/dist/prompts/deployment.js.map +1 -0
- package/dist/prompts/wallet.js +55 -0
- package/dist/prompts/wallet.js.map +1 -0
- package/dist/src/commands/deploy.d.ts +9 -0
- package/dist/src/commands/deploy.d.ts.map +1 -0
- package/dist/src/commands/upload.d.ts +9 -0
- package/dist/src/commands/upload.d.ts.map +1 -0
- package/dist/src/constants/cache.d.ts +4 -0
- package/dist/src/constants/cache.d.ts.map +1 -0
- package/dist/src/constants/flags.d.ts +132 -0
- package/dist/src/constants/flags.d.ts.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/prompts/arns.d.ts +14 -0
- package/dist/src/prompts/arns.d.ts.map +1 -0
- package/dist/src/prompts/deployment.d.ts +6 -0
- package/dist/src/prompts/deployment.d.ts.map +1 -0
- package/dist/src/prompts/wallet.d.ts +26 -0
- package/dist/src/prompts/wallet.d.ts.map +1 -0
- package/dist/src/types/index.d.ts +31 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/utils/__tests__/cache.test.d.ts +2 -0
- package/dist/src/utils/__tests__/cache.test.d.ts.map +1 -0
- package/dist/src/utils/__tests__/constants.test.d.ts +2 -0
- package/dist/src/utils/__tests__/constants.test.d.ts.map +1 -0
- package/dist/src/utils/__tests__/display.test.d.ts +2 -0
- package/dist/src/utils/__tests__/display.test.d.ts.map +1 -0
- package/dist/src/utils/cache.d.ts +48 -0
- package/dist/src/utils/cache.d.ts.map +1 -0
- package/dist/src/utils/chalk.d.ts +9 -0
- package/dist/src/utils/chalk.d.ts.map +1 -0
- package/dist/src/utils/config-resolver.d.ts +72 -0
- package/dist/src/utils/config-resolver.d.ts.map +1 -0
- package/dist/src/utils/constants.d.ts +4 -0
- package/dist/src/utils/constants.d.ts.map +1 -0
- package/dist/src/utils/deploy-key.d.ts +15 -0
- package/dist/src/utils/deploy-key.d.ts.map +1 -0
- package/dist/src/utils/display.d.ts +7 -0
- package/dist/src/utils/display.d.ts.map +1 -0
- package/dist/src/utils/path.d.ts +5 -0
- package/dist/src/utils/path.d.ts.map +1 -0
- package/dist/src/utils/signer.d.ts +19 -0
- package/dist/src/utils/signer.d.ts.map +1 -0
- package/dist/src/utils/solana.d.ts +29 -0
- package/dist/src/utils/solana.d.ts.map +1 -0
- package/dist/src/utils/upload-types.d.ts +35 -0
- package/dist/src/utils/upload-types.d.ts.map +1 -0
- package/dist/src/utils/uploader.d.ts +50 -0
- package/dist/src/utils/uploader.d.ts.map +1 -0
- package/dist/src/utils/validators.d.ts +21 -0
- package/dist/src/utils/validators.d.ts.map +1 -0
- package/dist/src/workflows/upload-workflow.d.ts +28 -0
- package/dist/src/workflows/upload-workflow.d.ts.map +1 -0
- package/dist/tests/constants.d.ts +11 -0
- package/dist/tests/constants.d.ts.map +1 -0
- package/dist/tests/e2e/deploy-command.test.d.ts +2 -0
- package/dist/tests/e2e/deploy-command.test.d.ts.map +1 -0
- package/dist/tests/global-setup.d.ts +6 -0
- package/dist/tests/global-setup.d.ts.map +1 -0
- package/dist/tests/mocks/turbo-handlers.d.ts +106 -0
- package/dist/tests/mocks/turbo-handlers.d.ts.map +1 -0
- package/dist/tests/setup.d.ts +11 -0
- package/dist/tests/setup.d.ts.map +1 -0
- package/dist/tests/types/payment-service.d.ts +218 -0
- package/dist/tests/types/payment-service.d.ts.map +1 -0
- package/dist/tests/types/upload-service.d.ts +168 -0
- package/dist/tests/types/upload-service.d.ts.map +1 -0
- package/dist/tests/unit/deploy-key.test.d.ts +2 -0
- package/dist/tests/unit/deploy-key.test.d.ts.map +1 -0
- package/dist/tests/unit/signer.test.d.ts +2 -0
- package/dist/tests/unit/signer.test.d.ts.map +1 -0
- package/dist/tests/unit/solana.test.d.ts +2 -0
- package/dist/tests/unit/solana.test.d.ts.map +1 -0
- package/dist/tests/unit/uploader-tags.test.d.ts +2 -0
- package/dist/tests/unit/uploader-tags.test.d.ts.map +1 -0
- package/dist/tests/unit/validators.test.d.ts +2 -0
- package/dist/tests/unit/validators.test.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/config-resolver.js +39 -0
- package/dist/utils/config-resolver.js.map +1 -0
- package/dist/utils/constants.js +6 -0
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/path.js +15 -0
- package/dist/utils/path.js.map +1 -0
- package/dist/utils/signer.js +45 -0
- package/dist/utils/signer.js.map +1 -0
- package/dist/utils/uploader.js +5 -0
- package/dist/utils/uploader.js.map +1 -0
- package/dist/utils/validators.js +43 -0
- package/dist/utils/validators.js.map +1 -0
- package/dist/workflows/upload-workflow.js +9 -0
- package/dist/workflows/upload-workflow.js.map +1 -0
- package/package.json +111 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
async function resolveConfig(flagConfigs, parsedFlags, options = {}) {
|
|
2
|
+
const { interactive, shouldBeInteractive } = options;
|
|
3
|
+
const isInteractive = interactive ?? (shouldBeInteractive ? shouldBeInteractive(parsedFlags) : false);
|
|
4
|
+
const resolved = {};
|
|
5
|
+
for (const [key, config] of Object.entries(flagConfigs)) {
|
|
6
|
+
const flagValue = parsedFlags[key];
|
|
7
|
+
if (flagValue !== void 0 && flagValue !== null && flagValue !== "") {
|
|
8
|
+
resolved[key] = config.transform ? config.transform(flagValue) : flagValue;
|
|
9
|
+
continue;
|
|
10
|
+
}
|
|
11
|
+
if (isInteractive && config.prompt) {
|
|
12
|
+
const promptValue = await config.prompt();
|
|
13
|
+
resolved[key] = config.transform ? config.transform(promptValue) : promptValue;
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
const defaultValue = config.flag.default;
|
|
17
|
+
if (typeof defaultValue === "function") {
|
|
18
|
+
resolved[key] = await defaultValue({});
|
|
19
|
+
} else if (defaultValue === void 0) {
|
|
20
|
+
resolved[key] = flagValue;
|
|
21
|
+
} else {
|
|
22
|
+
resolved[key] = defaultValue;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return resolved;
|
|
26
|
+
}
|
|
27
|
+
function createFlagConfig(config) {
|
|
28
|
+
return config;
|
|
29
|
+
}
|
|
30
|
+
function extractFlags(flagConfigs) {
|
|
31
|
+
const flags = {};
|
|
32
|
+
for (const [key, config] of Object.entries(flagConfigs)) {
|
|
33
|
+
flags[key] = config.flag;
|
|
34
|
+
}
|
|
35
|
+
return flags;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { createFlagConfig, extractFlags, resolveConfig };
|
|
39
|
+
//# sourceMappingURL=config-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-resolver.js","sources":["../../src/utils/config-resolver.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any --\n * This is a generic flag-config utility that holds a heterogeneous map of oclif\n * flag definitions (string/boolean/number/custom) keyed by name. The `any`s are\n * load-bearing: replacing them with the precise oclif `OptionFlag`/`FlagInput`\n * types breaks `static flags` integration and transform-function variance.\n * Concrete types are recovered at call sites via `ResolvedConfig<T>` inference.\n */\n\n/**\n * Configuration for a single flag with its associated prompt\n */\nexport type FlagConfig<T = any, F = any> = {\n /** The oclif flag definition */\n flag: F\n /** Optional prompt function to get the value interactively */\n prompt?: () => Promise<T>\n /** Transform function to apply to the resolved value */\n transform?: (value: T) => T\n /** Whether this flag triggers interactive mode when missing */\n triggersInteractive?: boolean\n}\n\n/**\n * Map of flag configurations\n */\nexport type FlagConfigMap = Record<string, FlagConfig<any, any>>\n\n/**\n * Extract the resolved config type from a FlagConfigMap\n * Infers the actual type (string, number, boolean) and optionality from each FlagConfig\n */\nexport type ResolvedConfig<T extends FlagConfigMap> = {\n [K in keyof T]: T[K] extends FlagConfig<infer U, any> ? U : any\n}\n\n/**\n * Options for resolveConfig\n */\nexport interface ResolveConfigOptions {\n /** Whether to run in interactive mode */\n interactive?: boolean\n /** Custom logic to determine if interactive mode should be enabled */\n shouldBeInteractive?: (parsedFlags: Record<string, any>) => boolean\n}\n\n/**\n * Resolves configuration by combining parsed CLI flags with interactive prompts\n *\n * @param flagConfigs - Map of flag names to their configurations\n * @param parsedFlags - Parsed flags from this.parse()\n * @param options - Resolution options\n * @returns Fully resolved configuration object\n *\n * @example\n * ```typescript\n * const config = await resolveConfig(\n * {\n * arnsName: {\n * flag: globalFlags.arnsName,\n * prompt: promptArnsName,\n * triggersInteractive: true,\n * },\n * wallet: {\n * flag: globalFlags.wallet,\n * prompt: async () => (await getWalletConfig()).wallet,\n * },\n * },\n * flags,\n * {\n * shouldBeInteractive: (flags) => !flags['arns-name'],\n * }\n * )\n * ```\n */\nexport async function resolveConfig<T extends FlagConfigMap>(\n flagConfigs: T,\n parsedFlags: Record<string, any>,\n options: ResolveConfigOptions = {},\n): Promise<ResolvedConfig<T>> {\n const { interactive, shouldBeInteractive } = options\n\n // Determine if we should run in interactive mode\n const isInteractive =\n interactive ?? (shouldBeInteractive ? shouldBeInteractive(parsedFlags) : false)\n\n const resolved: Record<string, any> = {}\n\n for (const [key, config] of Object.entries(flagConfigs)) {\n const flagValue = parsedFlags[key]\n\n // If value exists from flags, use it\n if (flagValue !== undefined && flagValue !== null && flagValue !== '') {\n resolved[key] = config.transform ? config.transform(flagValue) : flagValue\n continue\n }\n\n // If interactive mode and prompt exists, use prompt\n if (isInteractive && config.prompt) {\n const promptValue = await config.prompt()\n resolved[key] = config.transform ? config.transform(promptValue) : promptValue\n continue\n }\n\n // Otherwise use the flag's default value (if any)\n const defaultValue = config.flag.default\n if (typeof defaultValue === 'function') {\n resolved[key] = await defaultValue({})\n } else if (defaultValue === undefined) {\n resolved[key] = flagValue // May be undefined\n } else {\n resolved[key] = defaultValue\n }\n }\n\n return resolved as ResolvedConfig<T>\n}\n\n/**\n * Helper to create a flag configuration with proper type inference\n */\nexport function createFlagConfig<T, F = any>(config: FlagConfig<T, F>): FlagConfig<T, F> {\n return config\n}\n\n/**\n * Helper to extract just the flags from a FlagConfigMap for use in command static flags\n */\nexport function extractFlags<T extends FlagConfigMap>(flagConfigs: T): Record<string, any> {\n const flags: Record<string, any> = {}\n for (const [key, config] of Object.entries(flagConfigs)) {\n flags[key] = config.flag\n }\n\n return flags\n}\n"],"names":[],"mappings":"AA0EA,eAAsB,aAAA,CACpB,WAAA,EACA,WAAA,EACA,OAAA,GAAgC,EAAC,EACL;AAC5B,EAAA,MAAM,EAAE,WAAA,EAAa,mBAAA,EAAoB,GAAI,OAAA;AAG7C,EAAA,MAAM,aAAA,GACJ,WAAA,KAAgB,mBAAA,GAAsB,mBAAA,CAAoB,WAAW,CAAA,GAAI,KAAA,CAAA;AAE3E,EAAA,MAAM,WAAgC,EAAC;AAEvC,EAAA,KAAA,MAAW,CAAC,GAAA,EA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AAA;AAAA,EACtB;AAEA,EAAA,OAAO,KAAA;AACT;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../src/utils/constants.ts"],"sourcesContent":["export const ARWEAVE_TX_ID_REGEX = /^[\\w-]{43}$/\n\nexport const TTL_MIN = 60\nexport const TTL_MAX = 86_400\n"],"names":[],"mappings":"AAAO,MAAM,mBAAA,GAAsB;AAE5B,MAAM,OAAA,GAAU;AAChB,MAAM,OAAA,GAAU;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import os from 'node:os';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
function expandPath(filePath) {
|
|
5
|
+
if (filePath.startsWith("~/")) {
|
|
6
|
+
return path.join(os.homedir(), filePath.slice(2));
|
|
7
|
+
}
|
|
8
|
+
if (filePath === "~") {
|
|
9
|
+
return os.homedir();
|
|
10
|
+
}
|
|
11
|
+
return filePath;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { expandPath };
|
|
15
|
+
//# sourceMappingURL=path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.js","sources":["../../src/utils/path.ts"],"sourcesContent":["import os from 'node:os'\nimport path from 'node:path'\n\n/**\n * Expand tilde (~) to home directory in file paths\n */\nexport function expandPath(filePath: string): string {\n if (filePath.startsWith('~/')) {\n return path.join(os.homedir(), filePath.slice(2))\n }\n\n if (filePath === '~') {\n return os.homedir()\n }\n\n return filePath\n}\n"],"names":[],"mappings":";;;AAMO,SAAS,WAAW,QAAA,EAA0B;AACnD,EAAA,IAAI,QAAA,CAAS,UAAA,CAAW,IAAI,CAAA,EAAG;AAC7B,IAAA,OAAO,IAAA,CAAK,KAAK,EAAA,CAAG,OAAA,IAAW,QAAA,CAAS,KAAA,CAAM,CAAC,CAAC,CAAA;AAAA,EAClD;AAEA,EAAA,IAAI,aAAa,GAAA,EAAK;AACpB,IAAA,OAAO,GAAG,OAAA,EAAQ;AAAA,EACpB;AAEA,EAAA,OAAO,QAAA;AACT;;;;"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { HexSolanaSigner, EthereumSigner, ArweaveSigner } from '@ardrive/turbo-sdk';
|
|
2
|
+
|
|
3
|
+
function createSigner(sigType, deployKey) {
|
|
4
|
+
switch (sigType) {
|
|
5
|
+
case "ethereum": {
|
|
6
|
+
return {
|
|
7
|
+
signer: new EthereumSigner(deployKey),
|
|
8
|
+
token: "ethereum"
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
case "polygon": {
|
|
12
|
+
return {
|
|
13
|
+
signer: new EthereumSigner(deployKey),
|
|
14
|
+
token: "pol"
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
case "arweave": {
|
|
18
|
+
const jwk = JSON.parse(Buffer.from(deployKey, "base64").toString("utf8"));
|
|
19
|
+
return {
|
|
20
|
+
signer: new ArweaveSigner(jwk),
|
|
21
|
+
token: "arweave"
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
case "kyve": {
|
|
25
|
+
return {
|
|
26
|
+
signer: new EthereumSigner(deployKey),
|
|
27
|
+
token: "kyve"
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
case "solana": {
|
|
31
|
+
return {
|
|
32
|
+
signer: new HexSolanaSigner(deployKey),
|
|
33
|
+
token: "solana"
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
default: {
|
|
37
|
+
throw new Error(
|
|
38
|
+
`Invalid sig-type provided: ${sigType}. Allowed values are 'arweave', 'ethereum', 'polygon', 'kyve', or 'solana'.`
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { createSigner };
|
|
45
|
+
//# sourceMappingURL=signer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signer.js","sources":["../../src/utils/signer.ts"],"sourcesContent":["import { ArweaveSigner, EthereumSigner, HexSolanaSigner } from '@ardrive/turbo-sdk'\n\nimport type { SignerType } from '../types/index.js'\n\nexport function createSigner(sigType: SignerType, deployKey: string) {\n switch (sigType) {\n case 'ethereum': {\n return {\n signer: new EthereumSigner(deployKey),\n token: 'ethereum' as const,\n }\n }\n\n case 'polygon': {\n return {\n signer: new EthereumSigner(deployKey),\n token: 'pol' as const,\n }\n }\n\n case 'arweave': {\n const jwk = JSON.parse(Buffer.from(deployKey, 'base64').toString('utf8'))\n return {\n signer: new ArweaveSigner(jwk),\n token: 'arweave' as const,\n }\n }\n\n case 'kyve': {\n return {\n signer: new EthereumSigner(deployKey),\n token: 'kyve' as const,\n }\n }\n\n case 'solana': {\n return {\n signer: new HexSolanaSigner(deployKey),\n token: 'solana' as const,\n }\n }\n\n default: {\n throw new Error(\n `Invalid sig-type provided: ${sigType}. Allowed values are 'arweave', 'ethereum', 'polygon', 'kyve', or 'solana'.`,\n )\n }\n }\n}\n"],"names":[],"mappings":";;AAIO,SAAS,YAAA,CAAa,SAAqB,SAAA,EAAmB;AACnE,EAAA,QAAQ,OAAA;AAAS,IACf,KAAK,UAAA,EAAY;AACf,MAAA,OAAO;AAAA,QACL,MAAA,EAAQ,IAAI,cAAA,CAAe,SAAS,CAAA;AAAA,QACpC,KAAA,EAAO;AAAA,OACT;AAAA,IACF;AAAA,IAEA,KAAK,SAAA,EAAW;AACd,MAAA,OAAO;AAAA,QACL,MAAA,EAAQ,IAAI,cAAA,CAAe,SAAS,CAAA;AAAA,QACpC,KAAA,EAAO;AAAA,OACT;AAAA,IACF;AAAA,IAEA,KAAK,SAAA,EAAW;AACd,MAAA,MAAM,GAAA,GAAM,IAAA,CAAK,KAAA,CAAM,MAAA,CAAO,IAAA,CAAK,WAAW,QAAQ,CAAA,CAAE,QAAA,CAAS,MAAM,CAAC,CAAA;AACxE,MAAA,OAAO;AAAA,QACL,MAAA,EAAQ,IAAI,aAAA,CAAc,GAAG,CAAA;AAAA,QAC7B,KAAA,EAAO;AAAA,OACT;AAAA,IACF;AAAA,IAEA,KAAK,MAAA,EAAQ;AACX,MAAA,OAAO;AAAA,QACL,MAAA,EAAQ,IAAI,cAAA,CAAe,SAAS,CAAA;AAAA,QACpC,KAAA,EAAO;AAAA,OACT;AAAA,IACF;AAAA,IAEA,KAAK,QAAA,EAAU;AACb,MAAA,OAAO;AAAA,QACL,MAAA,EAAQ,IAAI,eAAA,CAAgB,SAAS,CAAA;AAAA,QACrC,KAAA,EAAO;AAAA,OACT;AAAA,IACF;AAAA,IAEA,SAAS;AACP,MAAA,MAAM,IAAI,KAAA;AAAA,QACR,8BAA8B,OAAO,CAAA,2EAAA;AAAA,OACvC;AAAA,IACF;AAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploader.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import { TTL_MIN, TTL_MAX } from './constants.js';
|
|
3
|
+
import { expandPath } from './path.js';
|
|
4
|
+
|
|
5
|
+
function validateTtl(value) {
|
|
6
|
+
const num = Number.parseInt(value, 10);
|
|
7
|
+
if (Number.isNaN(num)) {
|
|
8
|
+
return "TTL must be a valid number";
|
|
9
|
+
}
|
|
10
|
+
if (num < TTL_MIN || num > TTL_MAX) {
|
|
11
|
+
return `TTL must be between ${TTL_MIN} and ${TTL_MAX} seconds`;
|
|
12
|
+
}
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
function validateUndername(value) {
|
|
16
|
+
if (value.length === 0) {
|
|
17
|
+
return "Undername must not be empty";
|
|
18
|
+
}
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
function validateFileExists(value) {
|
|
22
|
+
const filePath = expandPath(value);
|
|
23
|
+
if (!fs.existsSync(filePath)) {
|
|
24
|
+
return `File ${value} does not exist`;
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
function validateFolderExists(value) {
|
|
29
|
+
const folderPath = expandPath(value);
|
|
30
|
+
if (!fs.existsSync(folderPath)) {
|
|
31
|
+
return `Folder ${value} does not exist`;
|
|
32
|
+
}
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
function validateArnsName(value) {
|
|
36
|
+
if (value.length === 0) {
|
|
37
|
+
return "ArNS name is required";
|
|
38
|
+
}
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { validateArnsName, validateFileExists, validateFolderExists, validateTtl, validateUndername };
|
|
43
|
+
//# sourceMappingURL=validators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.js","sources":["../../src/utils/validators.ts"],"sourcesContent":["import fs from 'node:fs'\n\nimport { TTL_MAX, TTL_MIN } from './constants.js'\nimport { expandPath } from './path.js'\n\n/**\n * Validate TTL seconds\n */\nexport function validateTtl(value: string): string | true {\n const num = Number.parseInt(value, 10)\n if (Number.isNaN(num)) {\n return 'TTL must be a valid number'\n }\n\n if (num < TTL_MIN || num > TTL_MAX) {\n return `TTL must be between ${TTL_MIN} and ${TTL_MAX} seconds`\n }\n\n return true\n}\n\n/**\n * Validate undername\n */\nexport function validateUndername(value: string): string | true {\n if (value.length === 0) {\n return 'Undername must not be empty'\n }\n\n return true\n}\n\n/**\n * Validate file path exists\n */\nexport function validateFileExists(value: string): string | true {\n const filePath = expandPath(value)\n if (!fs.existsSync(filePath)) {\n return `File ${value} does not exist`\n }\n\n return true\n}\n\n/**\n * Validate folder path exists\n */\nexport function validateFolderExists(value: string): string | true {\n const folderPath = expandPath(value)\n if (!fs.existsSync(folderPath)) {\n return `Folder ${value} does not exist`\n }\n\n return true\n}\n\n/**\n * Validate ArNS name is not empty\n */\nexport function validateArnsName(value: string): string | true {\n if (value.length === 0) {\n return 'ArNS name is required'\n }\n\n return true\n}\n"],"names":[],"mappings":";;;;AAQO,SAAS,YAAY,KAAA,EAA8B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|
+
import '@ardrive/turbo-sdk';
|
|
4
|
+
import 'ora';
|
|
5
|
+
import '../chunks/uploader-B2tC-1Qw.js';
|
|
6
|
+
export { r as runUploadWorkflow } from '../chunks/upload-workflow-DSS5FIa5.js';
|
|
7
|
+
import '../utils/path.js';
|
|
8
|
+
import '../utils/signer.js';
|
|
9
|
+
//# sourceMappingURL=upload-workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-workflow.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ar.io/deploy",
|
|
3
|
+
"version": "0.1.0-alpha.20260610213851.5857f96",
|
|
4
|
+
"description": "ARIO Deploy — CLI for deploying apps to the permaweb (Arweave) and updating ArNS",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"bin": {
|
|
9
|
+
"ario-deploy": "./bin/run.js"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"clean:install": "rm -rf node_modules pnpm-lock.yaml || true && pnpm store prune && pnpm install",
|
|
13
|
+
"build": "vite build && tsc --emitDeclarationOnly",
|
|
14
|
+
"dev": "./bin/dev.js",
|
|
15
|
+
"test": "vitest",
|
|
16
|
+
"test:run": "vitest run",
|
|
17
|
+
"test:unit": "vitest run src",
|
|
18
|
+
"test:e2e": "vitest run tests/e2e",
|
|
19
|
+
"test:coverage": "vitest run --coverage",
|
|
20
|
+
"lint": "eslint . --ext .ts",
|
|
21
|
+
"lint:fix": "eslint . --ext .ts --fix",
|
|
22
|
+
"format": "prettier --write .",
|
|
23
|
+
"format:check": "prettier --check .",
|
|
24
|
+
"docs:update": "markdown-toc-gen insert README.md --max-depth 2",
|
|
25
|
+
"generate:types": "openapi-typescript tests/fixtures/upload-service.openapi.yaml -o tests/types/upload-service.ts && openapi-typescript tests/fixtures/payment-service.openapi.yaml -o tests/types/payment-service.ts",
|
|
26
|
+
"prepare": "husky install",
|
|
27
|
+
"release": "semantic-release"
|
|
28
|
+
},
|
|
29
|
+
"oclif": {
|
|
30
|
+
"bin": "ario-deploy",
|
|
31
|
+
"dirname": "ario-deploy",
|
|
32
|
+
"commands": "./dist/commands",
|
|
33
|
+
"topicSeparator": " ",
|
|
34
|
+
"topics": {
|
|
35
|
+
"deploy": {
|
|
36
|
+
"description": "Deploy to the permaweb"
|
|
37
|
+
},
|
|
38
|
+
"upload": {
|
|
39
|
+
"description": "Upload to Arweave without updating ArNS"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"dist",
|
|
45
|
+
"bin",
|
|
46
|
+
"oclif.manifest.json"
|
|
47
|
+
],
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@ar.io/sdk": "4.0.2-alpha.4",
|
|
50
|
+
"@ardrive/turbo-sdk": "^1.41.3",
|
|
51
|
+
"@dha-team/arbundles": "^1.0.4",
|
|
52
|
+
"@inquirer/prompts": "^7.2.0",
|
|
53
|
+
"@oclif/core": "^4.0.30",
|
|
54
|
+
"@solana/kit": "^6.9.0",
|
|
55
|
+
"bs58": "^6.0.0",
|
|
56
|
+
"mime-types": "^3.0.1",
|
|
57
|
+
"ora": "^8.1.1",
|
|
58
|
+
"p-limit": "^7.2.0"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
62
|
+
"@semantic-release/git": "^10.0.1",
|
|
63
|
+
"@commitlint/cli": "^19.6.0",
|
|
64
|
+
"@commitlint/config-conventional": "^19.6.0",
|
|
65
|
+
"@oclif/prettier-config": "^0.2.1",
|
|
66
|
+
"@oclif/test": "^4.1.14",
|
|
67
|
+
"@types/mime-types": "^2.1.4",
|
|
68
|
+
"@types/node": "^22.10.2",
|
|
69
|
+
"@typescript-eslint/eslint-plugin": "^8.18.1",
|
|
70
|
+
"@typescript-eslint/parser": "^8.18.1",
|
|
71
|
+
"@vitest/coverage-v8": "^2.1.8",
|
|
72
|
+
"eslint": "^8.57.1",
|
|
73
|
+
"eslint-config-oclif": "^5.2.1",
|
|
74
|
+
"eslint-config-oclif-typescript": "^3.1.12",
|
|
75
|
+
"eslint-config-prettier": "^9.1.0",
|
|
76
|
+
"eslint-import-resolver-typescript": "^3.7.0",
|
|
77
|
+
"eslint-plugin-import": "^2.31.0",
|
|
78
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
79
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
80
|
+
"husky": "^9.1.7",
|
|
81
|
+
"lint-staged": "^16.4.0",
|
|
82
|
+
"markdown-toc-gen": "^1.0.1",
|
|
83
|
+
"msw": "^2.11.3",
|
|
84
|
+
"openapi-typescript": "^7.9.1",
|
|
85
|
+
"prettier": "^3.4.2",
|
|
86
|
+
"semantic-release": "^24.2.3",
|
|
87
|
+
"tsx": "^4.19.2",
|
|
88
|
+
"typescript": "^5.7.2",
|
|
89
|
+
"vite": "^6.0.5",
|
|
90
|
+
"vite-plugin-dts": "^4.3.0",
|
|
91
|
+
"vite-tsconfig-paths": "^5.1.4",
|
|
92
|
+
"vitest": "^2.1.8"
|
|
93
|
+
},
|
|
94
|
+
"publishConfig": {
|
|
95
|
+
"access": "public",
|
|
96
|
+
"registry": "https://registry.npmjs.org/"
|
|
97
|
+
},
|
|
98
|
+
"engines": {
|
|
99
|
+
"node": ">=18.0.0"
|
|
100
|
+
},
|
|
101
|
+
"repository": {
|
|
102
|
+
"type": "git",
|
|
103
|
+
"url": "git+https://github.com/ar-io/ar-io-deploy.git"
|
|
104
|
+
},
|
|
105
|
+
"author": "Permanent Data Solutions, Inc.",
|
|
106
|
+
"license": "MIT",
|
|
107
|
+
"bugs": {
|
|
108
|
+
"url": "https://github.com/ar-io/ar-io-deploy/issues"
|
|
109
|
+
},
|
|
110
|
+
"homepage": "https://github.com/ar-io/ar-io-deploy#readme"
|
|
111
|
+
}
|