@creator.co/wapi 1.3.6 → 1.3.8

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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@creator.co/wapi",
3
- "version": "1.3.5",
3
+ "version": "1.3.8",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -73,6 +73,12 @@ export default class Configuration<T extends ConfigurationSchema> {
73
73
  * @type {string}
74
74
  */
75
75
  private readonly remotePrefix;
76
+ /**
77
+ * Indicates if config is local and should attempt to override
78
+ * remote values from local.
79
+ * @type {string}
80
+ */
81
+ private static readonly isLocal;
76
82
  /**
77
83
  * Constructs a new instance of the class.
78
84
  * @param {T} schema - The schema object.
@@ -83,13 +83,20 @@ var Configuration = /** @class */ (function () {
83
83
  */
84
84
  Configuration.prototype.asyncGet = function (propName) {
85
85
  return __awaiter(this, void 0, void 0, function () {
86
- var propString, propSchema, v, _a;
86
+ var propString, propSchema, v, v_1, _a;
87
87
  return __generator(this, function (_b) {
88
88
  switch (_b.label) {
89
89
  case 0:
90
90
  propString = propName;
91
91
  propSchema = this.schema[propString];
92
92
  v = this.getCachedValue(propString);
93
+ // check for local override
94
+ if (Configuration.isLocal && process.env[propString] !== undefined) {
95
+ console.log("Overriding remote variable ".concat(propString, " with local value!"));
96
+ v_1 = process.env[propString];
97
+ this.cacheValue(propString, v_1, propSchema.cachingPolicy);
98
+ return [2 /*return*/, v_1];
99
+ }
93
100
  _a = v;
94
101
  if (_a) return [3 /*break*/, 2];
95
102
  return [4 /*yield*/, new EnvironmentVar_1.default(propString, propSchema.isSecure ? EnvironmentVar_1.EnvironmentType.SecureRemote : EnvironmentVar_1.EnvironmentType.PlainRemote, !propSchema.required, !propSchema.noPrefix ? this.remotePrefix : '').resolve()];
@@ -97,6 +104,7 @@ var Configuration = /** @class */ (function () {
97
104
  _a = (_b.sent());
98
105
  _b.label = 2;
99
106
  case 2:
107
+ // remote
100
108
  v = _a;
101
109
  this.cacheValue(propString, v, propSchema.cachingPolicy);
102
110
  return [2 /*return*/, v];
@@ -130,6 +138,12 @@ var Configuration = /** @class */ (function () {
130
138
  Configuration.prototype.resetCache = function () {
131
139
  cacheStore = new MemCache();
132
140
  };
141
+ /**
142
+ * Indicates if config is local and should attempt to override
143
+ * remote values from local.
144
+ * @type {string}
145
+ */
146
+ Configuration.isLocal = process.env.NODE_ENV == 'local';
133
147
  return Configuration;
134
148
  }());
135
149
  exports.default = Configuration;
@@ -1 +1 @@
1
- {"version":3,"file":"Configuration.js","sourceRoot":"","sources":["../../../src/Config/Configuration.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAsC;AACtC,+CAAgD;AAEhD,mDAAkE;AAElE,qCAAqC;AACrC,kCAAkC;AAClC;;;GAGG;AACH,IAAI,UAAU,GAAG,IAAI,QAAQ,EAAE,CAAA;AA2E/B;;;GAGG;AACH;IAYE;;;;;OAKG;IACH,uBAAY,MAAS,EAAE,YAAoB;QACzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;IAED;;;;OAIG;IACI,2BAAG,GAAV,UAAW,QAAsD;QAC/D,IAAM,UAAU,GAAG,QAAkB,CAAA;QACrC,IAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;QAC1C,IAAI,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAA;QACvC,CAAC;YACC,CAAC;gBACD,IAAI,wBAAc,CAChB,UAAU,EACV,gCAAe,CAAC,KAAK,EACrB,CAAC,UAAU,CAAC,QAAQ,EACpB,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAC9C,CAAC,WAAW,EAAE,CAAA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AG,CAAC,IAAI,EAAE,CAAC,CAAA;IACpE,CAAC;IAED;;;OAGG;IACK,kCAAU,GAAlB;QACE,UAAU,GAAG,IAAI,QAAQ,EAAE,CAAA;IAC7B,CAAC;IA/FD;;;;OAIG;IACqB,qBAAO,GAAY,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,OAAO,CAAA;IA2F5E,oBAAC;CAAA,AA3GD,IA2GC;kBA3GoB,aAAa"}
@@ -17,7 +17,7 @@ exports.DATABASES = {
17
17
  /**
18
18
  * A class that manages databases and provides methods for creating and accessing database instances.
19
19
  */
20
- var DatabaseManager = exports.DatabaseManager = /** @class */ (function () {
20
+ var DatabaseManager = /** @class */ (function () {
21
21
  function DatabaseManager() {
22
22
  this.databases = exports.DATABASES;
23
23
  this.instances = {};
@@ -46,4 +46,5 @@ var DatabaseManager = exports.DatabaseManager = /** @class */ (function () {
46
46
  DatabaseManager.INSTANCE = new DatabaseManager();
47
47
  return DatabaseManager;
48
48
  }());
49
+ exports.DatabaseManager = DatabaseManager;
49
50
  //# sourceMappingURL=DatabaseManager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DatabaseManager.js","sourceRoot":"","sources":["../../../src/Database/DatabaseManager.ts"],"names":[],"mappings":";;;AAAA,kCAAmC;AAEnC,iEAA+D;AAC/D,0EAAwE;AAGxE;;;;;GAKG;AACU,QAAA,SAAS,GAAG;IACvB,IAAI,EAAE,2BAAY;IAClB,EAAE,EAAE,mCAAgB;CACrB,CAAA;AAED;;GAEG;AACH;IAAA;QAKU,cAAS,GAAqB,iBAAS,CAAA;QAEvC,cAAS,GAA2C,EAAE,CAAA;IAuBhE,CAAC;IArBC;;;;;OAKG;IACI,gCAAM,GAAb,UAAsC,MAAmB;QACvD,IAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,CAAA;QAC/B,IAAI,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE;YAC9B,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAQ,C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AC,CAAC,MAAa,CAAC,CAAA;IACvD,CAAC;IA5BD;;OAEG;IACoB,wBAAQ,GAAG,IAAI,eAAe,EAAE,AAAxB,CAAwB;IA0BzD,sBAAC;CAAA,AA9BD,IA8BC;AA9BY,0CAAe"}
@@ -60,7 +60,7 @@ var Database_1 = require("../../Database");
60
60
  * Represents a Knex database connection.
61
61
  * @extends Database<KnexTransaction>
62
62
  */
63
- var KnexDatabase = exports.KnexDatabase = /** @class */ (function (_super) {
63
+ var KnexDatabase = /** @class */ (function (_super) {
64
64
  __extends(KnexDatabase, _super);
65
65
  /**
66
66
  * Constructs a new instance of the database class using the provided configuration.
@@ -109,4 +109,5 @@ var KnexDatabase = exports.KnexDatabase = /** @class */ (function (_super) {
109
109
  KnexDatabase.knexProvider = knex_1.default;
110
110
  return KnexDatabase;
111
111
  }(Database_1.Database));
112
+ exports.KnexDatabase = KnexDatabase;
112
113
  //# sourceMappingURL=KnexDatabase.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"KnexDatabase.js","sourceRoot":"","sources":["../../../../../src/Database/integrations/knex/KnexDatabase.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAAiC;AACjC,gDAAiD;AAEjD,qDAAwE;AACxE,2CAAyC;AAGzC;;;GAGG;AACH;IAAkC,gCAAyB;IAKzD;;;;OAIG;IACH,sBAAmB,MAAwB;QAA3C,YACE,kBAAM,MAAM,CAAC,SAGd;QADC,KAAI,CAAC,MAAM,GAAG,YAAY,CAAC,YAAY,CAAC,KAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAA;;IACvE,CAAC;IAEO,sCAAe,GAAvB,UAAwB,MAAwB;QAC9C,IAAM,UAAU,GAAG;YACjB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,UAAU,EAAE;gBACV,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,IAAI,EAAE,MAAM,CAAC,IAAI;g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AAI,EAAE,MAAM,CAAC,IAAI;gBACjB,IAAI,EAAE,MAAM,CAAC,QAAQ;gBACrB,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;aAC1B;YACD,IAAI,EAAE;gBACJ,GAAG,EAAE,CAAC;gBACN,GAAG,EAAE,MAAM,CAAC,cAAc;aAC3B;SACF,CAAA;QAED,OAAO,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAA;IAC7E,CAAC;IAED;;;OAGG;IACmB,kCAAW,GAAjC;;;;;4BACmB,qBAAM,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,EAAA;;wBAA1C,QAAQ,GAAG,SAA+B;wBAChD,sBAAO,qCAAmB,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAA;;;;KACxD;IAzCc,yBAAY,GAAiE,cAAI,CAAA;IA0ClG,mBAAC;CAAA,AA3CD,CAAkC,mBAAQ,GA2CzC;AA3CY,oCAAY"}
@@ -59,7 +59,7 @@ var Database_1 = require("../../Database");
59
59
  * Represents a Postgres database connection.
60
60
  * @extends Database<PostgresTransaction>
61
61
  */
62
- var PostgresDatabase = exports.PostgresDatabase = /** @class */ (function (_super) {
62
+ var PostgresDatabase = /** @class */ (function (_super) {
63
63
  __extends(PostgresDatabase, _super);
64
64
  /**
65
65
  * Constructs a new instance of the class with the given database configuration.
@@ -104,4 +104,5 @@ var PostgresDatabase = exports.PostgresDatabase = /** @class */ (function (_supe
104
104
  PostgresDatabase.pgProvider = pg_1.Pool;
105
105
  return PostgresDatabase;
106
106
  }(Database_1.Database));
107
+ exports.PostgresDatabase = PostgresDatabase;
107
108
  //# sourceMappingURL=PostgresDatabase.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PostgresDatabase.js","sourceRoot":"","sources":["../../../../../src/Database/integrations/pgsql/PostgresDatabase.ts"],"names":[],"mappings":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AC,SASd;QARC,KAAI,CAAC,MAAM,GAAG,IAAI,gBAAgB,CAAC,UAAU,CAAC;YAC5C,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,IAAI,EAAE,MAAM,CAAC,QAAQ;YACrB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,GAAG,EAAE,MAAM,CAAC,cAAc;SAC3B,CAAC,CAAA;;IACJ,CAAC;IAED;;;OAGG;IACmB,sCAAW,GAAjC;;;;;4BACmB,qBAAM,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,EAAA;;wBAAtC,QAAQ,GAAG,SAA2B;wBAC5C,qBAAM,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,EAAA;;wBAA7B,SAA6B,CAAA;wBAC7B,sBAAO,6CAAuB,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAA;;;;KAC5D;IApCD;;OAEG;IACY,2BAAU,GAAG,SAAI,CAAA;IAkClC,uBAAC;CAAA,AAtCD,CAAsC,mBAAQ,GAsC7C;AAtCY,4CAAgB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@creator.co/wapi",
3
- "version": "1.3.6",
3
+ "version": "1.3.8",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -99,6 +99,12 @@ export default class Configuration<T extends ConfigurationSchema> {
99
99
  * @type {string}
100
100
  */
101
101
  private readonly remotePrefix: string
102
+ /**
103
+ * Indicates if config is local and should attempt to override
104
+ * remote values from local.
105
+ * @type {string}
106
+ */
107
+ private static readonly isLocal: boolean = process.env.NODE_ENV == 'local'
102
108
 
103
109
  /**
104
110
  * Constructs a new instance of the class.
@@ -140,7 +146,16 @@ export default class Configuration<T extends ConfigurationSchema> {
140
146
  public async asyncGet(propName: keyof OmitByValueType<ExtractRemote<T>, null>): Promise<any> {
141
147
  const propString = propName as string
142
148
  const propSchema = this.schema[propString]
149
+ // check cache
143
150
  let v = this.getCachedValue(propString)
151
+ // check for local override
152
+ if (Configuration.isLocal && process.env[propString] !== undefined) {
153
+ console.log(`Overriding remote variable ${propString} with local value!`)
154
+ const v = process.env[propString]
155
+ this.cacheValue(propString, v, propSchema.cachingPolicy)
156
+ return v
157
+ }
158
+ // remote
144
159
  v =
145
160
  v ||
146
161
  (await new EnvironmentVar<string>(