@aionixone/client-paramstore 0.0.0-stage → 0.3.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +11 -0
- package/dist/generated/catalog.d.ts +133 -0
- package/dist/generated/catalog.d.ts.map +1 -0
- package/dist/generated/catalog.js +133 -0
- package/dist/generated/catalog.js.map +1 -0
- package/dist/generated/index.d.ts +6 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/index.js +7 -0
- package/dist/generated/index.js.map +1 -0
- package/dist/generated/schema_types.d.ts +9 -0
- package/dist/generated/schema_types.d.ts.map +1 -0
- package/dist/generated/schema_types.js +3 -0
- package/dist/generated/schema_types.js.map +1 -0
- package/dist/generated/service.d.ts +147 -0
- package/dist/generated/service.d.ts.map +1 -0
- package/dist/generated/service.js +188 -0
- package/dist/generated/service.js.map +1 -0
- package/dist/generated/trn.d.ts +26 -0
- package/dist/generated/trn.d.ts.map +1 -0
- package/dist/generated/trn.js +179 -0
- package/dist/generated/trn.js.map +1 -0
- package/dist/generated/types.d.ts +74 -0
- package/dist/generated/types.d.ts.map +1 -0
- package/dist/generated/types.js +3 -0
- package/dist/generated/types.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +30 -4
- package/src/generated/catalog.ts +136 -0
- package/src/generated/index.ts +7 -0
- package/src/generated/schema_types.ts +10 -0
- package/src/generated/service.ts +202 -0
- package/src/generated/trn.ts +241 -0
- package/src/generated/types.ts +85 -0
- package/src/index.ts +1 -0
- package/README.md +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/generated/types.ts"],"names":[],"mappings":"AAAA,oDAAoD"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aionixone/client-paramstore",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.3.0-beta.3",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"src",
|
|
17
|
+
"LICENSE",
|
|
18
|
+
"NOTICE",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsc -p tsconfig.json",
|
|
23
|
+
"clean": "rm -rf dist"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"typescript": "6.0.3"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@aionixone/client-core": "0.3.0-beta.3",
|
|
30
|
+
"@aionixone/client-types": "0.3.0-beta.3"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// @generated by xtask ts-client-export; DO NOT EDIT
|
|
2
|
+
|
|
3
|
+
import type { SdkOperation } from '@aionixone/client-core';
|
|
4
|
+
|
|
5
|
+
export const OPERATIONS = {
|
|
6
|
+
paramstore_param_evaluate: {
|
|
7
|
+
operationId: "paramstore.param.evaluate",
|
|
8
|
+
domain: "paramstore",
|
|
9
|
+
sdkMethod: ["paramstore", "param", "evaluate"],
|
|
10
|
+
method: "GET",
|
|
11
|
+
pathTemplate: "/parameters/{trn}/evaluate",
|
|
12
|
+
requestBodyEncoding: "none",
|
|
13
|
+
responseBodyEncoding: "standard_envelope",
|
|
14
|
+
successStatus: 200,
|
|
15
|
+
safeReplay: true,
|
|
16
|
+
rejections: [],
|
|
17
|
+
idempotencyKey: "none",
|
|
18
|
+
replayWindowSeconds: null,
|
|
19
|
+
admitsExecutionName: false,
|
|
20
|
+
errorCodes: ["Internal_Unauthorized", "Internal_PermissionDenied", "Internal_ValidationFailed", "Internal_ServiceUnavailable", "Internal_SystemError", "Internal_DatabaseError", "Internal_DatabaseConnectionError", "Internal_InvalidState", "ParamStore_InvalidPath", "ParamStore_ParameterNotFound", "ParamStore_VersionNotFound", "ParamStore_ExpressionError", "ParamStore_TypeMismatch", "Internal_Timeout"],
|
|
21
|
+
},
|
|
22
|
+
paramstore_param_list: {
|
|
23
|
+
operationId: "paramstore.param.list",
|
|
24
|
+
domain: "paramstore",
|
|
25
|
+
sdkMethod: ["paramstore", "param", "list"],
|
|
26
|
+
method: "GET",
|
|
27
|
+
pathTemplate: "/parameters",
|
|
28
|
+
requestBodyEncoding: "none",
|
|
29
|
+
responseBodyEncoding: "standard_envelope",
|
|
30
|
+
successStatus: 200,
|
|
31
|
+
safeReplay: true,
|
|
32
|
+
rejections: [],
|
|
33
|
+
idempotencyKey: "none",
|
|
34
|
+
replayWindowSeconds: null,
|
|
35
|
+
admitsExecutionName: false,
|
|
36
|
+
errorCodes: ["Internal_Unauthorized", "Internal_PermissionDenied", "Internal_ValidationFailed", "Internal_ServiceUnavailable", "Internal_SystemError", "Internal_DatabaseError", "Internal_DatabaseConnectionError", "Internal_InvalidState"],
|
|
37
|
+
},
|
|
38
|
+
paramstore_param_read: {
|
|
39
|
+
operationId: "paramstore.param.read",
|
|
40
|
+
domain: "paramstore",
|
|
41
|
+
sdkMethod: ["paramstore", "param", "read"],
|
|
42
|
+
method: "GET",
|
|
43
|
+
pathTemplate: "/parameters/{trn}",
|
|
44
|
+
requestBodyEncoding: "none",
|
|
45
|
+
responseBodyEncoding: "standard_envelope",
|
|
46
|
+
successStatus: 200,
|
|
47
|
+
safeReplay: true,
|
|
48
|
+
rejections: [],
|
|
49
|
+
idempotencyKey: "none",
|
|
50
|
+
replayWindowSeconds: null,
|
|
51
|
+
admitsExecutionName: false,
|
|
52
|
+
errorCodes: ["Internal_Unauthorized", "Internal_PermissionDenied", "Internal_ValidationFailed", "Internal_ServiceUnavailable", "Internal_SystemError", "Internal_DatabaseError", "Internal_DatabaseConnectionError", "Internal_InvalidState", "ParamStore_InvalidPath", "ParamStore_ParameterNotFound"],
|
|
53
|
+
},
|
|
54
|
+
paramstore_param_value_read: {
|
|
55
|
+
operationId: "paramstore.param.value_read",
|
|
56
|
+
domain: "paramstore",
|
|
57
|
+
sdkMethod: ["paramstore", "param", "valueRead"],
|
|
58
|
+
method: "GET",
|
|
59
|
+
pathTemplate: "/parameters/{trn}/value",
|
|
60
|
+
requestBodyEncoding: "none",
|
|
61
|
+
responseBodyEncoding: "standard_envelope",
|
|
62
|
+
successStatus: 200,
|
|
63
|
+
safeReplay: true,
|
|
64
|
+
rejections: [],
|
|
65
|
+
idempotencyKey: "none",
|
|
66
|
+
replayWindowSeconds: null,
|
|
67
|
+
admitsExecutionName: false,
|
|
68
|
+
errorCodes: ["Internal_Unauthorized", "Internal_PermissionDenied", "Internal_ValidationFailed", "Internal_ServiceUnavailable", "Internal_SystemError", "Internal_DatabaseError", "Internal_DatabaseConnectionError", "Internal_InvalidState", "ParamStore_InvalidPath", "ParamStore_ParameterNotFound", "ParamStore_VersionNotFound"],
|
|
69
|
+
},
|
|
70
|
+
paramstore_param_version_delete: {
|
|
71
|
+
operationId: "paramstore.param.version_delete",
|
|
72
|
+
domain: "paramstore",
|
|
73
|
+
sdkMethod: ["paramstore", "param", "versionDelete"],
|
|
74
|
+
method: "DELETE",
|
|
75
|
+
pathTemplate: "/parameters/{trn}/version",
|
|
76
|
+
requestBodyEncoding: "none",
|
|
77
|
+
responseBodyEncoding: "none",
|
|
78
|
+
successStatus: 204,
|
|
79
|
+
safeReplay: false,
|
|
80
|
+
rejections: [],
|
|
81
|
+
idempotencyKey: "none",
|
|
82
|
+
replayWindowSeconds: null,
|
|
83
|
+
admitsExecutionName: false,
|
|
84
|
+
errorCodes: ["Internal_Unauthorized", "Internal_PermissionDenied", "Internal_ValidationFailed", "Internal_ServiceUnavailable", "Internal_SystemError", "Internal_DatabaseError", "Internal_DatabaseConnectionError", "Internal_InvalidState", "ParamStore_InvalidPath", "ParamStore_ParameterNotFound", "ParamStore_VersionNotFound", "Declarative_RemovalBlocked"],
|
|
85
|
+
},
|
|
86
|
+
paramstore_param_version_list: {
|
|
87
|
+
operationId: "paramstore.param.version_list",
|
|
88
|
+
domain: "paramstore",
|
|
89
|
+
sdkMethod: ["paramstore", "param", "versionList"],
|
|
90
|
+
method: "GET",
|
|
91
|
+
pathTemplate: "/parameters/{trn}/versions",
|
|
92
|
+
requestBodyEncoding: "none",
|
|
93
|
+
responseBodyEncoding: "standard_envelope",
|
|
94
|
+
successStatus: 200,
|
|
95
|
+
safeReplay: true,
|
|
96
|
+
rejections: [],
|
|
97
|
+
idempotencyKey: "none",
|
|
98
|
+
replayWindowSeconds: null,
|
|
99
|
+
admitsExecutionName: false,
|
|
100
|
+
errorCodes: ["Internal_Unauthorized", "Internal_PermissionDenied", "Internal_ValidationFailed", "Internal_ServiceUnavailable", "Internal_SystemError", "Internal_DatabaseError", "Internal_DatabaseConnectionError", "Internal_InvalidState", "ParamStore_InvalidPath", "ParamStore_ParameterNotFound"],
|
|
101
|
+
},
|
|
102
|
+
paramstore_param_version_read: {
|
|
103
|
+
operationId: "paramstore.param.version_read",
|
|
104
|
+
domain: "paramstore",
|
|
105
|
+
sdkMethod: ["paramstore", "param", "versionRead"],
|
|
106
|
+
method: "GET",
|
|
107
|
+
pathTemplate: "/parameters/{trn}/version",
|
|
108
|
+
requestBodyEncoding: "none",
|
|
109
|
+
responseBodyEncoding: "standard_envelope",
|
|
110
|
+
successStatus: 200,
|
|
111
|
+
safeReplay: true,
|
|
112
|
+
rejections: [],
|
|
113
|
+
idempotencyKey: "none",
|
|
114
|
+
replayWindowSeconds: null,
|
|
115
|
+
admitsExecutionName: false,
|
|
116
|
+
errorCodes: ["Internal_Unauthorized", "Internal_PermissionDenied", "Internal_ValidationFailed", "Internal_ServiceUnavailable", "Internal_SystemError", "Internal_DatabaseError", "Internal_DatabaseConnectionError", "Internal_InvalidState", "ParamStore_InvalidPath", "ParamStore_ParameterNotFound", "ParamStore_VersionNotFound"],
|
|
117
|
+
},
|
|
118
|
+
paramstore_param_version_set_current: {
|
|
119
|
+
operationId: "paramstore.param.version_set_current",
|
|
120
|
+
domain: "paramstore",
|
|
121
|
+
sdkMethod: ["paramstore", "param", "versionSetCurrent"],
|
|
122
|
+
method: "POST",
|
|
123
|
+
pathTemplate: "/parameters/{trn}/version/set-current",
|
|
124
|
+
requestBodyEncoding: "none",
|
|
125
|
+
responseBodyEncoding: "standard_envelope",
|
|
126
|
+
successStatus: 200,
|
|
127
|
+
safeReplay: false,
|
|
128
|
+
rejections: ["ParamStore_InvalidPath", "ParamStore_ParameterNotFound", "ParamStore_VersionNotFound"],
|
|
129
|
+
idempotencyKey: "none",
|
|
130
|
+
replayWindowSeconds: null,
|
|
131
|
+
admitsExecutionName: false,
|
|
132
|
+
errorCodes: ["Internal_Unauthorized", "Internal_PermissionDenied", "Internal_ValidationFailed", "Internal_ServiceUnavailable", "Internal_SystemError", "Internal_DatabaseError", "Internal_DatabaseConnectionError", "Internal_InvalidState", "ParamStore_InvalidPath", "ParamStore_ParameterNotFound", "ParamStore_VersionNotFound"],
|
|
133
|
+
},
|
|
134
|
+
} as const satisfies Readonly<Record<string, SdkOperation>>;
|
|
135
|
+
|
|
136
|
+
export const SDK_OPERATIONS: readonly SdkOperation[] = Object.values(OPERATIONS);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// @generated by xtask ts-client-export; DO NOT EDIT
|
|
2
|
+
|
|
3
|
+
export type { EvaluateResponse } from "@aionixone/client-types/paramstore";
|
|
4
|
+
export type { ParamStoreParamResource } from "@aionixone/client-types/paramstore";
|
|
5
|
+
export type { ParamType } from "@aionixone/client-types/paramstore";
|
|
6
|
+
export type { ParameterManagementView } from "@aionixone/client-types/paramstore";
|
|
7
|
+
export type { ParameterSummary } from "@aionixone/client-types/paramstore";
|
|
8
|
+
export type { ParameterValueResponse } from "@aionixone/client-types/paramstore";
|
|
9
|
+
export type { ParameterVersionResponse } from "@aionixone/client-types/paramstore";
|
|
10
|
+
export type { TypeMismatchDetails } from "@aionixone/client-types/paramstore";
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
// @generated by xtask ts-client-export; DO NOT EDIT
|
|
2
|
+
|
|
3
|
+
import { encodePathParam, withQuery } from '@aionixone/client-core';
|
|
4
|
+
import type { CallEngine, CallOptions } from '@aionixone/client-core';
|
|
5
|
+
import { OPERATIONS } from './catalog.js';
|
|
6
|
+
import type { ParamstoreParamEvaluateResponse, ParamstoreParamListQuery, ParamstoreParamListResponse, ParamstoreParamReadResponse, ParamstoreParamValueReadResponse, ParamstoreParamVersionDeleteResponse, ParamstoreParamVersionListQuery, ParamstoreParamVersionListResponse, ParamstoreParamVersionReadResponse, ParamstoreParamVersionSetCurrentResponse } from './types.js';
|
|
7
|
+
|
|
8
|
+
/** The `paramstore` service. */
|
|
9
|
+
export class ParamstoreService {
|
|
10
|
+
readonly param: ParamstoreParamResource;
|
|
11
|
+
|
|
12
|
+
/** Not part of the public API: `AionixOne` constructs every service. */
|
|
13
|
+
constructor(engine: CallEngine) {
|
|
14
|
+
this.param = new ParamstoreParamResource(engine);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** The `param` operations of the `paramstore` service. */
|
|
19
|
+
export class ParamstoreParamResource {
|
|
20
|
+
readonly #engine: CallEngine;
|
|
21
|
+
|
|
22
|
+
/** Not part of the public API. */
|
|
23
|
+
constructor(engine: CallEngine) {
|
|
24
|
+
this.#engine = engine;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Evaluate parameter value with dynamic expression resolution
|
|
29
|
+
*
|
|
30
|
+
* Evaluate one parameter by TRN and resolve any dynamic expression at read time
|
|
31
|
+
*
|
|
32
|
+
* Replay: has no effect; retried after an attempt with an unknown result.
|
|
33
|
+
* Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`, `ParamStore_InvalidPath`, `ParamStore_ParameterNotFound`, `ParamStore_VersionNotFound`, `ParamStore_ExpressionError`, `ParamStore_TypeMismatch`, `Internal_Timeout`.
|
|
34
|
+
*
|
|
35
|
+
* @param trn Parameter TRN in the route path
|
|
36
|
+
* @param options Call options.
|
|
37
|
+
* @throws {AionixCallError} when the call fails, summarized over its attempts.
|
|
38
|
+
*/
|
|
39
|
+
evaluate(trn: string, options?: CallOptions): Promise<ParamstoreParamEvaluateResponse> {
|
|
40
|
+
return this.#engine.call<ParamstoreParamEvaluateResponse>(OPERATIONS.paramstore_param_evaluate, { path: `/parameters/${encodePathParam(trn)}/evaluate`, primaryResourceTrn: trn }, options);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* List parameters
|
|
45
|
+
*
|
|
46
|
+
* List parameters with optional pathPrefix, recursive, type, search, tag, and sort filters
|
|
47
|
+
*
|
|
48
|
+
* Replay: has no effect; retried after an attempt with an unknown result.
|
|
49
|
+
* Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`.
|
|
50
|
+
*
|
|
51
|
+
* @param query The query, by wire names.
|
|
52
|
+
* @param options Call options.
|
|
53
|
+
* @throws {AionixCallError} when the call fails, summarized over its attempts.
|
|
54
|
+
*/
|
|
55
|
+
list(query?: ParamstoreParamListQuery, options?: CallOptions): Promise<ParamstoreParamListResponse> {
|
|
56
|
+
return this.#engine.call<ParamstoreParamListResponse>(OPERATIONS.paramstore_param_list, { path: withQuery(`/parameters`, query) }, options);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Every item of `paramstore.param.list`, page after page, starting from `query`.
|
|
61
|
+
* Each page is one call with its own time budget and retries.
|
|
62
|
+
*
|
|
63
|
+
* @param query The query of the first page; `limit` is the size of every page.
|
|
64
|
+
* @param options Call options of every page.
|
|
65
|
+
*/
|
|
66
|
+
async *listIter(query?: ParamstoreParamListQuery, options?: CallOptions): AsyncGenerator<ParamstoreParamListResponse['items'][number], void, undefined> {
|
|
67
|
+
let offset = query?.offset ?? 0;
|
|
68
|
+
for (;;) {
|
|
69
|
+
const response = await this.list({ ...query, offset }, options);
|
|
70
|
+
const page = response;
|
|
71
|
+
yield* page.items;
|
|
72
|
+
if (!page.hasMore) return;
|
|
73
|
+
offset += page.items.length;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Read parameter
|
|
79
|
+
*
|
|
80
|
+
* Read current parameter management view
|
|
81
|
+
*
|
|
82
|
+
* Read the current parameter declaration and management information
|
|
83
|
+
*
|
|
84
|
+
* Replay: has no effect; retried after an attempt with an unknown result.
|
|
85
|
+
* Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`, `ParamStore_InvalidPath`, `ParamStore_ParameterNotFound`.
|
|
86
|
+
*
|
|
87
|
+
* @param trn Parameter TRN in the route path
|
|
88
|
+
* @param options Call options.
|
|
89
|
+
* @throws {AionixCallError} when the call fails, summarized over its attempts.
|
|
90
|
+
*/
|
|
91
|
+
read(trn: string, options?: CallOptions): Promise<ParamstoreParamReadResponse> {
|
|
92
|
+
return this.#engine.call<ParamstoreParamReadResponse>(OPERATIONS.paramstore_param_read, { path: `/parameters/${encodePathParam(trn)}`, primaryResourceTrn: trn }, options);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Read raw parameter value
|
|
97
|
+
*
|
|
98
|
+
* Read raw parameter value and source version
|
|
99
|
+
*
|
|
100
|
+
* Read a current or pinned value and its source version without evaluating expressions
|
|
101
|
+
*
|
|
102
|
+
* Replay: has no effect; retried after an attempt with an unknown result.
|
|
103
|
+
* Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`, `ParamStore_InvalidPath`, `ParamStore_ParameterNotFound`, `ParamStore_VersionNotFound`.
|
|
104
|
+
*
|
|
105
|
+
* @param trn Parameter TRN in the route path
|
|
106
|
+
* @param options Call options.
|
|
107
|
+
* @throws {AionixCallError} when the call fails, summarized over its attempts.
|
|
108
|
+
*/
|
|
109
|
+
valueRead(trn: string, options?: CallOptions): Promise<ParamstoreParamValueReadResponse> {
|
|
110
|
+
return this.#engine.call<ParamstoreParamValueReadResponse>(OPERATIONS.paramstore_param_value_read, { path: `/parameters/${encodePathParam(trn)}/value`, primaryResourceTrn: trn }, options);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Delete one parameter version
|
|
115
|
+
*
|
|
116
|
+
* Delete parameter version
|
|
117
|
+
*
|
|
118
|
+
* Delete the exact qualified version; the current version cannot be deleted, make another version current first
|
|
119
|
+
*
|
|
120
|
+
* Replay: not declared; an attempt with an unknown result is not retried.
|
|
121
|
+
* Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`, `ParamStore_InvalidPath`, `ParamStore_ParameterNotFound`, `ParamStore_VersionNotFound`, `Declarative_RemovalBlocked`.
|
|
122
|
+
*
|
|
123
|
+
* @param trn Version TRN: the resource TRN with the v<n> qualifier of one version
|
|
124
|
+
* @param options Call options.
|
|
125
|
+
* @throws {AionixCallError} when the call fails, summarized over its attempts.
|
|
126
|
+
*/
|
|
127
|
+
versionDelete(trn: string, options?: CallOptions): Promise<ParamstoreParamVersionDeleteResponse> {
|
|
128
|
+
return this.#engine.call<ParamstoreParamVersionDeleteResponse>(OPERATIONS.paramstore_param_version_delete, { path: `/parameters/${encodePathParam(trn)}/version`, primaryResourceTrn: trn }, options);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* List parameter versions
|
|
133
|
+
*
|
|
134
|
+
* List historical versions for one parameter TRN
|
|
135
|
+
*
|
|
136
|
+
* Replay: has no effect; retried after an attempt with an unknown result.
|
|
137
|
+
* Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`, `ParamStore_InvalidPath`, `ParamStore_ParameterNotFound`.
|
|
138
|
+
*
|
|
139
|
+
* @param trn Stable TRN of the versioned resource, without a version qualifier
|
|
140
|
+
* @param query The query, by wire names.
|
|
141
|
+
* @param options Call options.
|
|
142
|
+
* @throws {AionixCallError} when the call fails, summarized over its attempts.
|
|
143
|
+
*/
|
|
144
|
+
versionList(trn: string, query?: ParamstoreParamVersionListQuery, options?: CallOptions): Promise<ParamstoreParamVersionListResponse> {
|
|
145
|
+
return this.#engine.call<ParamstoreParamVersionListResponse>(OPERATIONS.paramstore_param_version_list, { path: withQuery(`/parameters/${encodePathParam(trn)}/versions`, query), primaryResourceTrn: trn }, options);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Every item of `paramstore.param.version_list`, page after page, starting from `query`.
|
|
150
|
+
* Each page is one call with its own time budget and retries.
|
|
151
|
+
*
|
|
152
|
+
* @param trn Stable TRN of the versioned resource, without a version qualifier
|
|
153
|
+
* @param query The query of the first page; `limit` is the size of every page.
|
|
154
|
+
* @param options Call options of every page.
|
|
155
|
+
*/
|
|
156
|
+
async *versionListIter(trn: string, query?: ParamstoreParamVersionListQuery, options?: CallOptions): AsyncGenerator<ParamstoreParamVersionListResponse['items'][number], void, undefined> {
|
|
157
|
+
let offset = query?.offset ?? 0;
|
|
158
|
+
for (;;) {
|
|
159
|
+
const response = await this.versionList(trn, { ...query, offset }, options);
|
|
160
|
+
const page = response;
|
|
161
|
+
yield* page.items;
|
|
162
|
+
if (!page.hasMore) return;
|
|
163
|
+
offset += page.items.length;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Read parameter version
|
|
169
|
+
*
|
|
170
|
+
* Get parameter version
|
|
171
|
+
*
|
|
172
|
+
* Read one historical parameter version directly by its version TRN
|
|
173
|
+
*
|
|
174
|
+
* Replay: has no effect; retried after an attempt with an unknown result.
|
|
175
|
+
* Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`, `ParamStore_InvalidPath`, `ParamStore_ParameterNotFound`, `ParamStore_VersionNotFound`.
|
|
176
|
+
*
|
|
177
|
+
* @param trn Version TRN: the resource TRN with the v<n> qualifier of one version
|
|
178
|
+
* @param options Call options.
|
|
179
|
+
* @throws {AionixCallError} when the call fails, summarized over its attempts.
|
|
180
|
+
*/
|
|
181
|
+
versionRead(trn: string, options?: CallOptions): Promise<ParamstoreParamVersionReadResponse> {
|
|
182
|
+
return this.#engine.call<ParamstoreParamVersionReadResponse>(OPERATIONS.paramstore_param_version_read, { path: `/parameters/${encodePathParam(trn)}/version`, primaryResourceTrn: trn }, options);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Make a parameter version current
|
|
187
|
+
*
|
|
188
|
+
* Set the current parameter version
|
|
189
|
+
*
|
|
190
|
+
* Point the parameter at an existing version; stable reads and evaluations then select it
|
|
191
|
+
*
|
|
192
|
+
* Replay: not idempotent; an attempt answered with `ParamStore_InvalidPath`, `ParamStore_ParameterNotFound`, `ParamStore_VersionNotFound` did not run.
|
|
193
|
+
* Declared errors: `Internal_Unauthorized`, `Internal_PermissionDenied`, `Internal_ValidationFailed`, `Internal_ServiceUnavailable`, `Internal_SystemError`, `Internal_DatabaseError`, `Internal_DatabaseConnectionError`, `Internal_InvalidState`, `ParamStore_InvalidPath`, `ParamStore_ParameterNotFound`, `ParamStore_VersionNotFound`.
|
|
194
|
+
*
|
|
195
|
+
* @param trn Version TRN: the resource TRN with the v<n> qualifier of one version
|
|
196
|
+
* @param options Call options.
|
|
197
|
+
* @throws {AionixCallError} when the call fails, summarized over its attempts.
|
|
198
|
+
*/
|
|
199
|
+
versionSetCurrent(trn: string, options?: CallOptions): Promise<ParamstoreParamVersionSetCurrentResponse> {
|
|
200
|
+
return this.#engine.call<ParamstoreParamVersionSetCurrentResponse>(OPERATIONS.paramstore_param_version_set_current, { path: `/parameters/${encodePathParam(trn)}/version/set-current`, primaryResourceTrn: trn }, options);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
// @generated by xtask ts-client-export; DO NOT EDIT
|
|
2
|
+
|
|
3
|
+
function assertTrnField(name: string, value: string): string {
|
|
4
|
+
if (value.length === 0) {
|
|
5
|
+
throw new Error(`TRN field '${name}' must not be empty`);
|
|
6
|
+
}
|
|
7
|
+
return value;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function assertTrnQualifier(name: string, value: string): string {
|
|
11
|
+
assertTrnField(name, value);
|
|
12
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(value)) {
|
|
13
|
+
throw new Error(`TRN qualifier '${name}' is invalid`);
|
|
14
|
+
}
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type ParsedTrnFields = Record<string, string>;
|
|
19
|
+
|
|
20
|
+
interface PlaceholderToken {
|
|
21
|
+
name: string;
|
|
22
|
+
pathLike: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function parsePlaceholderToken(token: string): PlaceholderToken | null {
|
|
26
|
+
if (!token.startsWith('{') || !token.endsWith('}')) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const raw = token.slice(1, -1);
|
|
30
|
+
const pathLike = raw.startsWith('...');
|
|
31
|
+
const name = (pathLike ? raw.slice(3) : raw).trim();
|
|
32
|
+
if (name.length === 0) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
return { name, pathLike };
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function matchPatternSegments(
|
|
39
|
+
patternSegments: string[],
|
|
40
|
+
actualSegments: string[],
|
|
41
|
+
patternIndex = 0,
|
|
42
|
+
actualIndex = 0,
|
|
43
|
+
captures: ParsedTrnFields = {}
|
|
44
|
+
): ParsedTrnFields | null {
|
|
45
|
+
if (patternIndex === patternSegments.length && actualIndex === actualSegments.length) {
|
|
46
|
+
return captures;
|
|
47
|
+
}
|
|
48
|
+
if (patternIndex >= patternSegments.length) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
const token = patternSegments[patternIndex];
|
|
52
|
+
const placeholder = parsePlaceholderToken(token);
|
|
53
|
+
if (!placeholder) {
|
|
54
|
+
if (actualIndex >= actualSegments.length || actualSegments[actualIndex] !== token) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
return matchPatternSegments(patternSegments, actualSegments, patternIndex + 1, actualIndex + 1, captures);
|
|
58
|
+
}
|
|
59
|
+
if (!placeholder.pathLike) {
|
|
60
|
+
if (actualIndex >= actualSegments.length || actualSegments[actualIndex].length === 0) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
return matchPatternSegments(
|
|
64
|
+
patternSegments,
|
|
65
|
+
actualSegments,
|
|
66
|
+
patternIndex + 1,
|
|
67
|
+
actualIndex + 1,
|
|
68
|
+
{ ...captures, [placeholder.name]: actualSegments[actualIndex] }
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
for (let end = actualIndex + 1; end <= actualSegments.length; end += 1) {
|
|
72
|
+
const candidate = actualSegments.slice(actualIndex, end).join('/');
|
|
73
|
+
if (candidate.length === 0) {
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
const matched = matchPatternSegments(
|
|
77
|
+
patternSegments,
|
|
78
|
+
actualSegments,
|
|
79
|
+
patternIndex + 1,
|
|
80
|
+
end,
|
|
81
|
+
{ ...captures, [placeholder.name]: candidate }
|
|
82
|
+
);
|
|
83
|
+
if (matched) {
|
|
84
|
+
return matched;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function parseTrnByPattern(pattern: string, trn: string): ParsedTrnFields | null {
|
|
91
|
+
const optionalQualifierStart = pattern.endsWith(']') ? pattern.lastIndexOf('[:') : -1;
|
|
92
|
+
const qualifierOptional = optionalQualifierStart >= 0;
|
|
93
|
+
const normalizedPattern = qualifierOptional
|
|
94
|
+
? `${pattern.slice(0, optionalQualifierStart)}:${pattern.slice(optionalQualifierStart + 2, -1)}`
|
|
95
|
+
: pattern;
|
|
96
|
+
const patternParts = normalizedPattern.split(':');
|
|
97
|
+
const trnParts = trn.split(':');
|
|
98
|
+
if ((patternParts.length !== 5 && patternParts.length !== 6)
|
|
99
|
+
|| (trnParts.length !== 5 && trnParts.length !== 6)) {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
let captures: ParsedTrnFields = {};
|
|
103
|
+
for (let index = 0; index < 4; index += 1) {
|
|
104
|
+
const patternToken = patternParts[index];
|
|
105
|
+
const trnToken = trnParts[index];
|
|
106
|
+
const placeholder = parsePlaceholderToken(patternToken);
|
|
107
|
+
if (!placeholder) {
|
|
108
|
+
if (patternToken !== trnToken) {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
if (placeholder.pathLike || trnToken.length === 0) {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
captures = { ...captures, [placeholder.name]: trnToken };
|
|
117
|
+
}
|
|
118
|
+
const patternResource = patternParts[4].length === 0 ? [] : patternParts[4].split('/');
|
|
119
|
+
const trnResource = trnParts[4].length === 0 ? [] : trnParts[4].split('/');
|
|
120
|
+
const resourceCaptures = matchPatternSegments(patternResource, trnResource);
|
|
121
|
+
if (!resourceCaptures) {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
captures = { ...captures, ...resourceCaptures };
|
|
125
|
+
const patternQualifier = patternParts[5];
|
|
126
|
+
const trnQualifier = trnParts[5];
|
|
127
|
+
if (patternQualifier === undefined) {
|
|
128
|
+
return trnQualifier === undefined ? captures : null;
|
|
129
|
+
}
|
|
130
|
+
if (trnQualifier === undefined) {
|
|
131
|
+
return qualifierOptional ? captures : null;
|
|
132
|
+
}
|
|
133
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(trnQualifier)) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
const qualifierPlaceholder = parsePlaceholderToken(patternQualifier);
|
|
137
|
+
if (!qualifierPlaceholder) {
|
|
138
|
+
return patternQualifier === trnQualifier ? captures : null;
|
|
139
|
+
}
|
|
140
|
+
if (qualifierPlaceholder.pathLike) {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
return { ...captures, [qualifierPlaceholder.name]: trnQualifier };
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export interface buildParamstoreParamCollectionTrnInput {
|
|
147
|
+
tenant: string;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export function buildParamstoreParamCollectionTrn(input: buildParamstoreParamCollectionTrnInput): string {
|
|
151
|
+
return "trn:paramstore:tenant:{tenant}:param/*"
|
|
152
|
+
.replace("{tenant}", assertTrnField("tenant", input.tenant))
|
|
153
|
+
;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export function parseParamstoreParamCollectionTrn(trn: string): buildParamstoreParamCollectionTrnInput | null {
|
|
157
|
+
const parsed = parseTrnByPattern("trn:paramstore:tenant:{tenant}:param/*", trn);
|
|
158
|
+
if (!parsed) {
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
tenant: parsed.tenant,
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export interface buildParamstoreParamItemTrnInput {
|
|
167
|
+
tenant: string;
|
|
168
|
+
param: string;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export function buildParamstoreParamItemTrn(input: buildParamstoreParamItemTrnInput): string {
|
|
172
|
+
return "trn:paramstore:tenant:{tenant}:param/{...param}"
|
|
173
|
+
.replace("{tenant}", assertTrnField("tenant", input.tenant))
|
|
174
|
+
.replace("{...param}", assertTrnField("param", input.param))
|
|
175
|
+
;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export function parseParamstoreParamItemTrn(trn: string): buildParamstoreParamItemTrnInput | null {
|
|
179
|
+
const parsed = parseTrnByPattern("trn:paramstore:tenant:{tenant}:param/{...param}", trn);
|
|
180
|
+
if (!parsed) {
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
return {
|
|
184
|
+
tenant: parsed.tenant,
|
|
185
|
+
param: parsed.param,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface buildParamstoreParamTargetTrnInput {
|
|
190
|
+
tenant: string;
|
|
191
|
+
param: string;
|
|
192
|
+
version_id?: string;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export function buildParamstoreParamTargetTrn(input: buildParamstoreParamTargetTrnInput): string {
|
|
196
|
+
const trn = "trn:paramstore:tenant:{tenant}:param/{...param}"
|
|
197
|
+
.replace("{tenant}", assertTrnField("tenant", input.tenant))
|
|
198
|
+
.replace("{...param}", assertTrnField("param", input.param))
|
|
199
|
+
;
|
|
200
|
+
return input.version_id === undefined
|
|
201
|
+
? trn
|
|
202
|
+
: `${trn}:${assertTrnQualifier("version_id", input.version_id)}`;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export function parseParamstoreParamTargetTrn(trn: string): buildParamstoreParamTargetTrnInput | null {
|
|
206
|
+
const parsed = parseTrnByPattern("trn:paramstore:tenant:{tenant}:param/{...param}[:{version_id}]", trn);
|
|
207
|
+
if (!parsed) {
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
210
|
+
return {
|
|
211
|
+
tenant: parsed.tenant,
|
|
212
|
+
param: parsed.param,
|
|
213
|
+
version_id: parsed.version_id,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export interface buildParamstoreParamVersionItemTrnInput {
|
|
218
|
+
tenant: string;
|
|
219
|
+
param: string;
|
|
220
|
+
version_id: string;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export function buildParamstoreParamVersionItemTrn(input: buildParamstoreParamVersionItemTrnInput): string {
|
|
224
|
+
return "trn:paramstore:tenant:{tenant}:param/{...param}:{version_id}"
|
|
225
|
+
.replace("{tenant}", assertTrnField("tenant", input.tenant))
|
|
226
|
+
.replace("{...param}", assertTrnField("param", input.param))
|
|
227
|
+
.replace("{version_id}", assertTrnQualifier("version_id", input.version_id))
|
|
228
|
+
;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export function parseParamstoreParamVersionItemTrn(trn: string): buildParamstoreParamVersionItemTrnInput | null {
|
|
232
|
+
const parsed = parseTrnByPattern("trn:paramstore:tenant:{tenant}:param/{...param}:{version_id}", trn);
|
|
233
|
+
if (!parsed) {
|
|
234
|
+
return null;
|
|
235
|
+
}
|
|
236
|
+
return {
|
|
237
|
+
tenant: parsed.tenant,
|
|
238
|
+
param: parsed.param,
|
|
239
|
+
version_id: parsed.version_id,
|
|
240
|
+
};
|
|
241
|
+
}
|