Skip to content

Commit 1d3e49f

Browse files
committed
redo env prefix
1 parent b6c7907 commit 1d3e49f

File tree

2 files changed

+29
-24
lines changed

2 files changed

+29
-24
lines changed

resources/buildConfigDefinitions.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,18 @@ function getCommentValue(comment) {
4040
}
4141

4242
function getENVPrefix(iface) {
43-
let name = iface.id.name;
44-
if (name.indexOf('Options') === -1) {
45-
return;
43+
const options = {
44+
'ParseServerOptions' : 'PARSE_SERVER_',
45+
'CustomPagesOptions' : 'PARSE_SERVER_CUSTOM_PAGES_',
46+
'LiveQueryServerOptions' : 'PARSE_LIVE_QUERY_SERVER_',
47+
'LiveQueryOptions' : 'PARSE_SERVER_LIVEQUERY_',
48+
'IdempotencyOptions' : 'PARSE_SERVER_EXPERIMENTAL_IDEMPOTENCY_',
49+
'AccountLockoutOptions' : 'PARSE_SERVER_ACCOUNT_LOCKOUT_',
50+
'PasswordPolicyOptions' : 'PARSE_SERVER_PASSWORD_POLICY_'
51+
}
52+
if (options[iface.id.name]) {
53+
return options[iface.id.name]
4654
}
47-
name = name.replace('Options','').replace('ParseServer','');
48-
const splitName = name.split(/(?=[A-Z])/).map(name => name.toUpperCase());
49-
return `PARSE_SERVER_${splitName.join('_')}_`.replace('__','_');
5055
}
5156

5257
function processProperty(property, iface) {

src/Options/Definitions.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -451,100 +451,100 @@ module.exports.LiveQueryOptions = {
451451
action: parsers.arrayParser,
452452
},
453453
pubSubAdapter: {
454-
env: 'PARSE_SERVER_LIVE_QUERY_PUB_SUB_ADAPTER',
454+
env: 'PARSE_SERVER_LIVEQUERY_PUB_SUB_ADAPTER',
455455
help: 'LiveQuery pubsub adapter',
456456
action: parsers.moduleOrObjectParser,
457457
},
458458
redisOptions: {
459-
env: 'PARSE_SERVER_LIVE_QUERY_REDIS_OPTIONS',
459+
env: 'PARSE_SERVER_LIVEQUERY_REDIS_OPTIONS',
460460
help: "parse-server's LiveQuery redisOptions",
461461
action: parsers.objectParser,
462462
},
463463
redisURL: {
464-
env: 'PARSE_SERVER_LIVE_QUERY_REDIS_URL',
464+
env: 'PARSE_SERVER_LIVEQUERY_REDIS_URL',
465465
help: "parse-server's LiveQuery redisURL",
466466
},
467467
wssAdapter: {
468-
env: 'PARSE_SERVER_LIVE_QUERY_WSS_ADAPTER',
468+
env: 'PARSE_SERVER_LIVEQUERY_WSS_ADAPTER',
469469
help: 'Adapter module for the WebSocketServer',
470470
action: parsers.moduleOrObjectParser,
471471
},
472472
};
473473
module.exports.LiveQueryServerOptions = {
474474
appId: {
475-
env: 'PARSE_SERVER_LIVE_QUERY_SERVER_APP_ID',
475+
env: 'PARSE_LIVE_QUERY_SERVER_APP_ID',
476476
help:
477477
'This string should match the appId in use by your Parse Server. If you deploy the LiveQuery server alongside Parse Server, the LiveQuery server will try to use the same appId.',
478478
},
479479
cacheTimeout: {
480-
env: 'PARSE_SERVER_LIVE_QUERY_SERVER_CACHE_TIMEOUT',
480+
env: 'PARSE_LIVE_QUERY_SERVER_CACHE_TIMEOUT',
481481
help:
482482
"Number in milliseconds. When clients provide the sessionToken to the LiveQuery server, the LiveQuery server will try to fetch its ParseUser's objectId from parse server and store it in the cache. The value defines the duration of the cache. Check the following Security section and our protocol specification for details, defaults to 5 * 1000 ms (5 seconds).",
483483
action: parsers.numberParser('cacheTimeout'),
484484
},
485485
keyPairs: {
486-
env: 'PARSE_SERVER_LIVE_QUERY_SERVER_KEY_PAIRS',
486+
env: 'PARSE_LIVE_QUERY_SERVER_KEY_PAIRS',
487487
help:
488488
'A JSON object that serves as a whitelist of keys. It is used for validating clients when they try to connect to the LiveQuery server. Check the following Security section and our protocol specification for details.',
489489
action: parsers.objectParser,
490490
},
491491
logLevel: {
492-
env: 'PARSE_SERVER_LIVE_QUERY_SERVER_LOG_LEVEL',
492+
env: 'PARSE_LIVE_QUERY_SERVER_LOG_LEVEL',
493493
help:
494494
'This string defines the log level of the LiveQuery server. We support VERBOSE, INFO, ERROR, NONE, defaults to INFO.',
495495
},
496496
masterKey: {
497-
env: 'PARSE_SERVER_LIVE_QUERY_SERVER_MASTER_KEY',
497+
env: 'PARSE_LIVE_QUERY_SERVER_MASTER_KEY',
498498
help:
499499
'This string should match the masterKey in use by your Parse Server. If you deploy the LiveQuery server alongside Parse Server, the LiveQuery server will try to use the same masterKey.',
500500
},
501501
port: {
502-
env: 'PARSE_SERVER_LIVE_QUERY_SERVER_PORT',
502+
env: 'PARSE_LIVE_QUERY_SERVER_PORT',
503503
help: 'The port to run the LiveQuery server, defaults to 1337.',
504504
action: parsers.numberParser('port'),
505505
default: 1337,
506506
},
507507
pubSubAdapter: {
508-
env: 'PARSE_SERVER_LIVE_QUERY_SERVER_PUB_SUB_ADAPTER',
508+
env: 'PARSE_LIVE_QUERY_SERVER_PUB_SUB_ADAPTER',
509509
help: 'LiveQuery pubsub adapter',
510510
action: parsers.moduleOrObjectParser,
511511
},
512512
redisOptions: {
513-
env: 'PARSE_SERVER_LIVE_QUERY_SERVER_REDIS_OPTIONS',
513+
env: 'PARSE_LIVE_QUERY_SERVER_REDIS_OPTIONS',
514514
help: "parse-server's LiveQuery redisOptions",
515515
action: parsers.objectParser,
516516
},
517517
redisURL: {
518-
env: 'PARSE_SERVER_LIVE_QUERY_SERVER_REDIS_URL',
518+
env: 'PARSE_LIVE_QUERY_SERVER_REDIS_URL',
519519
help: "parse-server's LiveQuery redisURL",
520520
},
521521
serverURL: {
522-
env: 'PARSE_SERVER_LIVE_QUERY_SERVER_SERVER_URL',
522+
env: 'PARSE_LIVE_QUERY_SERVER_SERVER_URL',
523523
help:
524524
'This string should match the serverURL in use by your Parse Server. If you deploy the LiveQuery server alongside Parse Server, the LiveQuery server will try to use the same serverURL.',
525525
},
526526
websocketTimeout: {
527-
env: 'PARSE_SERVER_LIVE_QUERY_SERVER_WEBSOCKET_TIMEOUT',
527+
env: 'PARSE_LIVE_QUERY_SERVER_WEBSOCKET_TIMEOUT',
528528
help:
529529
'Number of milliseconds between ping/pong frames. The WebSocket server sends ping/pong frames to the clients to keep the WebSocket alive. This value defines the interval of the ping/pong frame from the server to clients, defaults to 10 * 1000 ms (10 s).',
530530
action: parsers.numberParser('websocketTimeout'),
531531
},
532532
wssAdapter: {
533-
env: 'PARSE_SERVER_LIVE_QUERY_SERVER_WSS_ADAPTER',
533+
env: 'PARSE_LIVE_QUERY_SERVER_WSS_ADAPTER',
534534
help: 'Adapter module for the WebSocketServer',
535535
action: parsers.moduleOrObjectParser,
536536
},
537537
};
538538
module.exports.IdempotencyOptions = {
539539
paths: {
540-
env: 'PARSE_SERVER_IDEMPOTENCY_PATHS',
540+
env: 'PARSE_SERVER_EXPERIMENTAL_IDEMPOTENCY_PATHS',
541541
help:
542542
'An array of paths for which the feature should be enabled. The mount path must not be included, for example instead of `/parse/functions/myFunction` specifiy `functions/myFunction`. The entries are interpreted as regular expression, for example `functions/.*` matches all functions, `jobs/.*` matches all jobs, `classes/.*` matches all classes, `.*` matches all paths.',
543543
action: parsers.arrayParser,
544544
default: [],
545545
},
546546
ttl: {
547-
env: 'PARSE_SERVER_IDEMPOTENCY_TTL',
547+
env: 'PARSE_SERVER_EXPERIMENTAL_IDEMPOTENCY_TTL',
548548
help:
549549
'The duration in seconds after which a request record is discarded from the database, defaults to 300s.',
550550
action: parsers.numberParser('ttl'),

0 commit comments

Comments
 (0)