appwrite-utils-cli 1.7.4 → 1.7.5
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.
|
@@ -182,7 +182,7 @@ export class AdapterFactory {
|
|
|
182
182
|
// Prefer session with admin mode, fallback to API key with default mode
|
|
183
183
|
if (config.sessionCookie && isValidSessionCookie(config.sessionCookie)) {
|
|
184
184
|
client.setSession(config.sessionCookie);
|
|
185
|
-
client.
|
|
185
|
+
client.headers['X-Appwrite-Mode'] = 'admin';
|
|
186
186
|
logger.debug('Using session authentication for TablesDB adapter', {
|
|
187
187
|
project: config.appwriteProject,
|
|
188
188
|
operation: 'createTablesDBAdapter'
|
|
@@ -190,7 +190,7 @@ export class AdapterFactory {
|
|
|
190
190
|
}
|
|
191
191
|
else if (config.appwriteKey) {
|
|
192
192
|
client.setKey(config.appwriteKey);
|
|
193
|
-
client.
|
|
193
|
+
client.headers['X-Appwrite-Mode'] = 'default';
|
|
194
194
|
logger.debug('Using API key authentication for TablesDB adapter', {
|
|
195
195
|
project: config.appwriteProject,
|
|
196
196
|
operation: 'createTablesDBAdapter'
|
|
@@ -256,7 +256,7 @@ export class AdapterFactory {
|
|
|
256
256
|
// Prefer session with admin mode, fallback to API key with default mode
|
|
257
257
|
if (config.sessionCookie && isValidSessionCookie(config.sessionCookie)) {
|
|
258
258
|
client.setSession(config.sessionCookie);
|
|
259
|
-
client.
|
|
259
|
+
client.headers['X-Appwrite-Mode'] = 'admin';
|
|
260
260
|
logger.debug('Using session authentication for Legacy adapter', {
|
|
261
261
|
project: config.appwriteProject,
|
|
262
262
|
operation: 'createLegacyAdapter'
|
|
@@ -264,7 +264,7 @@ export class AdapterFactory {
|
|
|
264
264
|
}
|
|
265
265
|
else if (config.appwriteKey) {
|
|
266
266
|
client.setKey(config.appwriteKey);
|
|
267
|
-
client.
|
|
267
|
+
client.headers['X-Appwrite-Mode'] = 'default';
|
|
268
268
|
logger.debug('Using API key authentication for Legacy adapter', {
|
|
269
269
|
project: config.appwriteProject,
|
|
270
270
|
operation: 'createLegacyAdapter'
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "appwrite-utils-cli",
|
|
3
3
|
"description": "Appwrite Utility Functions to help with database management, data conversion, data import, migrations, and much more. Meant to be used as a CLI tool, I do not recommend installing this in frontend environments.",
|
|
4
|
-
"version": "1.7.
|
|
4
|
+
"version": "1.7.5",
|
|
5
5
|
"main": "src/main.ts",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"repository": {
|
|
@@ -234,15 +234,15 @@ export class AdapterFactory {
|
|
|
234
234
|
// Set authentication method with mode headers
|
|
235
235
|
// Prefer session with admin mode, fallback to API key with default mode
|
|
236
236
|
if (config.sessionCookie && isValidSessionCookie(config.sessionCookie)) {
|
|
237
|
-
|
|
238
|
-
client.
|
|
237
|
+
client.setSession(config.sessionCookie);
|
|
238
|
+
client.headers['X-Appwrite-Mode'] = 'admin';
|
|
239
239
|
logger.debug('Using session authentication for TablesDB adapter', {
|
|
240
240
|
project: config.appwriteProject,
|
|
241
241
|
operation: 'createTablesDBAdapter'
|
|
242
242
|
});
|
|
243
243
|
} else if (config.appwriteKey) {
|
|
244
244
|
client.setKey(config.appwriteKey);
|
|
245
|
-
client.
|
|
245
|
+
client.headers['X-Appwrite-Mode'] = 'default';
|
|
246
246
|
logger.debug('Using API key authentication for TablesDB adapter', {
|
|
247
247
|
project: config.appwriteProject,
|
|
248
248
|
operation: 'createTablesDBAdapter'
|
|
@@ -320,14 +320,14 @@ export class AdapterFactory {
|
|
|
320
320
|
// Prefer session with admin mode, fallback to API key with default mode
|
|
321
321
|
if (config.sessionCookie && isValidSessionCookie(config.sessionCookie)) {
|
|
322
322
|
(client as any).setSession(config.sessionCookie);
|
|
323
|
-
client.
|
|
323
|
+
client.headers['X-Appwrite-Mode'] = 'admin';
|
|
324
324
|
logger.debug('Using session authentication for Legacy adapter', {
|
|
325
325
|
project: config.appwriteProject,
|
|
326
326
|
operation: 'createLegacyAdapter'
|
|
327
327
|
});
|
|
328
328
|
} else if (config.appwriteKey) {
|
|
329
329
|
client.setKey(config.appwriteKey);
|
|
330
|
-
client.
|
|
330
|
+
client.headers['X-Appwrite-Mode'] = 'default';
|
|
331
331
|
logger.debug('Using API key authentication for Legacy adapter', {
|
|
332
332
|
project: config.appwriteProject,
|
|
333
333
|
operation: 'createLegacyAdapter'
|