@knowttl/artium-axi 0.0.36 → 0.0.37
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/bin/artium-axi.mjs +93 -7
- package/package.json +1 -1
package/bin/artium-axi.mjs
CHANGED
|
@@ -43,7 +43,7 @@ var init_package = __esm({
|
|
|
43
43
|
"package.json"() {
|
|
44
44
|
package_default = {
|
|
45
45
|
name: "artium-axi",
|
|
46
|
-
version: "0.0.
|
|
46
|
+
version: "0.0.37",
|
|
47
47
|
private: true,
|
|
48
48
|
license: "MIT",
|
|
49
49
|
type: "module",
|
|
@@ -21989,7 +21989,11 @@ var init_errors3 = __esm({
|
|
|
21989
21989
|
TOKEN_EXPIRED: { status: 401, message: "The token has expired.", next: "Sign in again." },
|
|
21990
21990
|
USER_DISABLED: { status: 403, message: "The user is disabled.", next: "Ask the administrator to enable the user." },
|
|
21991
21991
|
TOOL_DISABLED: { status: 403, message: "The tool is disabled.", next: "Ask the administrator to enable the tool." },
|
|
21992
|
+
INSTANCE_REQUIRED: { status: 409, message: "The tool has several usable instances and the request named none.", next: "Name the instance to use." },
|
|
21993
|
+
INSTANCE_NOT_FOUND: { status: 404, message: "The tool has no instance with that name.", next: "Name an existing instance of the tool." },
|
|
21994
|
+
INSTANCE_DISABLED: { status: 403, message: "The instance is disabled.", next: "Name another instance, or ask the administrator to enable it." },
|
|
21992
21995
|
TOOL_NOT_GRANTED: { status: 403, message: "The user has no role granting this tool.", next: "Ask the administrator to assign a role granting the tool." },
|
|
21996
|
+
RAW_API_DENIED: { status: 403, message: "Raw API access is not permitted for this tool, method or role.", next: "Use a named command, or ask the administrator to enable Raw API for the tool and grant it to a role." },
|
|
21993
21997
|
MASTER_KEY_INVALID: { status: 503, message: "The master key is missing or invalid.", next: "Supply a 32-byte master key file or a base64 master key." },
|
|
21994
21998
|
CREDENTIAL_INVALID: { status: 503, message: "The stored credential is invalid.", next: "Ask an administrator to check the named field, matching master key and credential JSON, then save and test again." },
|
|
21995
21999
|
CREDENTIAL_EXPIRED: { status: 503, message: "The GitHub credential expired or was revoked.", next: "Ask an administrator to reconnect at /admin/tools/gh-axi. Tokens are never refreshed automatically." },
|
|
@@ -46080,7 +46084,7 @@ function transferRoutesFor(tool) {
|
|
|
46080
46084
|
function decodedFileBytes(value) {
|
|
46081
46085
|
return value.length / 4 * 3 - (value.endsWith("==") ? 2 : value.endsWith("=") ? 1 : 0);
|
|
46082
46086
|
}
|
|
46083
|
-
var inputLimits, transferLimits, transferWarning, sha256Schema, sampleSha256Schema, reportIdSchema, transferOwnerIdSchema, mailSelectorSchema, transferSelectionSchema, transferPrepareSchema, transferIdSchema, transferScopeSchema, transferPreviewSchema, transferExecuteSchema, transferRetrieveSchema, transferOutcomeSchema, transferSaveOutcomeSchema, transferArchiveSchema, transferReceiptSchema, transferEvidenceSchema, transferStatusSchema, transferRoutes, transferAuditSchema, byteLength, passwordSchema, passwordChangeSchema, loginSchema, refreshSchema, reauthSchema, reauthResponseSchema, loginResponseSchema, deviceUserCodeSchema, devicePollSchema, deviceStartResponseSchema, devicePollResponseSchema, ssoReauthSchema, ssoReauthResponseSchema, accountId, toolSchema, delegationScopeSchema, meResponseSchema, createDelegationSchema, delegatedExchangeSchema, createdDelegationSchema, skillsResponseSchema, adminUserSchema, adminPageQuerySchema, adminUsersQuerySchema, adminUsersResponseSchema, adminUserDetailSchema, adminUserCreateSchema, adminUserPatchSchema, adminUserUnlockSchema, adminUserResetSchema, adminUserParamsSchema, userSessionsSchema, sessionParamsSchema, emptyInputSchema, revokedSchema, adminUserRoutes, text, auditCursorSchema, auditFiltersSchema, orderedAuditRange, adminAuditQuerySchema, adminAuditExportRoute, adminAuditRecordSchema, adminAuditRoute, falconRtrSettingsSchema, ghWriteOperations, falconWriteOperations, unifiWriteOperations, proxmoxWriteOperations, technitiumWriteOperations, nativeSettingsSchemas, diagnosticSchema, healthSchema, toolWriteStateSchema, writeAccessInputSchema, adminToolSchema, adminCredentialSchema, adminToolParamsSchema, certificateDetailsSchema, certificateInspectionSchema, trustedCredentialCertificateSchema, adminCertificateRoutes, githubConnectionInput, githubDeviceRoutes, adminToolRoutes, oidcIssuerSchema, providerSettings, entraSettings, oidcSettings, providerSettingsSchema, providerFields, adminProviderSchema, adminProviderCredentialSchema, adminProviderRoutes, roleRuleSettingsSchema, adminRoleRuleSchema, adminRoleRuleRoutes, invitationLifetimeSchema, adminInvitationSchema, invitationLinkSchema, adminInvitationRoutes, adminRoleSchema, adminRolesResponseSchema, adminRoleRoutes, toolsResponseSchema, inputFileSchema, runInputSchema, runRequestSchema, counts, runSuccessSchema, errorResponseSchema, runResponseSchema;
|
|
46087
|
+
var inputLimits, transferLimits, transferWarning, sha256Schema, sampleSha256Schema, reportIdSchema, transferOwnerIdSchema, mailSelectorSchema, transferSelectionSchema, transferPrepareSchema, transferIdSchema, transferScopeSchema, transferPreviewSchema, transferExecuteSchema, transferRetrieveSchema, transferOutcomeSchema, transferSaveOutcomeSchema, transferArchiveSchema, transferReceiptSchema, transferEvidenceSchema, transferStatusSchema, transferRoutes, transferAuditSchema, byteLength, passwordSchema, passwordChangeSchema, loginSchema, refreshSchema, reauthSchema, reauthResponseSchema, loginResponseSchema, deviceUserCodeSchema, devicePollSchema, deviceStartResponseSchema, devicePollResponseSchema, ssoReauthSchema, ssoReauthResponseSchema, accountId, toolSchema, delegationScopeSchema, meResponseSchema, createDelegationSchema, delegatedExchangeSchema, createdDelegationSchema, skillsResponseSchema, adminUserSchema, adminPageQuerySchema, adminUsersQuerySchema, adminUsersResponseSchema, adminUserDetailSchema, adminUserCreateSchema, adminUserPatchSchema, adminUserUnlockSchema, adminUserResetSchema, adminUserParamsSchema, userSessionsSchema, sessionParamsSchema, emptyInputSchema, revokedSchema, adminUserRoutes, text, auditCursorSchema, auditFiltersSchema, orderedAuditRange, adminAuditQuerySchema, adminAuditExportRoute, adminAuditRecordSchema, adminAuditRoute, falconRtrSettingsSchema, ghWriteOperations, falconWriteOperations, unifiWriteOperations, proxmoxWriteOperations, technitiumWriteOperations, nativeSettingsSchemas, diagnosticSchema, healthSchema, toolWriteStateSchema, writeAccessInputSchema, adminToolSchema, adminCredentialSchema, adminToolParamsSchema, instanceNameSchema, adminInstanceParamsSchema, adminInstanceSchema, certificateDetailsSchema, certificateInspectionSchema, trustedCredentialCertificateSchema, adminCertificateRoutes, githubConnectionInput, githubDeviceRoutes, adminToolRoutes, instanceBase, instanceRevisions, adminInstanceRoutes, oidcIssuerSchema, providerSettings, entraSettings, oidcSettings, providerSettingsSchema, providerFields, adminProviderSchema, adminProviderCredentialSchema, adminProviderRoutes, roleRuleSettingsSchema, adminRoleRuleSchema, adminRoleRuleRoutes, invitationLifetimeSchema, adminInvitationSchema, invitationLinkSchema, adminInvitationRoutes, adminRoleSchema, adminRolesResponseSchema, adminRoleRoutes, toolsResponseSchema, inputFileSchema, runInputSchema, runRequestSchema, counts, runSuccessSchema, errorResponseSchema, runResponseSchema;
|
|
46084
46088
|
var init_api2 = __esm({
|
|
46085
46089
|
"src/shared/api.ts"() {
|
|
46086
46090
|
"use strict";
|
|
@@ -46516,7 +46520,9 @@ var init_api2 = __esm({
|
|
|
46516
46520
|
archive_sha256: sha256Schema.nullable(),
|
|
46517
46521
|
native_audit_id: external_exports.string().nullable(),
|
|
46518
46522
|
native_journal_result: external_exports.string().nullable(),
|
|
46519
|
-
client_save_outcome: transferSaveOutcomeSchema.nullable()
|
|
46523
|
+
client_save_outcome: transferSaveOutcomeSchema.nullable(),
|
|
46524
|
+
credential_id: external_exports.string().nullable(),
|
|
46525
|
+
instance: external_exports.string().nullable()
|
|
46520
46526
|
});
|
|
46521
46527
|
adminAuditRoute = {
|
|
46522
46528
|
method: "GET",
|
|
@@ -46694,6 +46700,23 @@ var init_api2 = __esm({
|
|
|
46694
46700
|
normalizations: external_exports.array(external_exports.strictObject({ field: external_exports.string(), reason: external_exports.string() })).optional()
|
|
46695
46701
|
});
|
|
46696
46702
|
adminToolParamsSchema = external_exports.strictObject({ tool: toolSchema });
|
|
46703
|
+
instanceNameSchema = external_exports.string().regex(/^[a-z0-9][a-z0-9-]{0,31}$/);
|
|
46704
|
+
adminInstanceParamsSchema = adminToolParamsSchema.extend({ name: instanceNameSchema });
|
|
46705
|
+
adminInstanceSchema = external_exports.strictObject({
|
|
46706
|
+
id: external_exports.string(),
|
|
46707
|
+
tool: toolSchema,
|
|
46708
|
+
name: instanceNameSchema,
|
|
46709
|
+
description: external_exports.string().max(500),
|
|
46710
|
+
enabled: external_exports.boolean(),
|
|
46711
|
+
readOnly: external_exports.boolean(),
|
|
46712
|
+
configured: external_exports.boolean(),
|
|
46713
|
+
metadata: external_exports.record(external_exports.string(), external_exports.unknown()),
|
|
46714
|
+
revision: external_exports.number().int().positive(),
|
|
46715
|
+
updatedAt: external_exports.number().int().nullable(),
|
|
46716
|
+
updatedBy: accountId.nullable(),
|
|
46717
|
+
health: healthSchema,
|
|
46718
|
+
normalizations: adminCredentialSchema.shape.normalizations
|
|
46719
|
+
});
|
|
46697
46720
|
certificateDetailsSchema = external_exports.strictObject({
|
|
46698
46721
|
subject: external_exports.string(),
|
|
46699
46722
|
issuer: external_exports.string(),
|
|
@@ -46765,7 +46788,9 @@ var init_api2 = __esm({
|
|
|
46765
46788
|
input: external_exports.strictObject({
|
|
46766
46789
|
origin: external_exports.string(),
|
|
46767
46790
|
expectedRevision: external_exports.number().int().nonnegative(),
|
|
46768
|
-
expectedToolRevision: external_exports.number().int().positive()
|
|
46791
|
+
expectedToolRevision: external_exports.number().int().positive(),
|
|
46792
|
+
instance: instanceNameSchema.optional(),
|
|
46793
|
+
expectedId: external_exports.string().optional()
|
|
46769
46794
|
}),
|
|
46770
46795
|
response: external_exports.strictObject({
|
|
46771
46796
|
connectionId: external_exports.uuid(),
|
|
@@ -46781,7 +46806,7 @@ var init_api2 = __esm({
|
|
|
46781
46806
|
input: githubConnectionInput,
|
|
46782
46807
|
response: external_exports.union([
|
|
46783
46808
|
external_exports.strictObject({ status: external_exports.literal("pending"), interval: external_exports.number().int().positive() }),
|
|
46784
|
-
external_exports.strictObject({ status: external_exports.literal("connected"), credential: adminCredentialSchema })
|
|
46809
|
+
external_exports.strictObject({ status: external_exports.literal("connected"), credential: external_exports.union([adminCredentialSchema, adminInstanceSchema]) })
|
|
46785
46810
|
])
|
|
46786
46811
|
},
|
|
46787
46812
|
cancel: {
|
|
@@ -46850,9 +46875,11 @@ var init_api2 = __esm({
|
|
|
46850
46875
|
input: external_exports.strictObject({
|
|
46851
46876
|
origin: external_exports.string(),
|
|
46852
46877
|
expectedRevision: external_exports.number().int().nonnegative(),
|
|
46853
|
-
expectedToolRevision: external_exports.number().int().positive()
|
|
46878
|
+
expectedToolRevision: external_exports.number().int().positive(),
|
|
46879
|
+
instance: instanceNameSchema.optional(),
|
|
46880
|
+
expectedId: external_exports.string().optional()
|
|
46854
46881
|
}),
|
|
46855
|
-
response: adminCredentialSchema,
|
|
46882
|
+
response: external_exports.union([adminCredentialSchema, adminInstanceSchema]),
|
|
46856
46883
|
authorization: "administrator-and-recent-auth",
|
|
46857
46884
|
auditEvent: "save-awx-origin"
|
|
46858
46885
|
},
|
|
@@ -46904,6 +46931,63 @@ var init_api2 = __esm({
|
|
|
46904
46931
|
auditEvent: "credential-test"
|
|
46905
46932
|
}
|
|
46906
46933
|
};
|
|
46934
|
+
instanceBase = "/v1/admin/tools/:tool/instances";
|
|
46935
|
+
instanceRevisions = { expectedId: external_exports.string(), expectedRevision: external_exports.number().int().positive() };
|
|
46936
|
+
adminInstanceRoutes = {
|
|
46937
|
+
list: {
|
|
46938
|
+
method: "GET",
|
|
46939
|
+
path: instanceBase,
|
|
46940
|
+
input: external_exports.strictObject({}),
|
|
46941
|
+
response: external_exports.strictObject({ instances: external_exports.array(adminInstanceSchema) })
|
|
46942
|
+
},
|
|
46943
|
+
create: {
|
|
46944
|
+
method: "POST",
|
|
46945
|
+
path: instanceBase,
|
|
46946
|
+
input: external_exports.strictObject({
|
|
46947
|
+
name: instanceNameSchema,
|
|
46948
|
+
description: external_exports.string().max(500).default(""),
|
|
46949
|
+
value: external_exports.record(external_exports.string(), external_exports.unknown()),
|
|
46950
|
+
expectedToolRevision: external_exports.number().int().positive()
|
|
46951
|
+
}),
|
|
46952
|
+
response: adminInstanceSchema,
|
|
46953
|
+
auditEvent: "create-instance"
|
|
46954
|
+
},
|
|
46955
|
+
get: { method: "GET", path: `${instanceBase}/:name`, input: external_exports.strictObject({}), response: adminInstanceSchema },
|
|
46956
|
+
update: {
|
|
46957
|
+
method: "PATCH",
|
|
46958
|
+
path: `${instanceBase}/:name`,
|
|
46959
|
+
input: external_exports.strictObject({
|
|
46960
|
+
...instanceRevisions,
|
|
46961
|
+
enabled: external_exports.boolean().optional(),
|
|
46962
|
+
readOnly: external_exports.boolean().optional(),
|
|
46963
|
+
description: external_exports.string().max(500).optional()
|
|
46964
|
+
}).refine((input2) => input2.enabled !== void 0 || input2.readOnly !== void 0 || input2.description !== void 0),
|
|
46965
|
+
response: adminInstanceSchema
|
|
46966
|
+
},
|
|
46967
|
+
remove: {
|
|
46968
|
+
method: "DELETE",
|
|
46969
|
+
path: `${instanceBase}/:name`,
|
|
46970
|
+
input: external_exports.strictObject(instanceRevisions),
|
|
46971
|
+
response: external_exports.strictObject({ removed: external_exports.literal(true) }),
|
|
46972
|
+
auditEvent: "delete-instance"
|
|
46973
|
+
},
|
|
46974
|
+
replace: {
|
|
46975
|
+
method: "PUT",
|
|
46976
|
+
path: `${instanceBase}/:name/credential`,
|
|
46977
|
+
input: external_exports.strictObject({ ...instanceRevisions, value: external_exports.unknown(), expectedToolRevision: external_exports.number().int().positive() }),
|
|
46978
|
+
response: adminInstanceSchema,
|
|
46979
|
+
auditEvent: "replace-credential"
|
|
46980
|
+
},
|
|
46981
|
+
save: {
|
|
46982
|
+
method: "PATCH",
|
|
46983
|
+
path: `${instanceBase}/:name/credential`,
|
|
46984
|
+
input: external_exports.strictObject({ ...instanceRevisions, value: external_exports.record(external_exports.string(), external_exports.unknown()), expectedToolRevision: external_exports.number().int().positive() }),
|
|
46985
|
+
response: adminInstanceSchema,
|
|
46986
|
+
auditEvent: "replace-credential"
|
|
46987
|
+
},
|
|
46988
|
+
test: { method: "POST", path: `${instanceBase}/:name/test`, input: external_exports.strictObject({}), response: healthSchema },
|
|
46989
|
+
certificates: Object.fromEntries(Object.entries(adminCertificateRoutes).map(([name, route]) => [name, { ...route, path: route.path.replace("/:tool/", "/:tool/instances/:name/") }]))
|
|
46990
|
+
};
|
|
46907
46991
|
oidcIssuerSchema = external_exports.url().refine((value) => {
|
|
46908
46992
|
const url2 = new URL(value);
|
|
46909
46993
|
return url2.protocol === "https:" && !url2.username && !url2.password && !url2.search && !url2.hash;
|
|
@@ -47165,11 +47249,13 @@ var init_api2 = __esm({
|
|
|
47165
47249
|
).optional()
|
|
47166
47250
|
});
|
|
47167
47251
|
runRequestSchema = runInputSchema.extend({
|
|
47252
|
+
instance: instanceNameSchema.optional(),
|
|
47168
47253
|
args: external_exports.array(text.refine((value) => byteLength(value) <= inputLimits.argumentBytes, "Argument exceeds byte limit")).max(inputLimits.arguments)
|
|
47169
47254
|
});
|
|
47170
47255
|
counts = external_exports.strictObject({ stdout: external_exports.number().int().nonnegative(), stderr: external_exports.number().int().nonnegative() });
|
|
47171
47256
|
runSuccessSchema = external_exports.strictObject({
|
|
47172
47257
|
source: toolSchema,
|
|
47258
|
+
instance: instanceNameSchema.optional(),
|
|
47173
47259
|
stdout: external_exports.string(),
|
|
47174
47260
|
stderr: external_exports.string(),
|
|
47175
47261
|
exitCode: external_exports.number().int().nonnegative(),
|