@distilled.cloud/stackit 0.0.0-stage → 1.0.0-rc.14
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 +201 -0
- package/README.md +33 -2
- package/lib/credentials.d.ts +29 -0
- package/lib/credentials.d.ts.map +1 -0
- package/lib/credentials.js +49 -0
- package/lib/credentials.js.map +1 -0
- package/lib/errors.d.ts +36 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +26 -0
- package/lib/errors.js.map +1 -0
- package/lib/index.d.ts +30 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +30 -0
- package/lib/index.js.map +1 -0
- package/lib/pagination.d.ts +9 -0
- package/lib/pagination.d.ts.map +1 -0
- package/lib/pagination.js +45 -0
- package/lib/pagination.js.map +1 -0
- package/lib/protocol.d.ts +32 -0
- package/lib/protocol.d.ts.map +1 -0
- package/lib/protocol.js +147 -0
- package/lib/protocol.js.map +1 -0
- package/lib/protocol.test.d.ts +2 -0
- package/lib/protocol.test.d.ts.map +1 -0
- package/lib/protocol.test.js +181 -0
- package/lib/protocol.test.js.map +1 -0
- package/lib/retry.d.ts +31 -0
- package/lib/retry.d.ts.map +1 -0
- package/lib/retry.js +31 -0
- package/lib/retry.js.map +1 -0
- package/lib/services/alb.d.ts +603 -0
- package/lib/services/alb.d.ts.map +1 -0
- package/lib/services/alb.js +513 -0
- package/lib/services/alb.js.map +1 -0
- package/lib/services/alb_waf.d.ts +526 -0
- package/lib/services/alb_waf.d.ts.map +1 -0
- package/lib/services/alb_waf.js +521 -0
- package/lib/services/alb_waf.js.map +1 -0
- package/lib/services/authorization.d.ts +251 -0
- package/lib/services/authorization.d.ts.map +1 -0
- package/lib/services/authorization.js +323 -0
- package/lib/services/authorization.js.map +1 -0
- package/lib/services/automation.d.ts +321 -0
- package/lib/services/automation.d.ts.map +1 -0
- package/lib/services/automation.js +363 -0
- package/lib/services/automation.js.map +1 -0
- package/lib/services/cdn.d.ts +1239 -0
- package/lib/services/cdn.d.ts.map +1 -0
- package/lib/services/cdn.js +906 -0
- package/lib/services/cdn.js.map +1 -0
- package/lib/services/certificates.d.ts +201 -0
- package/lib/services/certificates.d.ts.map +1 -0
- package/lib/services/certificates.js +179 -0
- package/lib/services/certificates.js.map +1 -0
- package/lib/services/cost.d.ts +222 -0
- package/lib/services/cost.d.ts.map +1 -0
- package/lib/services/cost.js +177 -0
- package/lib/services/cost.js.map +1 -0
- package/lib/services/dns.d.ts +842 -0
- package/lib/services/dns.d.ts.map +1 -0
- package/lib/services/dns.js +726 -0
- package/lib/services/dns.js.map +1 -0
- package/lib/services/dremio.d.ts +358 -0
- package/lib/services/dremio.d.ts.map +1 -0
- package/lib/services/dremio.js +317 -0
- package/lib/services/dremio.js.map +1 -0
- package/lib/services/edge.d.ts +312 -0
- package/lib/services/edge.d.ts.map +1 -0
- package/lib/services/edge.js +357 -0
- package/lib/services/edge.js.map +1 -0
- package/lib/services/functions.d.ts +409 -0
- package/lib/services/functions.d.ts.map +1 -0
- package/lib/services/functions.js +399 -0
- package/lib/services/functions.js.map +1 -0
- package/lib/services/git.d.ts +497 -0
- package/lib/services/git.d.ts.map +1 -0
- package/lib/services/git.js +520 -0
- package/lib/services/git.js.map +1 -0
- package/lib/services/iaas.d.ts +2986 -0
- package/lib/services/iaas.d.ts.map +1 -0
- package/lib/services/iaas.js +3543 -0
- package/lib/services/iaas.js.map +1 -0
- package/lib/services/index.d.ts +51 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/index.js +52 -0
- package/lib/services/index.js.map +1 -0
- package/lib/services/intake.d.ts +555 -0
- package/lib/services/intake.d.ts.map +1 -0
- package/lib/services/intake.js +475 -0
- package/lib/services/intake.js.map +1 -0
- package/lib/services/kms.d.ts +654 -0
- package/lib/services/kms.d.ts.map +1 -0
- package/lib/services/kms.js +663 -0
- package/lib/services/kms.js.map +1 -0
- package/lib/services/lb_ip_lists.d.ts +160 -0
- package/lib/services/lb_ip_lists.d.ts.map +1 -0
- package/lib/services/lb_ip_lists.js +154 -0
- package/lib/services/lb_ip_lists.js.map +1 -0
- package/lib/services/load_balancer.d.ts +563 -0
- package/lib/services/load_balancer.d.ts.map +1 -0
- package/lib/services/load_balancer.js +497 -0
- package/lib/services/load_balancer.js.map +1 -0
- package/lib/services/logme.d.ts +516 -0
- package/lib/services/logme.d.ts.map +1 -0
- package/lib/services/logme.js +574 -0
- package/lib/services/logme.js.map +1 -0
- package/lib/services/logs.d.ts +436 -0
- package/lib/services/logs.d.ts.map +1 -0
- package/lib/services/logs.js +475 -0
- package/lib/services/logs.js.map +1 -0
- package/lib/services/mariadb.d.ts +479 -0
- package/lib/services/mariadb.d.ts.map +1 -0
- package/lib/services/mariadb.js +551 -0
- package/lib/services/mariadb.js.map +1 -0
- package/lib/services/model_experiments.d.ts +306 -0
- package/lib/services/model_experiments.d.ts.map +1 -0
- package/lib/services/model_experiments.js +336 -0
- package/lib/services/model_experiments.js.map +1 -0
- package/lib/services/model_serving.d.ts +289 -0
- package/lib/services/model_serving.d.ts.map +1 -0
- package/lib/services/model_serving.js +287 -0
- package/lib/services/model_serving.js.map +1 -0
- package/lib/services/mongodb_flex.d.ts +826 -0
- package/lib/services/mongodb_flex.d.ts.map +1 -0
- package/lib/services/mongodb_flex.js +803 -0
- package/lib/services/mongodb_flex.js.map +1 -0
- package/lib/services/object_storage.d.ts +470 -0
- package/lib/services/object_storage.d.ts.map +1 -0
- package/lib/services/object_storage.js +540 -0
- package/lib/services/object_storage.js.map +1 -0
- package/lib/services/observability.d.ts +2750 -0
- package/lib/services/observability.d.ts.map +1 -0
- package/lib/services/observability.js +3158 -0
- package/lib/services/observability.js.map +1 -0
- package/lib/services/opensearch.d.ts +505 -0
- package/lib/services/opensearch.d.ts.map +1 -0
- package/lib/services/opensearch.js +563 -0
- package/lib/services/opensearch.js.map +1 -0
- package/lib/services/pim.d.ts +997 -0
- package/lib/services/pim.d.ts.map +1 -0
- package/lib/services/pim.js +736 -0
- package/lib/services/pim.js.map +1 -0
- package/lib/services/postgres_flex.d.ts +854 -0
- package/lib/services/postgres_flex.d.ts.map +1 -0
- package/lib/services/postgres_flex.js +853 -0
- package/lib/services/postgres_flex.js.map +1 -0
- package/lib/services/pubsub.d.ts +489 -0
- package/lib/services/pubsub.d.ts.map +1 -0
- package/lib/services/pubsub.js +519 -0
- package/lib/services/pubsub.js.map +1 -0
- package/lib/services/rabbitmq.d.ts +523 -0
- package/lib/services/rabbitmq.d.ts.map +1 -0
- package/lib/services/rabbitmq.js +574 -0
- package/lib/services/rabbitmq.js.map +1 -0
- package/lib/services/registry.d.ts +212 -0
- package/lib/services/registry.d.ts.map +1 -0
- package/lib/services/registry.js +198 -0
- package/lib/services/registry.js.map +1 -0
- package/lib/services/resource_manager.d.ts +458 -0
- package/lib/services/resource_manager.d.ts.map +1 -0
- package/lib/services/resource_manager.js +473 -0
- package/lib/services/resource_manager.js.map +1 -0
- package/lib/services/run_command.d.ts +175 -0
- package/lib/services/run_command.d.ts.map +1 -0
- package/lib/services/run_command.js +185 -0
- package/lib/services/run_command.js.map +1 -0
- package/lib/services/sca.d.ts +553 -0
- package/lib/services/sca.d.ts.map +1 -0
- package/lib/services/sca.js +445 -0
- package/lib/services/sca.js.map +1 -0
- package/lib/services/scf.d.ts +498 -0
- package/lib/services/scf.d.ts.map +1 -0
- package/lib/services/scf.js +670 -0
- package/lib/services/scf.js.map +1 -0
- package/lib/services/secrets_manager.d.ts +505 -0
- package/lib/services/secrets_manager.d.ts.map +1 -0
- package/lib/services/secrets_manager.js +613 -0
- package/lib/services/secrets_manager.js.map +1 -0
- package/lib/services/server_backup.d.ts +380 -0
- package/lib/services/server_backup.d.ts.map +1 -0
- package/lib/services/server_backup.js +454 -0
- package/lib/services/server_backup.js.map +1 -0
- package/lib/services/server_update.d.ts +292 -0
- package/lib/services/server_update.d.ts.map +1 -0
- package/lib/services/server_update.js +352 -0
- package/lib/services/server_update.js.map +1 -0
- package/lib/services/service_account.d.ts +465 -0
- package/lib/services/service_account.d.ts.map +1 -0
- package/lib/services/service_account.js +506 -0
- package/lib/services/service_account.js.map +1 -0
- package/lib/services/service_enablement.d.ts +149 -0
- package/lib/services/service_enablement.d.ts.map +1 -0
- package/lib/services/service_enablement.js +157 -0
- package/lib/services/service_enablement.js.map +1 -0
- package/lib/services/sfs.d.ts +721 -0
- package/lib/services/sfs.d.ts.map +1 -0
- package/lib/services/sfs.js +790 -0
- package/lib/services/sfs.js.map +1 -0
- package/lib/services/ske.d.ts +562 -0
- package/lib/services/ske.d.ts.map +1 -0
- package/lib/services/ske.js +558 -0
- package/lib/services/ske.js.map +1 -0
- package/lib/services/sqlserverflex.d.ts +956 -0
- package/lib/services/sqlserverflex.d.ts.map +1 -0
- package/lib/services/sqlserverflex.js +936 -0
- package/lib/services/sqlserverflex.js.map +1 -0
- package/lib/services/stackit_marketplace.d.ts +288 -0
- package/lib/services/stackit_marketplace.d.ts.map +1 -0
- package/lib/services/stackit_marketplace.js +379 -0
- package/lib/services/stackit_marketplace.js.map +1 -0
- package/lib/services/telemetry_link.d.ts +443 -0
- package/lib/services/telemetry_link.d.ts.map +1 -0
- package/lib/services/telemetry_link.js +532 -0
- package/lib/services/telemetry_link.js.map +1 -0
- package/lib/services/telemetry_router.d.ts +493 -0
- package/lib/services/telemetry_router.d.ts.map +1 -0
- package/lib/services/telemetry_router.js +484 -0
- package/lib/services/telemetry_router.js.map +1 -0
- package/lib/services/ufw.d.ts +295 -0
- package/lib/services/ufw.d.ts.map +1 -0
- package/lib/services/ufw.js +279 -0
- package/lib/services/ufw.js.map +1 -0
- package/lib/services/valkey.d.ts +505 -0
- package/lib/services/valkey.d.ts.map +1 -0
- package/lib/services/valkey.js +567 -0
- package/lib/services/valkey.js.map +1 -0
- package/lib/services/vpn.d.ts +1024 -0
- package/lib/services/vpn.d.ts.map +1 -0
- package/lib/services/vpn.js +931 -0
- package/lib/services/vpn.js.map +1 -0
- package/lib/services/workflows.d.ts +600 -0
- package/lib/services/workflows.d.ts.map +1 -0
- package/lib/services/workflows.js +508 -0
- package/lib/services/workflows.js.map +1 -0
- package/lib/traits.d.ts +24 -0
- package/lib/traits.d.ts.map +1 -0
- package/lib/traits.js +15 -0
- package/lib/traits.js.map +1 -0
- package/package.json +85 -3
- package/src/credentials.ts +84 -0
- package/src/errors.ts +50 -0
- package/src/index.ts +34 -0
- package/src/pagination.ts +57 -0
- package/src/protocol.test.ts +304 -0
- package/src/protocol.ts +225 -0
- package/src/retry.ts +47 -0
- package/src/services/alb.ts +1326 -0
- package/src/services/alb_waf.ts +1288 -0
- package/src/services/authorization.ts +704 -0
- package/src/services/automation.ts +796 -0
- package/src/services/cdn.ts +2576 -0
- package/src/services/certificates.ts +418 -0
- package/src/services/cost.ts +449 -0
- package/src/services/dns.ts +1936 -0
- package/src/services/dremio.ts +753 -0
- package/src/services/edge.ts +780 -0
- package/src/services/functions.ts +957 -0
- package/src/services/git.ts +1194 -0
- package/src/services/iaas.ts +7878 -0
- package/src/services/index.ts +51 -0
- package/src/services/intake.ts +1166 -0
- package/src/services/kms.ts +1537 -0
- package/src/services/lb_ip_lists.ts +342 -0
- package/src/services/load_balancer.ts +1266 -0
- package/src/services/logme.ts +1284 -0
- package/src/services/logs.ts +1049 -0
- package/src/services/mariadb.ts +1212 -0
- package/src/services/model_experiments.ts +741 -0
- package/src/services/model_serving.ts +654 -0
- package/src/services/mongodb_flex.ts +1932 -0
- package/src/services/object_storage.ts +1195 -0
- package/src/services/observability.ts +7364 -0
- package/src/services/opensearch.ts +1265 -0
- package/src/services/pim.ts +1985 -0
- package/src/services/postgres_flex.ts +2080 -0
- package/src/services/pubsub.ts +1193 -0
- package/src/services/rabbitmq.ts +1310 -0
- package/src/services/registry.ts +446 -0
- package/src/services/resource_manager.ts +1072 -0
- package/src/services/run_command.ts +413 -0
- package/src/services/sca.ts +1187 -0
- package/src/services/scf.ts +1396 -0
- package/src/services/secrets_manager.ts +1317 -0
- package/src/services/server_backup.ts +983 -0
- package/src/services/server_update.ts +738 -0
- package/src/services/service_account.ts +1121 -0
- package/src/services/service_enablement.ts +330 -0
- package/src/services/sfs.ts +1831 -0
- package/src/services/ske.ts +1386 -0
- package/src/services/sqlserverflex.ts +2307 -0
- package/src/services/stackit_marketplace.ts +787 -0
- package/src/services/telemetry_link.ts +1166 -0
- package/src/services/telemetry_router.ts +1110 -0
- package/src/services/ufw.ts +654 -0
- package/src/services/valkey.ts +1266 -0
- package/src/services/vpn.ts +2365 -0
- package/src/services/workflows.ts +1249 -0
- package/src/traits.ts +60 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @distilled.cloud/stackit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Effect-native SDK for [stackit](https://www.npmjs.com/package/@distilled.cloud/stackit).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @distilled.cloud/stackit effect
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick start
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { Effect, Layer } from "effect";
|
|
15
|
+
import * as FetchHttpClient from "effect/http/FetchHttpClient";
|
|
16
|
+
import * as Stackit from "@distilled.cloud/stackit";
|
|
17
|
+
|
|
18
|
+
const program = Effect.gen(function* () {
|
|
19
|
+
const result = yield* Stackit.dns.listZones({});
|
|
20
|
+
return result;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const Live = Layer.mergeAll(
|
|
24
|
+
FetchHttpClient.layer,
|
|
25
|
+
Stackit.CredentialsFromEnv,
|
|
26
|
+
Stackit.StackitProtocol,
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
program.pipe(Effect.provide(Live), Effect.runPromise);
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Auth
|
|
33
|
+
|
|
34
|
+
Required: `STACKIT_REGION`, `STACKIT_SERVICE_ACCOUNT_KEY_PATH`, `STACKIT_SERVICE_ACCOUNT_TOKEN`. Optional: `STACKIT_API_BASE_URL`. Sent as `Authorization: Bearer`.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
4
|
+
import * as Redacted from "effect/Redacted";
|
|
5
|
+
/** STACKIT's primary public region (Schwarz IT / Germany). */
|
|
6
|
+
export declare const DEFAULT_REGION = "eu01";
|
|
7
|
+
export interface Config {
|
|
8
|
+
readonly token: Redacted.Redacted<string>;
|
|
9
|
+
/**
|
|
10
|
+
* Region inserted into product hosts (`eu01` →
|
|
11
|
+
* `https://iaas.api.eu01.stackit.cloud`). `"global"` leaves the spec URL
|
|
12
|
+
* unchanged.
|
|
13
|
+
*/
|
|
14
|
+
readonly region: string;
|
|
15
|
+
/** When set, every operation uses this host instead of the spec's. */
|
|
16
|
+
readonly apiBaseUrl?: string;
|
|
17
|
+
}
|
|
18
|
+
declare const Credentials_base: Context.ServiceClass<Credentials, "StackitCredentials", Effect.Effect<Config, never, never>>;
|
|
19
|
+
export declare class Credentials extends Credentials_base {
|
|
20
|
+
}
|
|
21
|
+
export declare const CredentialsFromEnv: Layer.Layer<Credentials, never, never>;
|
|
22
|
+
/** Convenience layer from a redacted token + optional region / base URL. */
|
|
23
|
+
export declare const credentials: (config: {
|
|
24
|
+
readonly token: Redacted.Redacted<string>;
|
|
25
|
+
readonly region?: string;
|
|
26
|
+
readonly apiBaseUrl?: string;
|
|
27
|
+
}) => Layer.Layer<Credentials>;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C,8DAA8D;AAC9D,eAAO,MAAM,cAAc,SAAS,CAAC;AAErC,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,sEAAsE;IACtE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;;AAED,qBAAa,WAAY,SAAQ,gBAEhC;CAAG;AAUJ,eAAO,MAAM,kBAAkB,wCAgB9B,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,WAAW,WAAY;IAClC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B,KAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAQxB,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
2
|
+
/**
|
|
3
|
+
* STACKIT credentials — hand-written.
|
|
4
|
+
*
|
|
5
|
+
* The `Credentials` service resolves `{ token, region }` per request; the
|
|
6
|
+
* protocol layer formats the `Authorization: Bearer <token>` header from it
|
|
7
|
+
* and rewrites each operation's spec `servers` URL for the region. The token
|
|
8
|
+
* is a STACKIT service-account access token — the same value the official
|
|
9
|
+
* Go SDK, CLI and Terraform provider read from
|
|
10
|
+
* `STACKIT_SERVICE_ACCOUNT_TOKEN`. Key-file exchange
|
|
11
|
+
* (`STACKIT_SERVICE_ACCOUNT_KEY_PATH`) is not modelled: mint the token
|
|
12
|
+
* outside the SDK.
|
|
13
|
+
*
|
|
14
|
+
* Each STACKIT product has its own host (`iaas.api.eu01.stackit.cloud`,
|
|
15
|
+
* `ske.api.eu01.stackit.cloud`, …). The per-operation host is baked into
|
|
16
|
+
* the generated `T.Http` trait from the OpenAPI `servers` entry; `region`
|
|
17
|
+
* (default `eu01`) is substituted at request time. An explicit `apiBaseUrl`
|
|
18
|
+
* overrides that host for every call — a proxy, not a per-product map.
|
|
19
|
+
*/
|
|
20
|
+
import * as EffectConfig from "effect/Config";
|
|
21
|
+
import * as Context from "effect/Context";
|
|
22
|
+
import * as Effect from "effect/Effect";
|
|
23
|
+
import * as Layer from "effect/Layer";
|
|
24
|
+
import * as Redacted from "effect/Redacted";
|
|
25
|
+
/** STACKIT's primary public region (Schwarz IT / Germany). */
|
|
26
|
+
export const DEFAULT_REGION = "eu01";
|
|
27
|
+
export class Credentials extends Context.Service()("StackitCredentials") {
|
|
28
|
+
}
|
|
29
|
+
const envConfig = EffectConfig.all({
|
|
30
|
+
// `STACKIT_SERVICE_ACCOUNT_TOKEN` / `STACKIT_REGION` are what the
|
|
31
|
+
// official Go SDK, CLI and Terraform provider read.
|
|
32
|
+
token: EffectConfig.String("STACKIT_SERVICE_ACCOUNT_TOKEN"),
|
|
33
|
+
region: EffectConfig.String("STACKIT_REGION").pipe(EffectConfig.withDefault(DEFAULT_REGION)),
|
|
34
|
+
apiBaseUrl: EffectConfig.String("STACKIT_API_BASE_URL").pipe(EffectConfig.option),
|
|
35
|
+
});
|
|
36
|
+
export const CredentialsFromEnv = Layer.succeed(Credentials, envConfig.pipe(Effect.mapError(() => new ConfigError({
|
|
37
|
+
message: "STACKIT_SERVICE_ACCOUNT_TOKEN environment variable is required",
|
|
38
|
+
})), Effect.map(({ token, region, apiBaseUrl }) => ({
|
|
39
|
+
token: Redacted.make(token),
|
|
40
|
+
region,
|
|
41
|
+
apiBaseUrl: apiBaseUrl._tag === "Some" ? apiBaseUrl.value : undefined,
|
|
42
|
+
})), Effect.orDie));
|
|
43
|
+
/** Convenience layer from a redacted token + optional region / base URL. */
|
|
44
|
+
export const credentials = (config) => Layer.succeed(Credentials, Effect.succeed({
|
|
45
|
+
token: config.token,
|
|
46
|
+
region: config.region ?? DEFAULT_REGION,
|
|
47
|
+
apiBaseUrl: config.apiBaseUrl,
|
|
48
|
+
}));
|
|
49
|
+
//# sourceMappingURL=credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,YAAY,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C,8DAA8D;AAC9D,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC;AAcrC,MAAM,OAAO,WAAY,SAAQ,OAAO,CAAC,OAAO,EAAsC,CACpF,oBAAoB,CACrB;CAAG;AAEJ,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC;IACjC,kEAAkE;IAClE,oDAAoD;IACpD,KAAK,EAAE,YAAY,CAAC,MAAM,CAAC,+BAA+B,CAAC;IAC3D,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAC5F,UAAU,EAAE,YAAY,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;CAClF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,CAC7C,WAAW,EACX,SAAS,CAAC,IAAI,CACZ,MAAM,CAAC,QAAQ,CACb,GAAG,EAAE,CACH,IAAI,WAAW,CAAC;IACd,OAAO,EAAE,gEAAgE;CAC1E,CAAC,CACL,EACD,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7C,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;IAC3B,MAAM;IACN,UAAU,EAAE,UAAU,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;CACtE,CAAC,CAAC,EACH,MAAM,CAAC,KAAK,CACb,CACF,CAAC;AAEF,4EAA4E;AAC5E,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAI3B,EAA4B,EAAE,CAC7B,KAAK,CAAC,OAAO,CACX,WAAW,EACX,MAAM,CAAC,OAAO,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,KAAK;IACnB,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,cAAc;IACvC,UAAU,EAAE,MAAM,CAAC,UAAU;CAC9B,CAAC,CACH,CAAC"}
|
package/lib/errors.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STACKIT-specific error types.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the common HTTP errors from core and adds the unknown-error
|
|
5
|
+
* and parse-error wrappers. STACKIT failures carry `{ message, error? }`
|
|
6
|
+
* (the `ErrorMessage` schema in most of the product specs); the protocol
|
|
7
|
+
* reads `message` for the human half and `error` as the machine-readable
|
|
8
|
+
* code on {@link UnknownStackitError}.
|
|
9
|
+
*/
|
|
10
|
+
export { BadGateway, BadRequest, Conflict, ConfigError, Forbidden, GatewayTimeout, InternalServerError, Locked, NotFound, ServiceUnavailable, TooManyRequests, Unauthorized, UnprocessableEntity, HTTP_STATUS_MAP, DEFAULT_ERRORS, API_ERRORS, } from "@distilled.cloud/core/errors";
|
|
11
|
+
export type { DefaultErrors } from "@distilled.cloud/core/errors";
|
|
12
|
+
import * as Schema from "effect/Schema";
|
|
13
|
+
declare const UnknownStackitError_base: Schema.Class<UnknownStackitError, Schema.TaggedStruct<"UnknownStackitError", {
|
|
14
|
+
readonly code: Schema.optional<Schema.String>;
|
|
15
|
+
readonly message: Schema.optional<Schema.String>;
|
|
16
|
+
readonly body: Schema.Unknown;
|
|
17
|
+
}>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
|
|
18
|
+
"@distilled.cloud/error/categories": {
|
|
19
|
+
ServerError: true;
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
/** Unknown STACKIT error — returned when nothing else matches the failure. */
|
|
23
|
+
export declare class UnknownStackitError extends UnknownStackitError_base {
|
|
24
|
+
}
|
|
25
|
+
declare const StackitParseError_base: Schema.Class<StackitParseError, Schema.TaggedStruct<"StackitParseError", {
|
|
26
|
+
readonly body: Schema.Unknown;
|
|
27
|
+
readonly cause: Schema.Unknown;
|
|
28
|
+
}>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
|
|
29
|
+
"@distilled.cloud/error/categories": {
|
|
30
|
+
ParseError: true;
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
/** Schema parse error wrapper. */
|
|
34
|
+
export declare class StackitParseError extends StackitParseError_base {
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAGlE,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;;;;;;;;;;AAExC,8EAA8E;AAC9E,qBAAa,mBAAoB,SAAQ,wBAOT;CAAG;;;;;;;;;AAEnC,kCAAkC;AAClC,qBAAa,iBAAkB,SAAQ,sBAMR;CAAG"}
|
package/lib/errors.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STACKIT-specific error types.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the common HTTP errors from core and adds the unknown-error
|
|
5
|
+
* and parse-error wrappers. STACKIT failures carry `{ message, error? }`
|
|
6
|
+
* (the `ErrorMessage` schema in most of the product specs); the protocol
|
|
7
|
+
* reads `message` for the human half and `error` as the machine-readable
|
|
8
|
+
* code on {@link UnknownStackitError}.
|
|
9
|
+
*/
|
|
10
|
+
export { BadGateway, BadRequest, Conflict, ConfigError, Forbidden, GatewayTimeout, InternalServerError, Locked, NotFound, ServiceUnavailable, TooManyRequests, Unauthorized, UnprocessableEntity, HTTP_STATUS_MAP, DEFAULT_ERRORS, API_ERRORS, } from "@distilled.cloud/core/errors";
|
|
11
|
+
import * as Category from "@distilled.cloud/core/category";
|
|
12
|
+
import * as Schema from "effect/Schema";
|
|
13
|
+
/** Unknown STACKIT error — returned when nothing else matches the failure. */
|
|
14
|
+
export class UnknownStackitError extends Schema.TaggedError()("UnknownStackitError", {
|
|
15
|
+
code: Schema.optional(Schema.String),
|
|
16
|
+
message: Schema.optional(Schema.String),
|
|
17
|
+
body: Schema.Unknown,
|
|
18
|
+
}).pipe(Category.withServerError) {
|
|
19
|
+
}
|
|
20
|
+
/** Schema parse error wrapper. */
|
|
21
|
+
export class StackitParseError extends Schema.TaggedError()("StackitParseError", {
|
|
22
|
+
body: Schema.Unknown,
|
|
23
|
+
cause: Schema.Unknown,
|
|
24
|
+
}).pipe(Category.withParseError) {
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AAGtC,OAAO,KAAK,QAAQ,MAAM,gCAAgC,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,8EAA8E;AAC9E,MAAM,OAAO,mBAAoB,SAAQ,MAAM,CAAC,WAAW,EAAuB,CAChF,qBAAqB,EACrB;IACE,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC,OAAO;CACrB,CACF,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC;CAAG;AAEnC,kCAAkC;AAClC,MAAM,OAAO,iBAAkB,SAAQ,MAAM,CAAC,WAAW,EAAqB,CAC5E,mBAAmB,EACnB;IACE,IAAI,EAAE,MAAM,CAAC,OAAO;IACpB,KAAK,EAAE,MAAM,CAAC,OAAO;CACtB,CACF,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC;CAAG"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @distilled.cloud/stackit — STACKIT Cloud API SDK for Effect.
|
|
3
|
+
*
|
|
4
|
+
* `./services` is generated by `scripts/generate.ts` from the Smithy models
|
|
5
|
+
* in `.generated-specs` (written by `scripts/convert.ts` from the OpenAPI
|
|
6
|
+
* documents mirrored at `specs/spec-mirror-stackit/specs/`). Everything else
|
|
7
|
+
* in this folder is hand-written.
|
|
8
|
+
*
|
|
9
|
+
* One module per STACKIT product (IaaS, SKE, DNS, Postgres Flex, …), using
|
|
10
|
+
* that product's latest published OpenAPI version. Auth is a service-account
|
|
11
|
+
* bearer token (`STACKIT_SERVICE_ACCOUNT_TOKEN`); each product's host is
|
|
12
|
+
* rewritten for `STACKIT_REGION` (default `eu01`).
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* import * as Stackit from "@distilled.cloud/stackit";
|
|
17
|
+
*
|
|
18
|
+
* const { zones } = yield* Stackit.dns.listZones({
|
|
19
|
+
* projectId: "...",
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export * from "./credentials.ts";
|
|
24
|
+
export * from "./errors.ts";
|
|
25
|
+
export * as T from "./traits.ts";
|
|
26
|
+
export { StackitProtocol, applyRegion, type StackitOpError, type StackitOpContext, } from "./protocol.ts";
|
|
27
|
+
export { paginateByTotalPages } from "./pagination.ts";
|
|
28
|
+
export * as Retry from "./retry.ts";
|
|
29
|
+
export * from "./services/index.ts";
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,eAAe,EACf,WAAW,EACX,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @distilled.cloud/stackit — STACKIT Cloud API SDK for Effect.
|
|
3
|
+
*
|
|
4
|
+
* `./services` is generated by `scripts/generate.ts` from the Smithy models
|
|
5
|
+
* in `.generated-specs` (written by `scripts/convert.ts` from the OpenAPI
|
|
6
|
+
* documents mirrored at `specs/spec-mirror-stackit/specs/`). Everything else
|
|
7
|
+
* in this folder is hand-written.
|
|
8
|
+
*
|
|
9
|
+
* One module per STACKIT product (IaaS, SKE, DNS, Postgres Flex, …), using
|
|
10
|
+
* that product's latest published OpenAPI version. Auth is a service-account
|
|
11
|
+
* bearer token (`STACKIT_SERVICE_ACCOUNT_TOKEN`); each product's host is
|
|
12
|
+
* rewritten for `STACKIT_REGION` (default `eu01`).
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* import * as Stackit from "@distilled.cloud/stackit";
|
|
17
|
+
*
|
|
18
|
+
* const { zones } = yield* Stackit.dns.listZones({
|
|
19
|
+
* projectId: "...",
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export * from "./credentials.js";
|
|
24
|
+
export * from "./errors.js";
|
|
25
|
+
export * as T from "./traits.js";
|
|
26
|
+
export { StackitProtocol, applyRegion, } from "./protocol.js";
|
|
27
|
+
export { paginateByTotalPages } from "./pagination.js";
|
|
28
|
+
export * as Retry from "./retry.js";
|
|
29
|
+
export * from "./services/index.js";
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,eAAe,EACf,WAAW,GAGZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type PaginationStrategy } from "@distilled.cloud/core/pagination";
|
|
2
|
+
export type { PaginatedTrait, PaginationStrategy } from "@distilled.cloud/core/pagination";
|
|
3
|
+
/**
|
|
4
|
+
* Stream of pages using STACKIT's `page` / `totalPages` envelope: request
|
|
5
|
+
* `page`, `page+1`, … while `page < totalPages` and the collection is
|
|
6
|
+
* non-empty.
|
|
7
|
+
*/
|
|
8
|
+
export declare const paginateByTotalPages: PaginationStrategy;
|
|
9
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../src/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAcpF,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAE3F;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,kBAmClC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { getPath } from "@distilled.cloud/core/pagination";
|
|
2
|
+
/**
|
|
3
|
+
* STACKIT pagination — hand-written.
|
|
4
|
+
*
|
|
5
|
+
* Several STACKIT list operations page by NUMBER: `?page=N&pageSize=M` in,
|
|
6
|
+
* and a response carrying the collection beside `totalPages` (DNS zones /
|
|
7
|
+
* record sets, and the same envelope on other products). Core's
|
|
8
|
+
* `paginatePageNumber` treats `outputToken` as the NEXT page number, so
|
|
9
|
+
* pointing it at `totalPages` would jump to the last page; this strategy
|
|
10
|
+
* advances by one until `page >= totalPages`.
|
|
11
|
+
*/
|
|
12
|
+
import * as Effect from "effect/Effect";
|
|
13
|
+
import * as Stream from "effect/Stream";
|
|
14
|
+
/**
|
|
15
|
+
* Stream of pages using STACKIT's `page` / `totalPages` envelope: request
|
|
16
|
+
* `page`, `page+1`, … while `page < totalPages` and the collection is
|
|
17
|
+
* non-empty.
|
|
18
|
+
*/
|
|
19
|
+
export const paginateByTotalPages = (operation, input, pagination) => {
|
|
20
|
+
const inputToken = pagination.inputToken;
|
|
21
|
+
const totalPagesPath = pagination.outputToken;
|
|
22
|
+
const itemsPath = pagination.items;
|
|
23
|
+
if (!inputToken || !totalPagesPath) {
|
|
24
|
+
return Stream.die(new Error("Total-pages pagination requires inputToken and outputToken (totalPages)"));
|
|
25
|
+
}
|
|
26
|
+
const startPage = typeof input[inputToken] === "number" ? input[inputToken] : 1;
|
|
27
|
+
return Stream.unfold({ page: startPage, done: false }, (state) => Effect.gen(function* () {
|
|
28
|
+
if (state.done)
|
|
29
|
+
return undefined;
|
|
30
|
+
const requestPayload = {
|
|
31
|
+
...input,
|
|
32
|
+
[inputToken]: state.page,
|
|
33
|
+
};
|
|
34
|
+
const response = yield* operation(requestPayload);
|
|
35
|
+
const totalPages = getPath(response, totalPagesPath);
|
|
36
|
+
const items = itemsPath
|
|
37
|
+
? getPath(response, itemsPath)
|
|
38
|
+
: undefined;
|
|
39
|
+
const exhausted = typeof totalPages !== "number" ||
|
|
40
|
+
state.page >= totalPages ||
|
|
41
|
+
(items !== undefined && items.length === 0);
|
|
42
|
+
return [response, { page: state.page + 1, done: exhausted }];
|
|
43
|
+
}));
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../src/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAA2B,MAAM,kCAAkC,CAAC;AACpF;;;;;;;;;GASG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAuB,CAAC,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE;IACvF,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;IACzC,MAAM,cAAc,GAAG,UAAU,CAAC,WAAW,CAAC;IAC9C,MAAM,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC;IACnC,IAAI,CAAC,UAAU,IAAI,CAAC,cAAc,EAAE,CAAC;QACnC,OAAO,MAAM,CAAC,GAAG,CACf,IAAI,KAAK,CAAC,yEAAyE,CAAC,CACrF,CAAC;IACJ,CAAC;IAGD,MAAM,SAAS,GAAG,OAAO,KAAK,CAAC,UAAU,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAE,KAAK,CAAC,UAAU,CAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAE5F,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAW,EAAE,CAAC,KAAK,EAAE,EAAE,CACxE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QAClB,IAAI,KAAK,CAAC,IAAI;YAAE,OAAO,SAAS,CAAC;QAEjC,MAAM,cAAc,GAAG;YACrB,GAAG,KAAK;YACR,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC,IAAI;SACT,CAAC;QAClB,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QAElD,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;QACrD,MAAM,KAAK,GAAG,SAAS;YACrB,CAAC,CAAE,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAoC;YAClE,CAAC,CAAC,SAAS,CAAC;QACd,MAAM,SAAS,GACb,OAAO,UAAU,KAAK,QAAQ;YAC9B,KAAK,CAAC,IAAI,IAAI,UAAU;YACxB,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;QAE9C,OAAO,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,GAAG,CAAC,EAAE,IAAI,EAAE,SAAS,EAAkB,CAAU,CAAC;IACxF,CAAC,CAAC,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as API from "@distilled.cloud/core/api";
|
|
2
|
+
import { type ConfigError } from "@distilled.cloud/core/errors";
|
|
3
|
+
import type * as HttpClient from "effect/http/HttpClient";
|
|
4
|
+
import type * as HttpClientError from "effect/http/HttpClientError";
|
|
5
|
+
import * as Layer from "effect/Layer";
|
|
6
|
+
import { Credentials } from "./credentials.ts";
|
|
7
|
+
import { StackitParseError, UnknownStackitError } from "./errors.ts";
|
|
8
|
+
import type { DefaultErrors } from "./errors.ts";
|
|
9
|
+
/**
|
|
10
|
+
* Error channel shared by every generated STACKIT operation. Generated
|
|
11
|
+
* service files annotate operations with `API.OperationMethod<I, O,
|
|
12
|
+
* StackitOpError, StackitOpContext>` explicitly so the compiler never infers
|
|
13
|
+
* these back out of the schema generics.
|
|
14
|
+
*/
|
|
15
|
+
export type StackitOpError = DefaultErrors | UnknownStackitError | StackitParseError | ConfigError | HttpClientError.HttpClientError;
|
|
16
|
+
/** Context (requirements) shared by every generated STACKIT operation. */
|
|
17
|
+
export type StackitOpContext = Credentials | HttpClient.HttpClient;
|
|
18
|
+
/**
|
|
19
|
+
* Rewrite a spec `servers` URL for the configured region.
|
|
20
|
+
*
|
|
21
|
+
* • `{region}` still in the template (IaaS v1:
|
|
22
|
+
* `https://iaas.api.{region}stackit.cloud`, default `eu01.`) is
|
|
23
|
+
* substituted. A glued `{region}stackit` means the spec's default
|
|
24
|
+
* includes the trailing dot.
|
|
25
|
+
* • `https://<svc>.api.stackit.cloud` becomes
|
|
26
|
+
* `https://<svc>.api.<region>.stackit.cloud`.
|
|
27
|
+
* • `region === "global"` leaves the URL alone (after dropping any
|
|
28
|
+
* leftover `{region}`).
|
|
29
|
+
*/
|
|
30
|
+
export declare const applyRegion: (specUrl: string, region: string) => string;
|
|
31
|
+
export declare const StackitProtocol: Layer.Layer<API.Protocol>;
|
|
32
|
+
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,8BAA8B,CAAC;AA8BtC,OAAO,KAAK,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,KAAK,eAAe,MAAM,6BAA6B,CAAC;AAGpE,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAE,WAAW,EAAe,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GACtB,aAAa,GACb,mBAAmB,GACnB,iBAAiB,GACjB,WAAW,GACX,eAAe,CAAC,eAAe,CAAC;AAEpC,0EAA0E;AAC1E,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AAEnE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,YAAa,MAAM,UAAU,MAAM,KAAG,MAY7D,CAAC;AA8BF,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CA2GrD,CAAC"}
|