@salesforce/b2c-tooling-sdk 0.4.1 → 0.5.1
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 +1 -1
- package/data/cip-proto/common.proto +281 -0
- package/data/cip-proto/requests.proto +178 -0
- package/data/cip-proto/responses.proto +135 -0
- package/dist/cjs/cli/base-command.d.ts +4 -2
- package/dist/cjs/cli/base-command.js +17 -7
- package/dist/cjs/cli/base-command.js.map +1 -1
- package/dist/cjs/cli/config.d.ts +1 -1
- package/dist/cjs/cli/config.js +4 -2
- package/dist/cjs/cli/config.js.map +1 -1
- package/dist/cjs/cli/instance-command.d.ts +2 -1
- package/dist/cjs/cli/mrt-command.d.ts +2 -1
- package/dist/cjs/cli/oauth-command.d.ts +2 -1
- package/dist/cjs/cli/ods-command.d.ts +2 -1
- package/dist/cjs/cli/webdav-command.d.ts +2 -1
- package/dist/cjs/clients/cip.d.ts +162 -0
- package/dist/cjs/clients/cip.js +571 -0
- package/dist/cjs/clients/cip.js.map +1 -0
- package/dist/cjs/clients/index.d.ts +3 -0
- package/dist/cjs/clients/index.js +2 -0
- package/dist/cjs/clients/index.js.map +1 -1
- package/dist/cjs/clients/middleware-registry.d.ts +1 -1
- package/dist/cjs/clients/middleware-registry.js.map +1 -1
- package/dist/cjs/config/dw-json.d.ts +10 -8
- package/dist/cjs/config/dw-json.js +10 -10
- package/dist/cjs/config/dw-json.js.map +1 -1
- package/dist/cjs/config/mapping.js +7 -0
- package/dist/cjs/config/mapping.js.map +1 -1
- package/dist/cjs/config/sources/dw-json-source.js +5 -5
- package/dist/cjs/config/sources/dw-json-source.js.map +1 -1
- package/dist/cjs/config/sources/package-json-source.js +2 -2
- package/dist/cjs/config/sources/package-json-source.js.map +1 -1
- package/dist/cjs/config/types.d.ts +5 -1
- package/dist/cjs/discovery/patterns/storefront-next.d.ts +4 -8
- package/dist/cjs/discovery/patterns/storefront-next.js +53 -8
- package/dist/cjs/discovery/patterns/storefront-next.js.map +1 -1
- package/dist/cjs/index.d.ts +4 -2
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/logging/index.d.ts +1 -1
- package/dist/cjs/logging/index.js +1 -1
- package/dist/cjs/operations/cip/index.d.ts +35 -0
- package/dist/cjs/operations/cip/index.js +128 -0
- package/dist/cjs/operations/cip/index.js.map +1 -0
- package/dist/cjs/operations/cip/reports.d.ts +2 -0
- package/dist/cjs/operations/cip/reports.js +210 -0
- package/dist/cjs/operations/cip/reports.js.map +1 -0
- package/dist/cjs/operations/cip/types.d.ts +97 -0
- package/dist/cjs/operations/cip/types.js +7 -0
- package/dist/cjs/operations/cip/types.js.map +1 -0
- package/dist/cjs/operations/content/export.js +2 -5
- package/dist/cjs/operations/content/export.js.map +1 -1
- package/dist/cjs/operations/jobs/index.d.ts +1 -1
- package/dist/cjs/operations/jobs/index.js +1 -1
- package/dist/cjs/operations/jobs/index.js.map +1 -1
- package/dist/cjs/operations/jobs/site-archive.d.ts +33 -9
- package/dist/cjs/operations/jobs/site-archive.js +43 -16
- package/dist/cjs/operations/jobs/site-archive.js.map +1 -1
- package/dist/cjs/schemas/index.d.ts +6 -1
- package/dist/cjs/schemas/index.js +7 -1
- package/dist/cjs/schemas/index.js.map +1 -1
- package/dist/cjs/schemas/security-schemes.d.ts +26 -0
- package/dist/cjs/schemas/security-schemes.js +44 -0
- package/dist/cjs/schemas/security-schemes.js.map +1 -0
- package/dist/esm/cli/base-command.d.ts +4 -2
- package/dist/esm/cli/base-command.js +17 -7
- package/dist/esm/cli/base-command.js.map +1 -1
- package/dist/esm/cli/config.d.ts +1 -1
- package/dist/esm/cli/config.js +4 -2
- package/dist/esm/cli/config.js.map +1 -1
- package/dist/esm/cli/instance-command.d.ts +2 -1
- package/dist/esm/cli/mrt-command.d.ts +2 -1
- package/dist/esm/cli/oauth-command.d.ts +2 -1
- package/dist/esm/cli/ods-command.d.ts +2 -1
- package/dist/esm/cli/webdav-command.d.ts +2 -1
- package/dist/esm/clients/cip.d.ts +162 -0
- package/dist/esm/clients/cip.js +571 -0
- package/dist/esm/clients/cip.js.map +1 -0
- package/dist/esm/clients/index.d.ts +3 -0
- package/dist/esm/clients/index.js +2 -0
- package/dist/esm/clients/index.js.map +1 -1
- package/dist/esm/clients/middleware-registry.d.ts +1 -1
- package/dist/esm/clients/middleware-registry.js.map +1 -1
- package/dist/esm/config/dw-json.d.ts +10 -8
- package/dist/esm/config/dw-json.js +10 -10
- package/dist/esm/config/dw-json.js.map +1 -1
- package/dist/esm/config/mapping.js +7 -0
- package/dist/esm/config/mapping.js.map +1 -1
- package/dist/esm/config/sources/dw-json-source.js +5 -5
- package/dist/esm/config/sources/dw-json-source.js.map +1 -1
- package/dist/esm/config/sources/package-json-source.js +2 -2
- package/dist/esm/config/sources/package-json-source.js.map +1 -1
- package/dist/esm/config/types.d.ts +5 -1
- package/dist/esm/discovery/patterns/storefront-next.d.ts +4 -8
- package/dist/esm/discovery/patterns/storefront-next.js +53 -8
- package/dist/esm/discovery/patterns/storefront-next.js.map +1 -1
- package/dist/esm/index.d.ts +4 -2
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/logging/index.d.ts +1 -1
- package/dist/esm/logging/index.js +1 -1
- package/dist/esm/operations/cip/index.d.ts +35 -0
- package/dist/esm/operations/cip/index.js +128 -0
- package/dist/esm/operations/cip/index.js.map +1 -0
- package/dist/esm/operations/cip/reports.d.ts +2 -0
- package/dist/esm/operations/cip/reports.js +210 -0
- package/dist/esm/operations/cip/reports.js.map +1 -0
- package/dist/esm/operations/cip/types.d.ts +97 -0
- package/dist/esm/operations/cip/types.js +7 -0
- package/dist/esm/operations/cip/types.js.map +1 -0
- package/dist/esm/operations/content/export.js +2 -5
- package/dist/esm/operations/content/export.js.map +1 -1
- package/dist/esm/operations/jobs/index.d.ts +1 -1
- package/dist/esm/operations/jobs/index.js +1 -1
- package/dist/esm/operations/jobs/index.js.map +1 -1
- package/dist/esm/operations/jobs/site-archive.d.ts +33 -9
- package/dist/esm/operations/jobs/site-archive.js +43 -16
- package/dist/esm/operations/jobs/site-archive.js.map +1 -1
- package/dist/esm/schemas/index.d.ts +6 -1
- package/dist/esm/schemas/index.js +7 -1
- package/dist/esm/schemas/index.js.map +1 -1
- package/dist/esm/schemas/security-schemes.d.ts +26 -0
- package/dist/esm/schemas/security-schemes.js +44 -0
- package/dist/esm/schemas/security-schemes.js.map +1 -0
- package/package.json +21 -9
package/README.md
CHANGED
|
@@ -306,7 +306,7 @@ The SDK provides subpath exports for tree-shaking and organization:
|
|
|
306
306
|
| `@salesforce/b2c-tooling-sdk/operations/users` | Account Manager user management |
|
|
307
307
|
| `@salesforce/b2c-tooling-sdk/operations/roles` | Account Manager role management |
|
|
308
308
|
| `@salesforce/b2c-tooling-sdk/operations/orgs` | Account Manager organization management |
|
|
309
|
-
| `@salesforce/b2c-tooling-sdk/discovery` | Workspace type detection (PWA Kit,
|
|
309
|
+
| `@salesforce/b2c-tooling-sdk/discovery` | Workspace type detection (PWA Kit, Storefront Next, cartridges, etc.) |
|
|
310
310
|
| `@salesforce/b2c-tooling-sdk/cli` | CLI utilities (BaseCommand, table rendering) |
|
|
311
311
|
| `@salesforce/b2c-tooling-sdk/logging` | Structured logging utilities |
|
|
312
312
|
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
6
|
+
* (the "License"); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
syntax = "proto3";
|
|
19
|
+
|
|
20
|
+
option java_package = "org.apache.calcite.avatica.proto";
|
|
21
|
+
|
|
22
|
+
// Details about a connection
|
|
23
|
+
message ConnectionProperties {
|
|
24
|
+
bool is_dirty = 1;
|
|
25
|
+
bool auto_commit = 2;
|
|
26
|
+
bool has_auto_commit = 7; // field is a Boolean, need to discern null and default value
|
|
27
|
+
bool read_only = 3;
|
|
28
|
+
bool has_read_only = 8; // field is a Boolean, need to discern null and default value
|
|
29
|
+
uint32 transaction_isolation = 4;
|
|
30
|
+
string catalog = 5;
|
|
31
|
+
string schema = 6;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Statement handle
|
|
35
|
+
message StatementHandle {
|
|
36
|
+
string connection_id = 1;
|
|
37
|
+
uint32 id = 2;
|
|
38
|
+
Signature signature = 3;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Results of preparing a statement
|
|
42
|
+
message Signature {
|
|
43
|
+
repeated ColumnMetaData columns = 1;
|
|
44
|
+
string sql = 2;
|
|
45
|
+
repeated AvaticaParameter parameters = 3;
|
|
46
|
+
CursorFactory cursor_factory = 4;
|
|
47
|
+
StatementType statementType = 5;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Has to be consistent with Meta.StatementType
|
|
51
|
+
enum StatementType {
|
|
52
|
+
SELECT = 0;
|
|
53
|
+
INSERT = 1;
|
|
54
|
+
UPDATE = 2;
|
|
55
|
+
DELETE = 3;
|
|
56
|
+
UPSERT = 4;
|
|
57
|
+
MERGE = 5;
|
|
58
|
+
OTHER_DML = 6;
|
|
59
|
+
CREATE = 7;
|
|
60
|
+
DROP = 8;
|
|
61
|
+
ALTER = 9;
|
|
62
|
+
OTHER_DDL = 10;
|
|
63
|
+
CALL = 11;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
message ColumnMetaData {
|
|
67
|
+
uint32 ordinal = 1;
|
|
68
|
+
bool auto_increment = 2;
|
|
69
|
+
bool case_sensitive = 3;
|
|
70
|
+
bool searchable = 4;
|
|
71
|
+
bool currency = 5;
|
|
72
|
+
uint32 nullable = 6;
|
|
73
|
+
bool signed = 7;
|
|
74
|
+
uint32 display_size = 8;
|
|
75
|
+
string label = 9;
|
|
76
|
+
string column_name = 10;
|
|
77
|
+
string schema_name = 11;
|
|
78
|
+
uint32 precision = 12;
|
|
79
|
+
uint32 scale = 13;
|
|
80
|
+
string table_name = 14;
|
|
81
|
+
string catalog_name = 15;
|
|
82
|
+
bool read_only = 16;
|
|
83
|
+
bool writable = 17;
|
|
84
|
+
bool definitely_writable = 18;
|
|
85
|
+
string column_class_name = 19;
|
|
86
|
+
AvaticaType type = 20;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
enum Rep {
|
|
90
|
+
PRIMITIVE_BOOLEAN = 0;
|
|
91
|
+
PRIMITIVE_BYTE = 1;
|
|
92
|
+
PRIMITIVE_CHAR = 2;
|
|
93
|
+
PRIMITIVE_SHORT = 3;
|
|
94
|
+
PRIMITIVE_INT = 4;
|
|
95
|
+
PRIMITIVE_LONG = 5;
|
|
96
|
+
PRIMITIVE_FLOAT = 6;
|
|
97
|
+
PRIMITIVE_DOUBLE = 7;
|
|
98
|
+
BOOLEAN = 8;
|
|
99
|
+
BYTE = 9;
|
|
100
|
+
CHARACTER = 10;
|
|
101
|
+
SHORT = 11;
|
|
102
|
+
INTEGER = 12;
|
|
103
|
+
LONG = 13;
|
|
104
|
+
FLOAT = 14;
|
|
105
|
+
DOUBLE = 15;
|
|
106
|
+
BIG_INTEGER = 25;
|
|
107
|
+
BIG_DECIMAL = 26;
|
|
108
|
+
JAVA_SQL_TIME = 16;
|
|
109
|
+
JAVA_SQL_TIMESTAMP = 17;
|
|
110
|
+
JAVA_SQL_DATE = 18;
|
|
111
|
+
JAVA_UTIL_DATE = 19;
|
|
112
|
+
BYTE_STRING = 20;
|
|
113
|
+
STRING = 21;
|
|
114
|
+
NUMBER = 22;
|
|
115
|
+
OBJECT = 23;
|
|
116
|
+
NULL = 24;
|
|
117
|
+
ARRAY = 27;
|
|
118
|
+
STRUCT = 28;
|
|
119
|
+
MULTISET = 29;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Base class for a column type
|
|
123
|
+
message AvaticaType {
|
|
124
|
+
uint32 id = 1;
|
|
125
|
+
string name = 2;
|
|
126
|
+
Rep rep = 3;
|
|
127
|
+
|
|
128
|
+
repeated ColumnMetaData columns = 4; // Only present when name = STRUCT
|
|
129
|
+
AvaticaType component = 5; // Only present when name = ARRAY
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Metadata for a parameter
|
|
133
|
+
message AvaticaParameter {
|
|
134
|
+
bool signed = 1;
|
|
135
|
+
uint32 precision = 2;
|
|
136
|
+
uint32 scale = 3;
|
|
137
|
+
uint32 parameter_type = 4;
|
|
138
|
+
string type_name = 5;
|
|
139
|
+
string class_name = 6;
|
|
140
|
+
string name = 7;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Information necessary to convert an Iterable into a Calcite Cursor
|
|
144
|
+
message CursorFactory {
|
|
145
|
+
enum Style {
|
|
146
|
+
OBJECT = 0;
|
|
147
|
+
RECORD = 1;
|
|
148
|
+
RECORD_PROJECTION = 2;
|
|
149
|
+
ARRAY = 3;
|
|
150
|
+
LIST = 4;
|
|
151
|
+
MAP = 5;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
Style style = 1;
|
|
155
|
+
string class_name = 2;
|
|
156
|
+
repeated string field_names = 3;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// A collection of rows
|
|
160
|
+
message Frame {
|
|
161
|
+
uint64 offset = 1;
|
|
162
|
+
bool done = 2;
|
|
163
|
+
repeated Row rows = 3;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// A row is a collection of values
|
|
167
|
+
message Row {
|
|
168
|
+
repeated ColumnValue value = 1;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// Database property, list of functions the database provides for a certain operation
|
|
172
|
+
message DatabaseProperty {
|
|
173
|
+
string name = 1;
|
|
174
|
+
repeated string functions = 2;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Message which encapsulates another message to support a single RPC endpoint
|
|
178
|
+
message WireMessage {
|
|
179
|
+
string name = 1;
|
|
180
|
+
bytes wrapped_message = 2;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// A value might be a TypedValue or an Array of TypedValue's
|
|
184
|
+
message ColumnValue {
|
|
185
|
+
repeated TypedValue value = 1; // deprecated, use array_value or scalar_value
|
|
186
|
+
repeated TypedValue array_value = 2;
|
|
187
|
+
bool has_array_value = 3; // Is an array value set?
|
|
188
|
+
TypedValue scalar_value = 4;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Generic wrapper to support any SQL type. Struct-like to work around no polymorphism construct.
|
|
192
|
+
message TypedValue {
|
|
193
|
+
Rep type = 1; // The actual type that was serialized in the general attribute below
|
|
194
|
+
|
|
195
|
+
bool bool_value = 2; // boolean
|
|
196
|
+
string string_value = 3; // char/varchar
|
|
197
|
+
sint64 number_value = 4; // var-len encoding lets us shove anything from byte to long
|
|
198
|
+
// includes numeric types and date/time types.
|
|
199
|
+
bytes bytes_value = 5; // binary/varbinary
|
|
200
|
+
double double_value = 6; // big numbers
|
|
201
|
+
bool null = 7; // a null object
|
|
202
|
+
|
|
203
|
+
repeated TypedValue array_value = 8; // The Array
|
|
204
|
+
Rep component_type = 9; // If an Array, the representation for the array values
|
|
205
|
+
|
|
206
|
+
bool implicitly_null = 10; // Differentiate between explicitly null (user-set) and implicitly null
|
|
207
|
+
// (un-set by the user)
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// The severity of some unexpected outcome to an operation.
|
|
211
|
+
// Protobuf enum values must be unique across all other enums
|
|
212
|
+
enum Severity {
|
|
213
|
+
UNKNOWN_SEVERITY = 0;
|
|
214
|
+
FATAL_SEVERITY = 1;
|
|
215
|
+
ERROR_SEVERITY = 2;
|
|
216
|
+
WARNING_SEVERITY = 3;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// Enumeration corresponding to DatabaseMetaData operations
|
|
220
|
+
enum MetaDataOperation {
|
|
221
|
+
GET_ATTRIBUTES = 0;
|
|
222
|
+
GET_BEST_ROW_IDENTIFIER = 1;
|
|
223
|
+
GET_CATALOGS = 2;
|
|
224
|
+
GET_CLIENT_INFO_PROPERTIES = 3;
|
|
225
|
+
GET_COLUMN_PRIVILEGES = 4;
|
|
226
|
+
GET_COLUMNS = 5;
|
|
227
|
+
GET_CROSS_REFERENCE = 6;
|
|
228
|
+
GET_EXPORTED_KEYS = 7;
|
|
229
|
+
GET_FUNCTION_COLUMNS = 8;
|
|
230
|
+
GET_FUNCTIONS = 9;
|
|
231
|
+
GET_IMPORTED_KEYS = 10;
|
|
232
|
+
GET_INDEX_INFO = 11;
|
|
233
|
+
GET_PRIMARY_KEYS = 12;
|
|
234
|
+
GET_PROCEDURE_COLUMNS = 13;
|
|
235
|
+
GET_PROCEDURES = 14;
|
|
236
|
+
GET_PSEUDO_COLUMNS = 15;
|
|
237
|
+
GET_SCHEMAS = 16;
|
|
238
|
+
GET_SCHEMAS_WITH_ARGS = 17;
|
|
239
|
+
GET_SUPER_TABLES = 18;
|
|
240
|
+
GET_SUPER_TYPES = 19;
|
|
241
|
+
GET_TABLE_PRIVILEGES = 20;
|
|
242
|
+
GET_TABLES = 21;
|
|
243
|
+
GET_TABLE_TYPES = 22;
|
|
244
|
+
GET_TYPE_INFO = 23;
|
|
245
|
+
GET_UDTS = 24;
|
|
246
|
+
GET_VERSION_COLUMNS = 25;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// Represents the breadth of arguments to DatabaseMetaData functions
|
|
250
|
+
message MetaDataOperationArgument {
|
|
251
|
+
enum ArgumentType {
|
|
252
|
+
STRING = 0;
|
|
253
|
+
BOOL = 1;
|
|
254
|
+
INT = 2;
|
|
255
|
+
REPEATED_STRING = 3;
|
|
256
|
+
REPEATED_INT = 4;
|
|
257
|
+
NULL = 5;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
string string_value = 1;
|
|
261
|
+
bool bool_value = 2;
|
|
262
|
+
sint32 int_value = 3;
|
|
263
|
+
repeated string string_array_values = 4;
|
|
264
|
+
repeated sint32 int_array_values = 5;
|
|
265
|
+
ArgumentType type = 6;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
enum StateType {
|
|
269
|
+
SQL = 0;
|
|
270
|
+
METADATA = 1;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
message QueryState {
|
|
274
|
+
StateType type = 1;
|
|
275
|
+
string sql = 2;
|
|
276
|
+
MetaDataOperation op = 3;
|
|
277
|
+
repeated MetaDataOperationArgument args = 4;
|
|
278
|
+
bool has_args = 5;
|
|
279
|
+
bool has_sql = 6;
|
|
280
|
+
bool has_op = 7;
|
|
281
|
+
}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
6
|
+
* (the "License"); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
syntax = "proto3";
|
|
18
|
+
|
|
19
|
+
option java_package = "org.apache.calcite.avatica.proto";
|
|
20
|
+
|
|
21
|
+
import "common.proto";
|
|
22
|
+
|
|
23
|
+
// Request for Meta#getCatalogs()
|
|
24
|
+
message CatalogsRequest {
|
|
25
|
+
string connection_id = 1;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Request for Meta#getDatabaseProperties()
|
|
29
|
+
message DatabasePropertyRequest {
|
|
30
|
+
string connection_id = 1;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Request for Meta#getSchemas(String, org.apache.calcite.avatica.Meta.Pat)}
|
|
34
|
+
message SchemasRequest {
|
|
35
|
+
string catalog = 1;
|
|
36
|
+
string schema_pattern = 2;
|
|
37
|
+
string connection_id = 3;
|
|
38
|
+
bool has_catalog = 4;
|
|
39
|
+
bool has_schema_pattern = 5;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Request for Request for Meta#getTables(String, org.apache.calcite.avatica.Meta.Pat,
|
|
43
|
+
// org.apache.calcite.avatica.Meta.Pat, java.util.List)
|
|
44
|
+
message TablesRequest {
|
|
45
|
+
string catalog = 1;
|
|
46
|
+
string schema_pattern = 2;
|
|
47
|
+
string table_name_pattern = 3;
|
|
48
|
+
repeated string type_list = 4;
|
|
49
|
+
bool has_type_list = 6; // Having an empty type_list is distinct from a null type_list
|
|
50
|
+
string connection_id = 7;
|
|
51
|
+
bool has_catalog = 8;
|
|
52
|
+
bool has_schema_pattern = 9;
|
|
53
|
+
bool has_table_name_pattern = 10;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Request for Meta#getTableTypes()
|
|
57
|
+
message TableTypesRequest {
|
|
58
|
+
string connection_id = 1;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Request for Meta#getColumns(String, org.apache.calcite.avatica.Meta.Pat,
|
|
62
|
+
// org.apache.calcite.avatica.Meta.Pat, org.apache.calcite.avatica.Meta.Pat).
|
|
63
|
+
message ColumnsRequest {
|
|
64
|
+
string catalog = 1;
|
|
65
|
+
string schema_pattern = 2;
|
|
66
|
+
string table_name_pattern = 3;
|
|
67
|
+
string column_name_pattern = 4;
|
|
68
|
+
string connection_id = 5;
|
|
69
|
+
bool has_catalog = 6;
|
|
70
|
+
bool has_schema_pattern = 7;
|
|
71
|
+
bool has_table_name_pattern = 8;
|
|
72
|
+
bool has_column_name_pattern = 9;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Request for Meta#getTypeInfo()
|
|
76
|
+
message TypeInfoRequest {
|
|
77
|
+
string connection_id = 1;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Request for Meta#prepareAndExecute(Meta.StatementHandle, String, long, Meta.PrepareCallback)
|
|
81
|
+
message PrepareAndExecuteRequest {
|
|
82
|
+
string connection_id = 1;
|
|
83
|
+
string sql = 2;
|
|
84
|
+
uint64 max_row_count = 3; // Deprecated
|
|
85
|
+
uint32 statement_id = 4;
|
|
86
|
+
int64 max_rows_total = 5; // The maximum number of rows that will be allowed for this query
|
|
87
|
+
int32 first_frame_max_size = 6; // The maximum number of rows that will be returned in the
|
|
88
|
+
// first Frame returned for this query.
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Request for Meta.prepare(Meta.ConnectionHandle, String, long)
|
|
92
|
+
message PrepareRequest {
|
|
93
|
+
string connection_id = 1;
|
|
94
|
+
string sql = 2;
|
|
95
|
+
uint64 max_row_count = 3; // Deprecated
|
|
96
|
+
int64 max_rows_total = 4; // The maximum number of rows that will be allowed for this query
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Request for Meta#fetch(Meta.StatementHandle, List, long, int)
|
|
100
|
+
message FetchRequest {
|
|
101
|
+
string connection_id = 1;
|
|
102
|
+
uint32 statement_id = 2;
|
|
103
|
+
uint64 offset = 3;
|
|
104
|
+
uint32 fetch_max_row_count = 4; // Maximum number of rows to be returned in the frame. Negative means no limit. Deprecated!
|
|
105
|
+
int32 frame_max_size = 5;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Request for Meta#createStatement(Meta.ConnectionHandle)
|
|
109
|
+
message CreateStatementRequest {
|
|
110
|
+
string connection_id = 1;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Request for Meta#closeStatement(Meta.StatementHandle)
|
|
114
|
+
message CloseStatementRequest {
|
|
115
|
+
string connection_id = 1;
|
|
116
|
+
uint32 statement_id = 2;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Request for Meta#openConnection(Meta.ConnectionHandle, Map<String, String>)
|
|
120
|
+
message OpenConnectionRequest {
|
|
121
|
+
string connection_id = 1;
|
|
122
|
+
map<string, string> info = 2;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Request for Meta#closeConnection(Meta.ConnectionHandle)
|
|
126
|
+
message CloseConnectionRequest {
|
|
127
|
+
string connection_id = 1;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
message ConnectionSyncRequest {
|
|
131
|
+
string connection_id = 1;
|
|
132
|
+
ConnectionProperties conn_props = 2;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Request for Meta#execute(Meta.ConnectionHandle, list, long)
|
|
136
|
+
message ExecuteRequest {
|
|
137
|
+
StatementHandle statementHandle = 1;
|
|
138
|
+
repeated TypedValue parameter_values = 2;
|
|
139
|
+
uint64 deprecated_first_frame_max_size = 3; // Deprecated, use the signed int instead.
|
|
140
|
+
bool has_parameter_values = 4;
|
|
141
|
+
int32 first_frame_max_size = 5; // The maximum number of rows to return in the first Frame
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
message SyncResultsRequest {
|
|
146
|
+
string connection_id = 1;
|
|
147
|
+
uint32 statement_id = 2;
|
|
148
|
+
QueryState state = 3;
|
|
149
|
+
uint64 offset = 4;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Request to invoke a commit on a Connection
|
|
153
|
+
message CommitRequest {
|
|
154
|
+
string connection_id = 1;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Request to invoke rollback on a Connection
|
|
158
|
+
message RollbackRequest {
|
|
159
|
+
string connection_id = 1;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Request to prepare and execute a collection of sql statements.
|
|
163
|
+
message PrepareAndExecuteBatchRequest {
|
|
164
|
+
string connection_id = 1;
|
|
165
|
+
uint32 statement_id = 2;
|
|
166
|
+
repeated string sql_commands = 3;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// Each command is a list of TypedValues
|
|
170
|
+
message UpdateBatch {
|
|
171
|
+
repeated TypedValue parameter_values = 1;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
message ExecuteBatchRequest {
|
|
175
|
+
string connection_id = 1;
|
|
176
|
+
uint32 statement_id = 2;
|
|
177
|
+
repeated UpdateBatch updates = 3; // A batch of updates is a list<list<typevalue>>
|
|
178
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
* this work for additional information regarding copyright ownership.
|
|
5
|
+
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
6
|
+
* (the "License"); you may not use this file except in compliance with
|
|
7
|
+
* the License. You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
syntax = "proto3";
|
|
18
|
+
|
|
19
|
+
option java_package = "org.apache.calcite.avatica.proto";
|
|
20
|
+
|
|
21
|
+
import "common.proto";
|
|
22
|
+
|
|
23
|
+
// Response that contains a result set.
|
|
24
|
+
message ResultSetResponse {
|
|
25
|
+
string connection_id = 1;
|
|
26
|
+
uint32 statement_id = 2;
|
|
27
|
+
bool own_statement = 3;
|
|
28
|
+
Signature signature = 4;
|
|
29
|
+
Frame first_frame = 5;
|
|
30
|
+
uint64 update_count = 6; // -1 for normal result sets, else this response contains a dummy result set
|
|
31
|
+
// with no signature nor other data.
|
|
32
|
+
RpcMetadata metadata = 7;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Response to PrepareAndExecuteRequest
|
|
36
|
+
message ExecuteResponse {
|
|
37
|
+
repeated ResultSetResponse results = 1;
|
|
38
|
+
bool missing_statement = 2; // Did the request fail because of no-cached statement
|
|
39
|
+
RpcMetadata metadata = 3;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Response to PrepareRequest
|
|
43
|
+
message PrepareResponse {
|
|
44
|
+
StatementHandle statement = 1;
|
|
45
|
+
RpcMetadata metadata = 2;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Response to FetchRequest
|
|
49
|
+
message FetchResponse {
|
|
50
|
+
Frame frame = 1;
|
|
51
|
+
bool missing_statement = 2; // Did the request fail because of no-cached statement
|
|
52
|
+
bool missing_results = 3; // Did the request fail because of a cached-statement w/o ResultSet
|
|
53
|
+
RpcMetadata metadata = 4;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Response to CreateStatementRequest
|
|
57
|
+
message CreateStatementResponse {
|
|
58
|
+
string connection_id = 1;
|
|
59
|
+
uint32 statement_id = 2;
|
|
60
|
+
RpcMetadata metadata = 3;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Response to CloseStatementRequest
|
|
64
|
+
message CloseStatementResponse {
|
|
65
|
+
RpcMetadata metadata = 1;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Response to OpenConnectionRequest {
|
|
69
|
+
message OpenConnectionResponse {
|
|
70
|
+
RpcMetadata metadata = 1;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Response to CloseConnectionRequest {
|
|
74
|
+
message CloseConnectionResponse {
|
|
75
|
+
RpcMetadata metadata = 1;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Response to ConnectionSyncRequest
|
|
79
|
+
message ConnectionSyncResponse {
|
|
80
|
+
ConnectionProperties conn_props = 1;
|
|
81
|
+
RpcMetadata metadata = 2;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
message DatabasePropertyElement {
|
|
85
|
+
DatabaseProperty key = 1;
|
|
86
|
+
TypedValue value = 2;
|
|
87
|
+
RpcMetadata metadata = 3;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Response for Meta#getDatabaseProperties()
|
|
91
|
+
message DatabasePropertyResponse {
|
|
92
|
+
repeated DatabasePropertyElement props = 1;
|
|
93
|
+
RpcMetadata metadata = 2;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Send contextual information about some error over the wire from the server.
|
|
97
|
+
message ErrorResponse {
|
|
98
|
+
repeated string exceptions = 1; // exception stacktraces, many for linked exceptions.
|
|
99
|
+
bool has_exceptions = 7; // are there stacktraces contained?
|
|
100
|
+
string error_message = 2; // human readable description
|
|
101
|
+
Severity severity = 3;
|
|
102
|
+
uint32 error_code = 4; // numeric identifier for error
|
|
103
|
+
string sql_state = 5; // five-character standard-defined value
|
|
104
|
+
RpcMetadata metadata = 6;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
message SyncResultsResponse {
|
|
108
|
+
bool missing_statement = 1; // Server doesn't have the statement with the ID from the request
|
|
109
|
+
bool more_results = 2; // Should the client fetch() to get more results
|
|
110
|
+
RpcMetadata metadata = 3;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Generic metadata for the server to return with each response.
|
|
114
|
+
message RpcMetadata {
|
|
115
|
+
string server_address = 1; // The host:port of the server
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Response to a commit request
|
|
119
|
+
message CommitResponse {
|
|
120
|
+
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Response to a rollback request
|
|
124
|
+
message RollbackResponse {
|
|
125
|
+
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Response to a batch update request
|
|
129
|
+
message ExecuteBatchResponse {
|
|
130
|
+
string connection_id = 1;
|
|
131
|
+
uint32 statement_id = 2;
|
|
132
|
+
repeated uint64 update_counts = 3;
|
|
133
|
+
bool missing_statement = 4; // Did the request fail because of no-cached statement
|
|
134
|
+
RpcMetadata metadata = 5;
|
|
135
|
+
}
|
|
@@ -11,6 +11,7 @@ export type Args<T extends typeof Command> = Interfaces.InferredArgs<T['args']>;
|
|
|
11
11
|
* Base command class for B2C CLI tools.
|
|
12
12
|
*
|
|
13
13
|
* Environment variables for logging:
|
|
14
|
+
* - SFCC_JSON_LOGS: Output log messages as JSON lines (for log aggregation)
|
|
14
15
|
* - SFCC_LOG_TO_STDOUT: Send logs to stdout instead of stderr
|
|
15
16
|
* - SFCC_LOG_COLORIZE: Force colors on/off (default: auto-detect TTY)
|
|
16
17
|
* - SFCC_REDACT_SECRETS: Set to 'false' to disable secret redaction
|
|
@@ -26,10 +27,11 @@ export declare abstract class BaseCommand<T extends typeof Command> extends Comm
|
|
|
26
27
|
'log-level': Interfaces.OptionFlag<"trace" | "debug" | "info" | "warn" | "error" | "silent" | undefined, Interfaces.CustomOptions>;
|
|
27
28
|
debug: Interfaces.BooleanFlag<boolean>;
|
|
28
29
|
json: Interfaces.BooleanFlag<boolean>;
|
|
30
|
+
jsonl: Interfaces.BooleanFlag<boolean>;
|
|
29
31
|
lang: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
|
|
30
32
|
config: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
|
|
31
33
|
instance: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
|
|
32
|
-
'
|
|
34
|
+
'project-directory': Interfaces.OptionFlag<string, Interfaces.CustomOptions>;
|
|
33
35
|
'extra-query': Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
|
|
34
36
|
'extra-body': Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
|
|
35
37
|
'extra-headers': Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
|
|
@@ -81,7 +83,7 @@ export declare abstract class BaseCommand<T extends typeof Command> extends Comm
|
|
|
81
83
|
* Gets base configuration options from common flags.
|
|
82
84
|
*
|
|
83
85
|
* Subclasses should spread these options when overriding loadConfiguration()
|
|
84
|
-
* to ensure common options like
|
|
86
|
+
* to ensure common options like workingDirectory are always included.
|
|
85
87
|
*
|
|
86
88
|
* @example
|
|
87
89
|
* ```typescript
|
|
@@ -18,6 +18,7 @@ const LOG_LEVELS = ['trace', 'debug', 'info', 'warn', 'error', 'silent'];
|
|
|
18
18
|
* Base command class for B2C CLI tools.
|
|
19
19
|
*
|
|
20
20
|
* Environment variables for logging:
|
|
21
|
+
* - SFCC_JSON_LOGS: Output log messages as JSON lines (for log aggregation)
|
|
21
22
|
* - SFCC_LOG_TO_STDOUT: Send logs to stdout instead of stderr
|
|
22
23
|
* - SFCC_LOG_COLORIZE: Force colors on/off (default: auto-detect TTY)
|
|
23
24
|
* - SFCC_REDACT_SECRETS: Set to 'false' to disable secret redaction
|
|
@@ -44,7 +45,14 @@ export class BaseCommand extends Command {
|
|
|
44
45
|
helpGroup: 'GLOBAL',
|
|
45
46
|
}),
|
|
46
47
|
json: Flags.boolean({
|
|
47
|
-
description: 'Output
|
|
48
|
+
description: 'Output result as JSON',
|
|
49
|
+
default: false,
|
|
50
|
+
helpGroup: 'GLOBAL',
|
|
51
|
+
}),
|
|
52
|
+
jsonl: Flags.boolean({
|
|
53
|
+
aliases: ['json-logs'],
|
|
54
|
+
description: 'Output log messages as JSON lines',
|
|
55
|
+
env: 'SFCC_JSON_LOGS',
|
|
48
56
|
default: false,
|
|
49
57
|
helpGroup: 'GLOBAL',
|
|
50
58
|
}),
|
|
@@ -64,9 +72,11 @@ export class BaseCommand extends Command {
|
|
|
64
72
|
env: 'SFCC_INSTANCE',
|
|
65
73
|
helpGroup: 'GLOBAL',
|
|
66
74
|
}),
|
|
67
|
-
'
|
|
68
|
-
|
|
69
|
-
|
|
75
|
+
'project-directory': Flags.string({
|
|
76
|
+
aliases: ['working-directory'],
|
|
77
|
+
description: 'Project directory',
|
|
78
|
+
env: 'SFCC_PROJECT_DIRECTORY',
|
|
79
|
+
default: async () => process.env.SFCC_WORKING_DIRECTORY || undefined,
|
|
70
80
|
helpGroup: 'GLOBAL',
|
|
71
81
|
}),
|
|
72
82
|
'extra-query': Flags.string({
|
|
@@ -207,7 +217,7 @@ export class BaseCommand extends Command {
|
|
|
207
217
|
level,
|
|
208
218
|
fd,
|
|
209
219
|
baseContext: { command: this.id },
|
|
210
|
-
json: this.flags.
|
|
220
|
+
json: this.flags.jsonl,
|
|
211
221
|
colorize: this.shouldColorize(),
|
|
212
222
|
redact,
|
|
213
223
|
});
|
|
@@ -233,7 +243,7 @@ export class BaseCommand extends Command {
|
|
|
233
243
|
* Gets base configuration options from common flags.
|
|
234
244
|
*
|
|
235
245
|
* Subclasses should spread these options when overriding loadConfiguration()
|
|
236
|
-
* to ensure common options like
|
|
246
|
+
* to ensure common options like workingDirectory are always included.
|
|
237
247
|
*
|
|
238
248
|
* @example
|
|
239
249
|
* ```typescript
|
|
@@ -250,7 +260,7 @@ export class BaseCommand extends Command {
|
|
|
250
260
|
return {
|
|
251
261
|
instance: this.flags.instance,
|
|
252
262
|
configPath: this.flags.config,
|
|
253
|
-
|
|
263
|
+
workingDirectory: this.flags['project-directory'],
|
|
254
264
|
};
|
|
255
265
|
}
|
|
256
266
|
/**
|