thinkwork-cli 0.13.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -14
- package/dist/{api-client-4DZ266J5.js → api-client-4P4JZOBX.js} +3 -1
- package/dist/bowser-6Z6JFAIR.js +2822 -0
- package/dist/{chunk-Y2WHJECR.js → chunk-4OMDWYZQ.js} +5 -44
- package/dist/chunk-AD2NIWB5.js +6516 -0
- package/dist/chunk-DV3MRBR5.js +43 -0
- package/dist/chunk-EI5ZX7CN.js +522 -0
- package/dist/chunk-EUJ7X6YD.js +126 -0
- package/dist/chunk-GG5WKBOX.js +436 -0
- package/dist/chunk-I64EZSU5.js +358 -0
- package/dist/chunk-KMIJ5KGT.js +128 -0
- package/dist/chunk-MWQ7RO76.js +137 -0
- package/dist/chunk-OCPHU34C.js +996 -0
- package/dist/chunk-OLUQ4U2Z.js +1728 -0
- package/dist/chunk-XYM7PE2A.js +2264 -0
- package/dist/chunk-YQCYD6NE.js +3299 -0
- package/dist/cli.js +49156 -31257
- package/dist/commands/enterprise/templates/deploy-repo/scripts/apply-release.mjs +0 -1
- package/dist/commands/enterprise/templates/deploy-repo/scripts/smoke.mjs +0 -1
- package/dist/commands/enterprise/templates/deploy-repo/terraform/main.tf +0 -14
- package/dist/dist-es-2OTNTL4N.js +315 -0
- package/dist/dist-es-2XVAH4BQ.js +14726 -0
- package/dist/dist-es-3DPDUJAH.js +2000 -0
- package/dist/dist-es-BNZTBBVC.js +176 -0
- package/dist/dist-es-CD2RBDAC.js +88 -0
- package/dist/dist-es-I4FW57PS.js +88 -0
- package/dist/dist-es-KL7Y5NB2.js +377 -0
- package/dist/dist-es-KVFWJNDY.js +318 -0
- package/dist/dist-es-PS73DWNL.js +70 -0
- package/dist/dist-es-S3NZQFGT.js +170 -0
- package/dist/dist-es-SGCA4P32.js +48 -0
- package/dist/dist-es-WBM6J4RA.js +70 -0
- package/dist/dist-es-ZGVADYIF.js +485 -0
- package/dist/dist-es-ZKC2QKD2.js +377 -0
- package/dist/drizzle/0076_scheduled_jobs_marco_backfill.sql +2 -1
- package/dist/drizzle/0079_seed_tenant_customize_catalog.sql +1 -0
- package/dist/drizzle/0090_brain_schema_extraction.sql +10 -0
- package/dist/drizzle/0132_drop_computer_tables.sql +3 -0
- package/dist/drizzle/0160_compliance_event_types_plugins.sql +2 -0
- package/dist/drizzle/0214_think137_drop_judge_evidence_roi.sql +1 -0
- package/dist/drizzle/0216_drop_agent_loop_versions_goal_worker_policy.sql +1 -0
- package/dist/drizzle/0227_analyst_reader_role.sql +17 -20
- package/dist/drizzle/0230_analyst_rls.sql +28 -36
- package/dist/drizzle/0250_kg_schema_extraction.sql +27 -0
- package/dist/drizzle/0251_brain_stragglers.sql +21 -0
- package/dist/drizzle/0253_drop_brain_substrate.sql +2 -0
- package/dist/drizzle/0257_agents_runtime_allow_harness.sql +24 -0
- package/dist/drizzle/0261_native_auth_control_plane.sql +332 -0
- package/dist/drizzle/0262_auth_subscription_tickets.sql +59 -0
- package/dist/drizzle/0263_agentcore_runtime_identifier.sql +69 -0
- package/dist/drizzle/0263_drop_workos_auth_runtime.sql +236 -0
- package/dist/drizzle/0264_auth_enrollment_attempt_limits.sql +15 -0
- package/dist/drizzle/0265_eval_runs_requester_identity.sql +28 -0
- package/dist/drizzle/0265_require_fully_valid_auth_publication.sql +27 -0
- package/dist/drizzle/0266_auth_identity_recovery_grants.sql +9 -0
- package/dist/drizzle/0266_eval_profiles_runtime_type.sql +12 -0
- package/dist/drizzle/0267_ontology_candidate_rejections.sql +53 -0
- package/dist/drizzle/0268_identity_crosswalk_routing.sql +182 -0
- package/dist/drizzle/0269_ontology_system_map.sql +31 -0
- package/dist/drizzle/0270_tool_execution_ledger.sql +115 -0
- package/dist/drizzle/0271_ontology_twin_declarations.sql +47 -0
- package/dist/drizzle/0272_identity_graph_projection_cursor.sql +23 -0
- package/dist/drizzle/0273_twin_materialization_suggestions.sql +29 -0
- package/dist/drizzle/0274_tenant_mcp_twin_keys.sql +59 -0
- package/dist/drizzle/0275_identity_bulk_rebuild_fence.sql +30 -0
- package/dist/drizzle/0276_tool_execution_ledger_allow_cascade_delete.sql +18 -0
- package/dist/drizzle/0277_knowledge_base_sources.sql +107 -0
- package/dist/drizzle/0278_kb_page_transcription.sql +55 -0
- package/dist/drizzle/0279_mcp_servers_off_plugin_provenance.sql +93 -0
- package/dist/drizzle/0280_work_item_external_refs_drop_plane_provider.sql +46 -0
- package/dist/drizzle/0281_tenant_mcp_twin_keys_expiry_suffix.sql +9 -0
- package/dist/drizzle/0282_tenant_mcp_twin_keys_grants.sql +24 -0
- package/dist/drizzle/0283_agents_agentcore_runtime_dispatch.sql +13 -0
- package/dist/drizzle/0284_user_brain_claims.sql +69 -0
- package/dist/drizzle/0285_tenant_mcp_twin_keys_trusted_subsystem.sql +30 -0
- package/dist/drizzle/0286_brain_analytics_key.sql +26 -0
- package/dist/drizzle/0287_brain_subject.sql +25 -0
- package/dist/drizzle/0288_multi_lane_identities.sql +25 -0
- package/dist/event-streams-7JNLJEEL.js +894 -0
- package/dist/event-streams-KDF5RWR6.js +1515 -0
- package/dist/loadSso-ETCXTR4I.js +576 -0
- package/dist/loadSso-UBD7KUHE.js +583 -0
- package/dist/plugins/README.md +2 -2
- package/dist/plugins/catalog/package.json +1 -5
- package/dist/plugins/catalog/src/__tests__/build-catalog.test.ts +6 -4
- package/dist/plugins/catalog/src/__tests__/catalog.test.ts +21 -21
- package/dist/plugins/catalog/src/__tests__/contracts.test.ts +102 -94
- package/dist/plugins/catalog/src/__tests__/plugin-package.test.ts +7 -8
- package/dist/plugins/catalog/src/__tests__/plugin-registry.test.ts +0 -20
- package/dist/plugins/catalog/src/contracts.ts +17 -179
- package/dist/plugins/catalog/src/registry/generated-first-party.ts +0 -24
- package/dist/plugins/n8n/test/integrated-app-contract.test.ts +1 -1
- package/dist/plugins/twenty/package.json +2 -1
- package/dist/plugins/twenty/scripts/LAMBDA_DEPLOY.md +114 -0
- package/dist/plugins/twenty/scripts/build-lambda.sh +29 -0
- package/dist/plugins/twenty/scripts/configure-product-views.ts +195 -0
- package/dist/plugins/twenty/scripts/lambda-handler.ts +49 -0
- package/dist/plugins/twenty/scripts/lib/__tests__/load-attachments.test.ts +38 -0
- package/dist/plugins/twenty/scripts/lib/__tests__/load-records.test.ts +145 -2
- package/dist/plugins/twenty/scripts/lib/__tests__/mappers.test.ts +397 -151
- package/dist/plugins/twenty/scripts/lib/__tests__/members-ensure.test.ts +28 -129
- package/dist/plugins/twenty/scripts/lib/__tests__/provision-members-db.test.ts +10 -0
- package/dist/plugins/twenty/scripts/lib/__tests__/schema-ensure.test.ts +13 -8
- package/dist/plugins/twenty/scripts/lib/lastmile-reader.ts +222 -2
- package/dist/plugins/twenty/scripts/lib/load-attachments.ts +29 -0
- package/dist/plugins/twenty/scripts/lib/load-records.ts +160 -43
- package/dist/plugins/twenty/scripts/lib/mappers.ts +368 -152
- package/dist/plugins/twenty/scripts/lib/members-ensure.ts +43 -268
- package/dist/plugins/twenty/scripts/lib/provision-members-db.ts +57 -0
- package/dist/plugins/twenty/scripts/lib/schema-ensure.ts +136 -31
- package/dist/plugins/twenty/scripts/migrate-lastmile.ts +254 -152
- package/dist/plugins/twenty/scripts/provision-twenty-members.ts +44 -1
- package/dist/plugins/twenty/scripts/purge-lastmile-import.ts +178 -0
- package/dist/plugins/twenty/scripts/restructure-products.ts +312 -0
- package/dist/plugins/twenty/scripts/retag-stage-values.ts +362 -0
- package/dist/plugins/twenty/test/manifest.test.ts +2 -4
- package/dist/scripts/post-deploy.sh +79 -1
- package/dist/signin-5QZNRSOO.js +821 -0
- package/dist/sso-oidc-XK673P54.js +837 -0
- package/dist/sts-OXI2UALF.js +1113 -0
- package/dist/sts-SQW4NBK3.js +1117 -0
- package/dist/terraform/examples/greenfield/main.tf +391 -176
- package/dist/terraform/examples/greenfield/terraform.tfvars.example +26 -8
- package/dist/terraform/modules/app/agentcore-admin/main.tf +47 -0
- package/dist/terraform/modules/app/agentcore-code-interpreter/README.md +39 -47
- package/dist/terraform/modules/app/agentcore-code-interpreter/main.tf +13 -66
- package/dist/terraform/modules/app/agentcore-identity/main.tf +253 -0
- package/dist/terraform/modules/app/agentcore-identity/outputs.tf +51 -0
- package/dist/terraform/modules/app/agentcore-identity/scripts/bootstrap_twenty_oauth_client.sh +239 -0
- package/dist/terraform/modules/app/agentcore-identity/scripts/delete_identity.sh +22 -0
- package/dist/terraform/modules/app/agentcore-identity/scripts/delete_twenty_identity.sh +16 -0
- package/dist/terraform/modules/app/agentcore-identity/scripts/delete_workload_identity.sh +19 -0
- package/dist/terraform/modules/app/agentcore-identity/scripts/ensure_workload_identity.sh +29 -0
- package/dist/terraform/modules/app/agentcore-identity/scripts/read_identity.sh +55 -0
- package/dist/terraform/modules/app/agentcore-identity/scripts/reconcile_identity.sh +73 -0
- package/dist/terraform/modules/app/agentcore-identity/scripts/reconcile_twenty_identity.sh +45 -0
- package/dist/terraform/modules/app/agentcore-identity/scripts/reconcile_twenty_provider.mjs +123 -0
- package/dist/terraform/modules/app/agentcore-identity/tests/tainted-marker/after.tf +15 -0
- package/dist/terraform/modules/app/agentcore-identity/tests/tainted-marker/before.tf +7 -0
- package/dist/terraform/modules/app/agentcore-identity/tests/tainted-marker/identity-after.tf +8 -0
- package/dist/terraform/modules/app/agentcore-identity/tests/tainted-marker/identity-before.tf +9 -0
- package/dist/terraform/modules/app/agentcore-identity/tests/tainted-marker/thinkwork-after.tf +3 -0
- package/dist/terraform/modules/app/agentcore-identity/tests/tainted-marker/thinkwork-before.tf +3 -0
- package/dist/terraform/modules/app/agentcore-identity/variables.tf +60 -0
- package/dist/terraform/modules/app/agentcore-memory/README.md +46 -9
- package/dist/terraform/modules/app/agentcore-memory/main.tf +27 -10
- package/dist/terraform/modules/app/agentcore-memory/scripts/create_or_find_memory.sh +156 -24
- package/dist/terraform/modules/app/agentcore-pi/README.md +1 -3
- package/dist/terraform/modules/app/agentcore-pi/main.tf +42 -52
- package/dist/terraform/modules/app/agentcore-pi/outputs.tf +3 -3
- package/dist/terraform/modules/app/agentcore-pi/scripts/reconcile_pi_runtime.mjs +175 -0
- package/dist/terraform/modules/app/agentcore-pi/variables.tf +35 -28
- package/dist/terraform/modules/app/agentcore-platform/main.tf +68 -0
- package/dist/terraform/modules/app/agentcore-runtime/main.tf +4 -20
- package/dist/terraform/modules/app/appsync-subscriptions/main.tf +127 -21
- package/dist/terraform/modules/app/appsync-subscriptions/outputs.tf +0 -6
- package/dist/terraform/modules/app/appsync-subscriptions/variables.tf +5 -0
- package/dist/terraform/modules/app/capability-broker/main.tf +2 -2
- package/dist/terraform/modules/app/capability-broker/variables.tf +11 -0
- package/dist/terraform/modules/app/deployment-control-plane/README.md +264 -0
- package/dist/terraform/modules/app/deployment-control-plane/buildspec.yml +4 -1
- package/dist/terraform/modules/app/deployment-control-plane/main.tf +94 -0
- package/dist/terraform/modules/app/deployment-control-plane/outputs.tf +5 -0
- package/dist/terraform/modules/app/deployment-control-plane/runner.py +3689 -233
- package/dist/terraform/modules/app/deployment-control-plane/test_runner_bundle.py +2579 -140
- package/dist/terraform/modules/app/deployment-control-plane/variables.tf +33 -0
- package/dist/terraform/modules/app/lambda-api/auth-state.tf +72 -0
- package/dist/terraform/modules/app/lambda-api/chat-latency-observability.tf +466 -0
- package/dist/terraform/modules/app/lambda-api/dispatch-dlq.tf +55 -0
- package/dist/terraform/modules/app/lambda-api/handlers.tf +531 -619
- package/dist/terraform/modules/app/lambda-api/iam-grouped.tf +350 -241
- package/dist/terraform/modules/app/lambda-api/main.tf +75 -13
- package/dist/terraform/modules/app/lambda-api/memory-alarms.tf +3 -28
- package/dist/terraform/modules/app/lambda-api/oauth-secrets.tf +1 -2
- package/dist/terraform/modules/app/lambda-api/outputs.tf +17 -10
- package/dist/terraform/modules/app/lambda-api/runtime-config.tf +3 -21
- package/dist/terraform/modules/app/lambda-api/turn-assertion.tf +45 -0
- package/dist/terraform/modules/app/lambda-api/variables.tf +307 -121
- package/dist/{plugins/n8n/terraform → terraform/modules/app}/n8n/README.md +1 -1
- package/dist/{plugins/n8n/terraform → terraform/modules/app}/n8n/main.tf +18 -18
- package/dist/terraform/modules/app/sandbox-log-scrubber/README.md +11 -10
- package/dist/terraform/modules/app/sandbox-log-scrubber/main.tf +5 -5
- package/dist/terraform/modules/app/static-site/main.tf +1 -1
- package/dist/terraform/modules/app/www-dns/main.tf +9 -27
- package/dist/terraform/modules/app/www-dns/variables.tf +4 -10
- package/dist/terraform/modules/data/aurora-postgres/README.md +34 -0
- package/dist/terraform/modules/data/aurora-postgres/alarms.tf +82 -0
- package/dist/terraform/modules/data/aurora-postgres/main.tf +27 -57
- package/dist/terraform/modules/data/aurora-postgres/outputs.tf +0 -9
- package/dist/terraform/modules/data/aurora-postgres/variables.tf +41 -0
- package/dist/terraform/modules/data/s3-buckets/main.tf +5 -6
- package/dist/terraform/modules/foundation/cognito/main.tf +367 -72
- package/dist/terraform/modules/foundation/cognito/outputs.tf +47 -0
- package/dist/terraform/modules/foundation/cognito/variables.tf +131 -9
- package/dist/terraform/modules/thinkwork/README.md +5 -1
- package/dist/terraform/modules/thinkwork/main.tf +459 -234
- package/dist/terraform/modules/thinkwork/outputs.tf +44 -62
- package/dist/terraform/modules/thinkwork/variables.tf +353 -89
- package/dist/terraform/schema.graphql +69 -36
- package/dist/workspace-defaults/files/INSTRUCTIONS.md +9 -11
- package/dist/workspace-defaults/files/MEMORY_GUIDE.md +38 -35
- package/dist/workspace-defaults/files/ROUTER.md +1 -1
- package/dist/workspace-defaults/files/TOOLS.md +9 -39
- package/dist/workspace-defaults/files/USER.md +1 -0
- package/dist/workspace-defaults/files/agents/analyst/INSTRUCTIONS.md +6 -3
- package/dist/workspace-defaults/files/catalog-skills/brain-brief-builder/SKILL.md +165 -0
- package/dist/workspace-defaults/files/catalog-skills/n8n-workflow-operator/SKILL.md +75 -0
- package/dist/workspace-defaults/files/catalog-skills/n8n-workflow-operator/references/mcp-tooling.md +40 -0
- package/dist/workspace-defaults/files/catalog-skills/n8n-workflow-operator/references/validation-and-handoff.md +40 -0
- package/dist/workspace-defaults/files/catalog-skills/n8n-workflow-operator/references/workflow-authoring.md +46 -0
- package/dist/workspace-defaults/files/skills/artifact-builder/references/crm-dashboard.md +1 -1
- package/dist/workspace-defaults/files/skills/document-composer/SKILL.md +22 -3
- package/package.json +3 -2
- package/dist/drizzle/0261_thread_turns_origin_turn_index.sql +0 -11
- package/dist/plugins/company-data/README.md +0 -49
- package/dist/plugins/company-data/package.json +0 -21
- package/dist/plugins/company-data/src/index.ts +0 -30
- package/dist/plugins/company-data/src/manifest.ts +0 -26
- package/dist/plugins/company-data/test/manifest.test.ts +0 -116
- package/dist/plugins/company-data/tsconfig.json +0 -8
- package/dist/plugins/company-etl/README.md +0 -46
- package/dist/plugins/company-etl/package.json +0 -21
- package/dist/plugins/company-etl/src/index.ts +0 -29
- package/dist/plugins/company-etl/src/manifest.ts +0 -26
- package/dist/plugins/company-etl/test/manifest.test.ts +0 -108
- package/dist/plugins/company-etl/tsconfig.json +0 -8
- package/dist/plugins/lastmile/README.md +0 -50
- package/dist/plugins/lastmile/package.json +0 -23
- package/dist/plugins/lastmile/smoke/lastmile-plugin-smoke.mjs +0 -661
- package/dist/plugins/lastmile/src/api/tasks-adapter.ts +0 -572
- package/dist/plugins/lastmile/src/discovery.fixture.ts +0 -64
- package/dist/plugins/lastmile/src/index.ts +0 -46
- package/dist/plugins/lastmile/src/manifest.ts +0 -139
- package/dist/plugins/lastmile/test/api/tasks-adapter.test.ts +0 -266
- package/dist/plugins/lastmile/test/discovery.test.ts +0 -88
- package/dist/plugins/lastmile/tsconfig.json +0 -8
- package/dist/plugins/n8n/smoke/n8n-managed-app-smoke.mjs +0 -409
- package/dist/plugins/twenty/smoke/twenty-managed-app-smoke.mjs +0 -359
- package/dist/plugins/workos-auth/package.json +0 -22
- package/dist/plugins/workos-auth/src/index.ts +0 -30
- package/dist/plugins/workos-auth/src/manifest.ts +0 -40
- package/dist/plugins/workos-auth/src/provider-contract.ts +0 -39
- package/dist/plugins/workos-auth/test/manifest.test.ts +0 -94
- package/dist/plugins/workos-auth/tsconfig.json +0 -8
- package/dist/terraform/modules/app/agentcore-code-interpreter/Dockerfile.sandbox-base +0 -61
- package/dist/terraform/modules/app/agentcore-code-interpreter/sandbox/sitecustomize.py +0 -227
- package/dist/terraform/modules/app/agentcore-code-interpreter/sandbox/test_sitecustomize.py +0 -277
- package/dist/terraform/modules/app/agentcore-code-interpreter/scripts/build_and_push_sandbox_base.sh +0 -70
- package/dist/terraform/modules/app/agentcore-harness/main.tf +0 -101
- package/dist/terraform/modules/app/agentcore-harness/outputs.tf +0 -9
- package/dist/terraform/modules/app/agentcore-harness/variables.tf +0 -25
- package/dist/terraform/modules/app/hindsight-memory/README.md +0 -89
- package/dist/terraform/modules/app/hindsight-memory/main.tf +0 -411
- package/dist/terraform/modules/data/bedrock-knowledge-base/main.tf +0 -102
- /package/dist/{plugins/n8n/terraform → terraform/modules/app}/n8n/outputs.tf +0 -0
- /package/dist/{plugins/n8n/terraform → terraform/modules/app}/n8n/scripts/sync-database.py +0 -0
- /package/dist/{plugins/n8n/terraform → terraform/modules/app}/n8n/scripts/test_sync_database.py +0 -0
- /package/dist/{plugins/n8n/terraform → terraform/modules/app}/n8n/variables.tf +0 -0
- /package/dist/{plugins/twenty/terraform → terraform/modules/app}/twenty/README.md +0 -0
- /package/dist/{plugins/twenty/terraform → terraform/modules/app}/twenty/main.tf +0 -0
- /package/dist/{plugins/twenty/terraform → terraform/modules/app}/twenty/outputs.tf +0 -0
- /package/dist/{plugins/twenty/terraform → terraform/modules/app}/twenty/variables.tf +0 -0
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
toUint8Array
|
|
4
|
+
} from "./chunk-OCPHU34C.js";
|
|
5
|
+
|
|
6
|
+
// ../../node_modules/.pnpm/@smithy+core@3.29.5/node_modules/@smithy/core/dist-es/submodules/checksum/crc32/Crc32Node.js
|
|
7
|
+
import * as zlib from "zlib";
|
|
8
|
+
|
|
9
|
+
// ../../node_modules/.pnpm/@smithy+core@3.29.5/node_modules/@smithy/core/dist-es/submodules/checksum/crc32/Crc32Js.js
|
|
10
|
+
var CRC32_TABLE = new Uint32Array(256);
|
|
11
|
+
for (let i = 0; i < 256; ++i) {
|
|
12
|
+
let c = i;
|
|
13
|
+
for (let j = 0; j < 8; ++j) {
|
|
14
|
+
c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
|
|
15
|
+
}
|
|
16
|
+
CRC32_TABLE[i] = c >>> 0;
|
|
17
|
+
}
|
|
18
|
+
var ONES = 4294967295;
|
|
19
|
+
var Crc32Js = class {
|
|
20
|
+
digestLength = 4;
|
|
21
|
+
checksum = ONES;
|
|
22
|
+
update(data) {
|
|
23
|
+
for (let i = 0; i < data.length; ++i) {
|
|
24
|
+
this.checksum = this.checksum >>> 8 ^ CRC32_TABLE[(this.checksum ^ data[i]) & 255];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
digestSync() {
|
|
28
|
+
return (this.checksum ^ ONES) >>> 0;
|
|
29
|
+
}
|
|
30
|
+
async digest() {
|
|
31
|
+
const value = this.digestSync();
|
|
32
|
+
const out = new Uint8Array(4);
|
|
33
|
+
new DataView(out.buffer).setUint32(0, value, false);
|
|
34
|
+
return out;
|
|
35
|
+
}
|
|
36
|
+
reset() {
|
|
37
|
+
this.checksum = ONES;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// ../../node_modules/.pnpm/@smithy+core@3.29.5/node_modules/@smithy/core/dist-es/submodules/checksum/crc32/Crc32Node.js
|
|
42
|
+
var zlibCrc32 = typeof zlib.crc32 === "function" ? zlib.crc32 : void 0;
|
|
43
|
+
var Crc32Node = zlibCrc32 ? buildNativeClass(zlibCrc32) : Crc32Js;
|
|
44
|
+
function buildNativeClass(nativeCrc32) {
|
|
45
|
+
return class Crc32Node {
|
|
46
|
+
digestLength = 4;
|
|
47
|
+
value = 0;
|
|
48
|
+
update(data) {
|
|
49
|
+
this.value = nativeCrc32(data, this.value);
|
|
50
|
+
}
|
|
51
|
+
digestSync() {
|
|
52
|
+
return this.value >>> 0;
|
|
53
|
+
}
|
|
54
|
+
async digest() {
|
|
55
|
+
const out = new Uint8Array(4);
|
|
56
|
+
new DataView(out.buffer).setUint32(0, this.digestSync(), false);
|
|
57
|
+
return out;
|
|
58
|
+
}
|
|
59
|
+
reset() {
|
|
60
|
+
this.value = 0;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// ../../node_modules/.pnpm/@smithy+core@3.29.5/node_modules/@smithy/core/dist-es/submodules/checksum/sha256/Sha256Js.js
|
|
66
|
+
var BLOCK = 64;
|
|
67
|
+
var DIGEST_LENGTH = 32;
|
|
68
|
+
var MAX_HASHABLE_LENGTH = 2 ** 53 - 1;
|
|
69
|
+
var Sha256Js = class _Sha256Js {
|
|
70
|
+
digestLength = DIGEST_LENGTH;
|
|
71
|
+
state = Int32Array.from(INIT);
|
|
72
|
+
w;
|
|
73
|
+
buffer = new Uint8Array(64);
|
|
74
|
+
bufferLength = 0;
|
|
75
|
+
bytesHashed = 0;
|
|
76
|
+
finished = false;
|
|
77
|
+
inner;
|
|
78
|
+
outer;
|
|
79
|
+
constructor(secret) {
|
|
80
|
+
if (secret) {
|
|
81
|
+
const key = _Sha256Js.normalizeKey(secret);
|
|
82
|
+
this.inner = new _Sha256Js();
|
|
83
|
+
this.outer = new _Sha256Js();
|
|
84
|
+
const { inner, outer } = this;
|
|
85
|
+
const pad = new Uint8Array(BLOCK * 2);
|
|
86
|
+
for (let i = 0; i < BLOCK; ++i) {
|
|
87
|
+
pad[i] = 54 ^ key[i];
|
|
88
|
+
pad[i + BLOCK] = 92 ^ key[i];
|
|
89
|
+
}
|
|
90
|
+
inner.update(pad.subarray(0, BLOCK));
|
|
91
|
+
outer.update(pad.subarray(BLOCK));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
update(data) {
|
|
95
|
+
if (this.finished) {
|
|
96
|
+
throw new Error("Attempted to update an already finished HMAC.");
|
|
97
|
+
}
|
|
98
|
+
if (this.inner) {
|
|
99
|
+
this.inner.update(data);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const chunk = toUint8Array(data);
|
|
103
|
+
let position = 0;
|
|
104
|
+
let { byteLength } = chunk;
|
|
105
|
+
this.bytesHashed += byteLength;
|
|
106
|
+
if (this.bytesHashed * 8 > MAX_HASHABLE_LENGTH) {
|
|
107
|
+
throw new Error("Cannot hash more than 2^53 - 1 bits");
|
|
108
|
+
}
|
|
109
|
+
while (byteLength > 0) {
|
|
110
|
+
this.buffer[this.bufferLength++] = chunk[position++];
|
|
111
|
+
byteLength--;
|
|
112
|
+
if (this.bufferLength === BLOCK) {
|
|
113
|
+
this.hashBuffer();
|
|
114
|
+
this.bufferLength = 0;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
async digest() {
|
|
119
|
+
const { inner, outer } = this;
|
|
120
|
+
if (inner && outer) {
|
|
121
|
+
if (this.finished) {
|
|
122
|
+
throw new Error("Attempted to digest an already finished HMAC.");
|
|
123
|
+
}
|
|
124
|
+
this.finished = true;
|
|
125
|
+
const innerDigest = inner.digestSync();
|
|
126
|
+
outer.update(innerDigest);
|
|
127
|
+
return outer.digestSync();
|
|
128
|
+
}
|
|
129
|
+
return this.digestSync();
|
|
130
|
+
}
|
|
131
|
+
reset() {
|
|
132
|
+
this.state = Int32Array.from(INIT);
|
|
133
|
+
this.buffer = new Uint8Array(64);
|
|
134
|
+
this.bufferLength = 0;
|
|
135
|
+
this.bytesHashed = 0;
|
|
136
|
+
}
|
|
137
|
+
digestSync() {
|
|
138
|
+
const state = this.state.slice();
|
|
139
|
+
const buffer = this.buffer.slice();
|
|
140
|
+
let bufferLength = this.bufferLength;
|
|
141
|
+
const bitsHashed = this.bytesHashed * 8;
|
|
142
|
+
const bufferView = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
|
143
|
+
bufferView.setUint8(bufferLength++, 128);
|
|
144
|
+
if ((bufferLength - 1) % BLOCK >= BLOCK - 8) {
|
|
145
|
+
for (let i = bufferLength; i < BLOCK; ++i) {
|
|
146
|
+
bufferView.setUint8(i, 0);
|
|
147
|
+
}
|
|
148
|
+
this.hashBufferWith(state, buffer);
|
|
149
|
+
bufferLength = 0;
|
|
150
|
+
}
|
|
151
|
+
for (let i = bufferLength; i < BLOCK - 8; ++i) {
|
|
152
|
+
bufferView.setUint8(i, 0);
|
|
153
|
+
}
|
|
154
|
+
bufferView.setUint32(BLOCK - 8, Math.floor(bitsHashed / 4294967296), false);
|
|
155
|
+
bufferView.setUint32(BLOCK - 4, bitsHashed, false);
|
|
156
|
+
this.hashBufferWith(state, buffer);
|
|
157
|
+
const out = new Uint8Array(DIGEST_LENGTH);
|
|
158
|
+
for (let i = 0; i < 8; ++i) {
|
|
159
|
+
out[i * 4] = state[i] >>> 24 & 255;
|
|
160
|
+
out[i * 4 + 1] = state[i] >>> 16 & 255;
|
|
161
|
+
out[i * 4 + 2] = state[i] >>> 8 & 255;
|
|
162
|
+
out[i * 4 + 3] = state[i] >>> 0 & 255;
|
|
163
|
+
}
|
|
164
|
+
return out;
|
|
165
|
+
}
|
|
166
|
+
static normalizeKey(secret) {
|
|
167
|
+
const key = toUint8Array(secret);
|
|
168
|
+
if (key.byteLength > BLOCK) {
|
|
169
|
+
const h = new _Sha256Js();
|
|
170
|
+
h.update(key);
|
|
171
|
+
const out = h.digestSync();
|
|
172
|
+
const padded = new Uint8Array(BLOCK);
|
|
173
|
+
padded.set(out);
|
|
174
|
+
return padded;
|
|
175
|
+
}
|
|
176
|
+
if (key.byteLength < BLOCK) {
|
|
177
|
+
const padded = new Uint8Array(BLOCK);
|
|
178
|
+
padded.set(key);
|
|
179
|
+
return padded;
|
|
180
|
+
}
|
|
181
|
+
return key;
|
|
182
|
+
}
|
|
183
|
+
hashBuffer() {
|
|
184
|
+
this.hashBufferWith(this.state, this.buffer);
|
|
185
|
+
}
|
|
186
|
+
hashBufferWith(state, buffer) {
|
|
187
|
+
const w = this.w ??= new Int32Array(64);
|
|
188
|
+
let s0 = state[0], s1 = state[1], s2 = state[2], s3 = state[3], s4 = state[4], s5 = state[5], s6 = state[6], s7 = state[7];
|
|
189
|
+
for (let i = 0; i < BLOCK; ++i) {
|
|
190
|
+
if (i < 16) {
|
|
191
|
+
w[i] = (buffer[i * 4] & 255) << 24 | (buffer[i * 4 + 1] & 255) << 16 | (buffer[i * 4 + 2] & 255) << 8 | buffer[i * 4 + 3] & 255;
|
|
192
|
+
} else {
|
|
193
|
+
let u = w[i - 2];
|
|
194
|
+
const t12 = (u >>> 17 | u << 15) ^ (u >>> 19 | u << 13) ^ u >>> 10;
|
|
195
|
+
u = w[i - 15];
|
|
196
|
+
const t22 = (u >>> 7 | u << 25) ^ (u >>> 18 | u << 14) ^ u >>> 3;
|
|
197
|
+
w[i] = (t12 + w[i - 7] | 0) + (t22 + w[i - 16] | 0);
|
|
198
|
+
}
|
|
199
|
+
const t1 = (((s4 >>> 6 | s4 << 26) ^ (s4 >>> 11 | s4 << 21) ^ (s4 >>> 25 | s4 << 7)) + (s4 & s5 ^ ~s4 & s6) | 0) + (s7 + (K[i] + w[i] | 0) | 0) | 0;
|
|
200
|
+
const t2 = ((s0 >>> 2 | s0 << 30) ^ (s0 >>> 13 | s0 << 19) ^ (s0 >>> 22 | s0 << 10)) + (s0 & s1 ^ s0 & s2 ^ s1 & s2) | 0;
|
|
201
|
+
s7 = s6;
|
|
202
|
+
s6 = s5;
|
|
203
|
+
s5 = s4;
|
|
204
|
+
s4 = s3 + t1 | 0;
|
|
205
|
+
s3 = s2;
|
|
206
|
+
s2 = s1;
|
|
207
|
+
s1 = s0;
|
|
208
|
+
s0 = t1 + t2 | 0;
|
|
209
|
+
}
|
|
210
|
+
state[0] += s0;
|
|
211
|
+
state[1] += s1;
|
|
212
|
+
state[2] += s2;
|
|
213
|
+
state[3] += s3;
|
|
214
|
+
state[4] += s4;
|
|
215
|
+
state[5] += s5;
|
|
216
|
+
state[6] += s6;
|
|
217
|
+
state[7] += s7;
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
var INIT = new Int32Array([
|
|
221
|
+
1779033703,
|
|
222
|
+
3144134277,
|
|
223
|
+
1013904242,
|
|
224
|
+
2773480762,
|
|
225
|
+
1359893119,
|
|
226
|
+
2600822924,
|
|
227
|
+
528734635,
|
|
228
|
+
1541459225
|
|
229
|
+
]);
|
|
230
|
+
var K = new Int32Array([
|
|
231
|
+
1116352408,
|
|
232
|
+
1899447441,
|
|
233
|
+
3049323471,
|
|
234
|
+
3921009573,
|
|
235
|
+
961987163,
|
|
236
|
+
1508970993,
|
|
237
|
+
2453635748,
|
|
238
|
+
2870763221,
|
|
239
|
+
3624381080,
|
|
240
|
+
310598401,
|
|
241
|
+
607225278,
|
|
242
|
+
1426881987,
|
|
243
|
+
1925078388,
|
|
244
|
+
2162078206,
|
|
245
|
+
2614888103,
|
|
246
|
+
3248222580,
|
|
247
|
+
3835390401,
|
|
248
|
+
4022224774,
|
|
249
|
+
264347078,
|
|
250
|
+
604807628,
|
|
251
|
+
770255983,
|
|
252
|
+
1249150122,
|
|
253
|
+
1555081692,
|
|
254
|
+
1996064986,
|
|
255
|
+
2554220882,
|
|
256
|
+
2821834349,
|
|
257
|
+
2952996808,
|
|
258
|
+
3210313671,
|
|
259
|
+
3336571891,
|
|
260
|
+
3584528711,
|
|
261
|
+
113926993,
|
|
262
|
+
338241895,
|
|
263
|
+
666307205,
|
|
264
|
+
773529912,
|
|
265
|
+
1294757372,
|
|
266
|
+
1396182291,
|
|
267
|
+
1695183700,
|
|
268
|
+
1986661051,
|
|
269
|
+
2177026350,
|
|
270
|
+
2456956037,
|
|
271
|
+
2730485921,
|
|
272
|
+
2820302411,
|
|
273
|
+
3259730800,
|
|
274
|
+
3345764771,
|
|
275
|
+
3516065817,
|
|
276
|
+
3600352804,
|
|
277
|
+
4094571909,
|
|
278
|
+
275423344,
|
|
279
|
+
430227734,
|
|
280
|
+
506948616,
|
|
281
|
+
659060556,
|
|
282
|
+
883997877,
|
|
283
|
+
958139571,
|
|
284
|
+
1322822218,
|
|
285
|
+
1537002063,
|
|
286
|
+
1747873779,
|
|
287
|
+
1955562222,
|
|
288
|
+
2024104815,
|
|
289
|
+
2227730452,
|
|
290
|
+
2361852424,
|
|
291
|
+
2428436474,
|
|
292
|
+
2756734187,
|
|
293
|
+
3204031479,
|
|
294
|
+
3329325298
|
|
295
|
+
]);
|
|
296
|
+
|
|
297
|
+
// ../../node_modules/.pnpm/@smithy+core@3.29.5/node_modules/@smithy/core/dist-es/submodules/checksum/sha256/Sha256Node.js
|
|
298
|
+
import { createHash, createHmac } from "crypto";
|
|
299
|
+
var hasNativeCrypto = (() => {
|
|
300
|
+
try {
|
|
301
|
+
createHash("sha256");
|
|
302
|
+
return true;
|
|
303
|
+
} catch {
|
|
304
|
+
return false;
|
|
305
|
+
}
|
|
306
|
+
})();
|
|
307
|
+
var Sha256Node = hasNativeCrypto ? buildNativeClass2() : Sha256Js;
|
|
308
|
+
function buildNativeClass2() {
|
|
309
|
+
return class Sha256Node {
|
|
310
|
+
digestLength = 32;
|
|
311
|
+
secret;
|
|
312
|
+
hash;
|
|
313
|
+
isHmac;
|
|
314
|
+
finished = false;
|
|
315
|
+
constructor(secret) {
|
|
316
|
+
this.secret = secret;
|
|
317
|
+
this.isHmac = !!secret;
|
|
318
|
+
this.hash = this.createHash();
|
|
319
|
+
}
|
|
320
|
+
update(data) {
|
|
321
|
+
if (this.finished) {
|
|
322
|
+
throw new Error("Attempted to update an already finished hash.");
|
|
323
|
+
}
|
|
324
|
+
this.hash.update(data);
|
|
325
|
+
}
|
|
326
|
+
async digest() {
|
|
327
|
+
let buf;
|
|
328
|
+
if (this.isHmac) {
|
|
329
|
+
this.finished = true;
|
|
330
|
+
buf = this.hash.digest();
|
|
331
|
+
} else {
|
|
332
|
+
buf = this.hash.copy().digest();
|
|
333
|
+
}
|
|
334
|
+
return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
335
|
+
}
|
|
336
|
+
reset() {
|
|
337
|
+
this.hash = this.createHash();
|
|
338
|
+
this.finished = false;
|
|
339
|
+
}
|
|
340
|
+
createHash() {
|
|
341
|
+
return this.secret ? createHmac("sha256", toBuffer(this.secret)) : createHash("sha256");
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
function toBuffer(data) {
|
|
346
|
+
if (typeof data === "string") {
|
|
347
|
+
return data;
|
|
348
|
+
}
|
|
349
|
+
if (ArrayBuffer.isView(data)) {
|
|
350
|
+
return Buffer.from(data.buffer, data.byteOffset, data.byteLength);
|
|
351
|
+
}
|
|
352
|
+
return Buffer.from(data);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export {
|
|
356
|
+
Crc32Node,
|
|
357
|
+
Sha256Node
|
|
358
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// ../../node_modules/.pnpm/@aws-sdk+nested-clients@3.997.33/node_modules/@aws-sdk/nested-clients/package.json
|
|
4
|
+
var package_default = {
|
|
5
|
+
name: "@aws-sdk/nested-clients",
|
|
6
|
+
version: "3.997.33",
|
|
7
|
+
description: "Nested clients for AWS SDK packages.",
|
|
8
|
+
homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients",
|
|
9
|
+
license: "Apache-2.0",
|
|
10
|
+
author: {
|
|
11
|
+
name: "AWS SDK for JavaScript Team",
|
|
12
|
+
url: "https://aws.amazon.com/sdk-for-javascript/"
|
|
13
|
+
},
|
|
14
|
+
repository: {
|
|
15
|
+
type: "git",
|
|
16
|
+
url: "https://github.com/aws/aws-sdk-js-v3.git",
|
|
17
|
+
directory: "packages/nested-clients"
|
|
18
|
+
},
|
|
19
|
+
files: [
|
|
20
|
+
"./cognito-identity.d.ts",
|
|
21
|
+
"./cognito-identity.js",
|
|
22
|
+
"./signin.d.ts",
|
|
23
|
+
"./signin.js",
|
|
24
|
+
"./sso-oidc.d.ts",
|
|
25
|
+
"./sso-oidc.js",
|
|
26
|
+
"./sso.d.ts",
|
|
27
|
+
"./sso.js",
|
|
28
|
+
"./sts.d.ts",
|
|
29
|
+
"./sts.js",
|
|
30
|
+
"dist-*/**"
|
|
31
|
+
],
|
|
32
|
+
sideEffects: false,
|
|
33
|
+
main: "./dist-cjs/index.js",
|
|
34
|
+
module: "./dist-es/index.js",
|
|
35
|
+
browser: {
|
|
36
|
+
"./dist-es/submodules/cognito-identity/runtimeConfig": "./dist-es/submodules/cognito-identity/runtimeConfig.browser",
|
|
37
|
+
"./dist-es/submodules/signin/runtimeConfig": "./dist-es/submodules/signin/runtimeConfig.browser",
|
|
38
|
+
"./dist-es/submodules/sso-oidc/runtimeConfig": "./dist-es/submodules/sso-oidc/runtimeConfig.browser",
|
|
39
|
+
"./dist-es/submodules/sso/runtimeConfig": "./dist-es/submodules/sso/runtimeConfig.browser",
|
|
40
|
+
"./dist-es/submodules/sts/runtimeConfig": "./dist-es/submodules/sts/runtimeConfig.browser"
|
|
41
|
+
},
|
|
42
|
+
types: "./dist-types/index.d.ts",
|
|
43
|
+
typesVersions: {
|
|
44
|
+
"<4.5": {
|
|
45
|
+
"dist-types/*": [
|
|
46
|
+
"dist-types/ts3.4/*"
|
|
47
|
+
],
|
|
48
|
+
"*": [
|
|
49
|
+
"dist-types/ts3.4/submodules/*/index.d.ts"
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"react-native": {},
|
|
54
|
+
exports: {
|
|
55
|
+
"./package.json": "./package.json",
|
|
56
|
+
"./sso-oidc": {
|
|
57
|
+
types: "./dist-types/submodules/sso-oidc/index.d.ts",
|
|
58
|
+
module: "./dist-es/submodules/sso-oidc/index.js",
|
|
59
|
+
node: "./dist-cjs/submodules/sso-oidc/index.js",
|
|
60
|
+
import: "./dist-es/submodules/sso-oidc/index.js",
|
|
61
|
+
require: "./dist-cjs/submodules/sso-oidc/index.js"
|
|
62
|
+
},
|
|
63
|
+
"./sts": {
|
|
64
|
+
types: "./dist-types/submodules/sts/index.d.ts",
|
|
65
|
+
module: "./dist-es/submodules/sts/index.js",
|
|
66
|
+
node: "./dist-cjs/submodules/sts/index.js",
|
|
67
|
+
import: "./dist-es/submodules/sts/index.js",
|
|
68
|
+
require: "./dist-cjs/submodules/sts/index.js"
|
|
69
|
+
},
|
|
70
|
+
"./signin": {
|
|
71
|
+
types: "./dist-types/submodules/signin/index.d.ts",
|
|
72
|
+
module: "./dist-es/submodules/signin/index.js",
|
|
73
|
+
node: "./dist-cjs/submodules/signin/index.js",
|
|
74
|
+
import: "./dist-es/submodules/signin/index.js",
|
|
75
|
+
require: "./dist-cjs/submodules/signin/index.js"
|
|
76
|
+
},
|
|
77
|
+
"./cognito-identity": {
|
|
78
|
+
types: "./dist-types/submodules/cognito-identity/index.d.ts",
|
|
79
|
+
module: "./dist-es/submodules/cognito-identity/index.js",
|
|
80
|
+
node: "./dist-cjs/submodules/cognito-identity/index.js",
|
|
81
|
+
import: "./dist-es/submodules/cognito-identity/index.js",
|
|
82
|
+
require: "./dist-cjs/submodules/cognito-identity/index.js"
|
|
83
|
+
},
|
|
84
|
+
"./sso": {
|
|
85
|
+
types: "./dist-types/submodules/sso/index.d.ts",
|
|
86
|
+
module: "./dist-es/submodules/sso/index.js",
|
|
87
|
+
node: "./dist-cjs/submodules/sso/index.js",
|
|
88
|
+
import: "./dist-es/submodules/sso/index.js",
|
|
89
|
+
require: "./dist-cjs/submodules/sso/index.js"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
scripts: {
|
|
93
|
+
build: "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
|
|
94
|
+
"build:cjs": "node ../../scripts/compilation/inline",
|
|
95
|
+
"build:es": "premove dist-es && tsc -p tsconfig.es.json",
|
|
96
|
+
"build:include:deps": 'yarn g:turbo run build -F="$npm_package_name"',
|
|
97
|
+
"build:types": "premove dist-types && tsc -p tsconfig.types.json",
|
|
98
|
+
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
|
|
99
|
+
clean: "premove dist-cjs dist-es dist-types",
|
|
100
|
+
lint: "node ../../scripts/validation/submodules-linter.js",
|
|
101
|
+
prebuild: "yarn lint",
|
|
102
|
+
test: "yarn g:vitest run",
|
|
103
|
+
"test:watch": "yarn g:vitest watch"
|
|
104
|
+
},
|
|
105
|
+
dependencies: {
|
|
106
|
+
"@aws-sdk/core": "^3.975.3",
|
|
107
|
+
"@aws-sdk/signature-v4-multi-region": "^3.996.41",
|
|
108
|
+
"@aws-sdk/types": "^3.974.2",
|
|
109
|
+
"@smithy/core": "^3.29.4",
|
|
110
|
+
"@smithy/fetch-http-handler": "^5.6.6",
|
|
111
|
+
"@smithy/node-http-handler": "^4.9.6",
|
|
112
|
+
"@smithy/types": "^4.16.1",
|
|
113
|
+
tslib: "^2.6.2"
|
|
114
|
+
},
|
|
115
|
+
devDependencies: {
|
|
116
|
+
concurrently: "7.0.0",
|
|
117
|
+
"downlevel-dts": "0.10.1",
|
|
118
|
+
premove: "4.0.0",
|
|
119
|
+
typescript: "~5.8.3"
|
|
120
|
+
},
|
|
121
|
+
engines: {
|
|
122
|
+
node: ">=20.0.0"
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export {
|
|
127
|
+
package_default
|
|
128
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
SignatureV4,
|
|
4
|
+
signatureV4aContainer
|
|
5
|
+
} from "./chunk-EI5ZX7CN.js";
|
|
6
|
+
|
|
7
|
+
// ../../node_modules/.pnpm/@aws-sdk+signature-v4-multi-region@3.996.41/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/signature-v4-crt-container.js
|
|
8
|
+
var signatureV4CrtContainer = {
|
|
9
|
+
CrtSignerV4: null
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// ../../node_modules/.pnpm/@aws-sdk+signature-v4-multi-region@3.996.41/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/SignatureV4SignWithCredentials.js
|
|
13
|
+
var SESSION_TOKEN_QUERY_PARAM = "X-Amz-S3session-Token";
|
|
14
|
+
var SESSION_TOKEN_HEADER = SESSION_TOKEN_QUERY_PARAM.toLowerCase();
|
|
15
|
+
var SignatureV4SignWithCredentials = class extends SignatureV4 {
|
|
16
|
+
async signWithCredentials(requestToSign, credentials, options) {
|
|
17
|
+
const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials);
|
|
18
|
+
requestToSign.headers[SESSION_TOKEN_HEADER] = credentials.sessionToken;
|
|
19
|
+
const privateAccess = this;
|
|
20
|
+
setSingleOverride(privateAccess, credentialsWithoutSessionToken);
|
|
21
|
+
return privateAccess.signRequest(requestToSign, options ?? {});
|
|
22
|
+
}
|
|
23
|
+
async presignWithCredentials(requestToSign, credentials, options) {
|
|
24
|
+
const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials);
|
|
25
|
+
delete requestToSign.headers[SESSION_TOKEN_HEADER];
|
|
26
|
+
requestToSign.headers[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken;
|
|
27
|
+
requestToSign.query = requestToSign.query ?? {};
|
|
28
|
+
requestToSign.query[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken;
|
|
29
|
+
const privateAccess = this;
|
|
30
|
+
setSingleOverride(privateAccess, credentialsWithoutSessionToken);
|
|
31
|
+
return this.presign(requestToSign, options);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
function getCredentialsWithoutSessionToken(credentials) {
|
|
35
|
+
return {
|
|
36
|
+
accessKeyId: credentials.accessKeyId,
|
|
37
|
+
secretAccessKey: credentials.secretAccessKey,
|
|
38
|
+
expiration: credentials.expiration
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function setSingleOverride(privateAccess, credentialsWithoutSessionToken) {
|
|
42
|
+
const currentCredentialProvider = privateAccess.credentialProvider;
|
|
43
|
+
privateAccess.credentialProvider = () => {
|
|
44
|
+
privateAccess.credentialProvider = currentCredentialProvider;
|
|
45
|
+
return Promise.resolve(credentialsWithoutSessionToken);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// ../../node_modules/.pnpm/@aws-sdk+signature-v4-multi-region@3.996.41/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/SignatureV4MultiRegion.js
|
|
50
|
+
var SignatureV4MultiRegion = class {
|
|
51
|
+
sigv4aSigner;
|
|
52
|
+
sigv4Signer;
|
|
53
|
+
signerOptions;
|
|
54
|
+
static sigv4aDependency() {
|
|
55
|
+
if (typeof signatureV4CrtContainer.CrtSignerV4 === "function") {
|
|
56
|
+
return "crt";
|
|
57
|
+
} else if (typeof signatureV4aContainer.SignatureV4a === "function") {
|
|
58
|
+
return "js";
|
|
59
|
+
}
|
|
60
|
+
return "none";
|
|
61
|
+
}
|
|
62
|
+
constructor(options) {
|
|
63
|
+
this.sigv4Signer = new SignatureV4SignWithCredentials(options);
|
|
64
|
+
this.signerOptions = options;
|
|
65
|
+
}
|
|
66
|
+
async sign(requestToSign, options = {}) {
|
|
67
|
+
if (options.signingRegion === "*") {
|
|
68
|
+
return this.getSigv4aSigner().sign(requestToSign, options);
|
|
69
|
+
}
|
|
70
|
+
return this.sigv4Signer.sign(requestToSign, options);
|
|
71
|
+
}
|
|
72
|
+
async signWithCredentials(requestToSign, credentials, options = {}) {
|
|
73
|
+
if (options.signingRegion === "*") {
|
|
74
|
+
const signer = this.getSigv4aSigner();
|
|
75
|
+
const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4;
|
|
76
|
+
if (CrtSignerV4 && signer instanceof CrtSignerV4) {
|
|
77
|
+
return signer.signWithCredentials(requestToSign, credentials, options);
|
|
78
|
+
} else {
|
|
79
|
+
throw new Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return this.sigv4Signer.signWithCredentials(requestToSign, credentials, options);
|
|
83
|
+
}
|
|
84
|
+
async presign(originalRequest, options = {}) {
|
|
85
|
+
if (options.signingRegion === "*") {
|
|
86
|
+
const signer = this.getSigv4aSigner();
|
|
87
|
+
const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4;
|
|
88
|
+
if (CrtSignerV4 && signer instanceof CrtSignerV4) {
|
|
89
|
+
return signer.presign(originalRequest, options);
|
|
90
|
+
} else {
|
|
91
|
+
throw new Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return this.sigv4Signer.presign(originalRequest, options);
|
|
95
|
+
}
|
|
96
|
+
async presignWithCredentials(originalRequest, credentials, options = {}) {
|
|
97
|
+
if (options.signingRegion === "*") {
|
|
98
|
+
throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");
|
|
99
|
+
}
|
|
100
|
+
return this.sigv4Signer.presignWithCredentials(originalRequest, credentials, options);
|
|
101
|
+
}
|
|
102
|
+
getSigv4aSigner() {
|
|
103
|
+
if (!this.sigv4aSigner) {
|
|
104
|
+
const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4;
|
|
105
|
+
const JsSigV4aSigner = signatureV4aContainer.SignatureV4a;
|
|
106
|
+
if (this.signerOptions.runtime === "node") {
|
|
107
|
+
if (!CrtSignerV4 && !JsSigV4aSigner) {
|
|
108
|
+
throw new Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");
|
|
109
|
+
}
|
|
110
|
+
if (CrtSignerV4 && typeof CrtSignerV4 === "function") {
|
|
111
|
+
this.sigv4aSigner = new CrtSignerV4({
|
|
112
|
+
...this.signerOptions,
|
|
113
|
+
signingAlgorithm: 1
|
|
114
|
+
});
|
|
115
|
+
} else if (JsSigV4aSigner && typeof JsSigV4aSigner === "function") {
|
|
116
|
+
this.sigv4aSigner = new JsSigV4aSigner({
|
|
117
|
+
...this.signerOptions
|
|
118
|
+
});
|
|
119
|
+
} else {
|
|
120
|
+
throw new Error("Available SigV4a implementation is not a valid constructor. Please ensure you've properly imported @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a.For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");
|
|
121
|
+
}
|
|
122
|
+
} else {
|
|
123
|
+
if (!JsSigV4aSigner || typeof JsSigV4aSigner !== "function") {
|
|
124
|
+
throw new Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a");
|
|
125
|
+
}
|
|
126
|
+
this.sigv4aSigner = new JsSigV4aSigner({
|
|
127
|
+
...this.signerOptions
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return this.sigv4aSigner;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export {
|
|
136
|
+
SignatureV4MultiRegion
|
|
137
|
+
};
|