@entegrasyonapp/lib 1.0.0 → 1.0.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.
|
@@ -27,9 +27,9 @@ class Client {
|
|
|
27
27
|
}
|
|
28
28
|
getBaseURL() {
|
|
29
29
|
if (this.params.options?.env == Environment.STAGE) {
|
|
30
|
-
return 'https://
|
|
30
|
+
return 'https://stageapigw.trendyol.com/integration/';
|
|
31
31
|
}
|
|
32
|
-
return 'https://
|
|
32
|
+
return 'https://apigw.trendyol.com/integration/';
|
|
33
33
|
}
|
|
34
34
|
request(request) {
|
|
35
35
|
return new request_1.Request(this, request);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/integrations/trendyol/v1/client.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,uCAAoC;AAiBpC,IAAY,WAGX;AAHD,WAAY,WAAW;IACnB,yDAAU,CAAA;IACV,+CAAK,CAAA;AACT,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAOD,MAAa,MAAM;IACI;IAAnB,YAAmB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;QACpC,MAAM,cAAc,GAAa;YAC7B,GAAG,EAAE,WAAW,CAAC,UAAU;YAC3B,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE,CAAC,EAAE,aAAa;YACzB,KAAK,EAAE,SAAS;SACnB,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,gDAAgD;IACzH,CAAC;IAED,UAAU;QACN,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,WAAW,CAAC,KAAK,EAAE,CAAC;YAChD,OAAO,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/integrations/trendyol/v1/client.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,uCAAoC;AAiBpC,IAAY,WAGX;AAHD,WAAY,WAAW;IACnB,yDAAU,CAAA;IACV,+CAAK,CAAA;AACT,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAOD,MAAa,MAAM;IACI;IAAnB,YAAmB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;QACpC,MAAM,cAAc,GAAa;YAC7B,GAAG,EAAE,WAAW,CAAC,UAAU;YAC3B,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE,CAAC,EAAE,aAAa;YACzB,KAAK,EAAE,SAAS;SACnB,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,gDAAgD;IACzH,CAAC;IAED,UAAU;QACN,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,WAAW,CAAC,KAAK,EAAE,CAAC;YAChD,OAAO,8CAA8C,CAAC;QAC1D,CAAC;QACD,OAAO,yCAAyC,CAAC;IACrD,CAAC;IAED,OAAO,CAAC,OAA+B;QACnC,OAAO,IAAI,iBAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;CACJ;AArBD,wBAqBC","sourcesContent":["/**\n * Client module for Trendyol\n * @package entegrasyonapp/lib\n * @author Ekin Karadeniz\n * @copyright 2023-2024\n */\n\nimport { Request } from \"./request\";\nimport { IClient } from \"./../../../common/client\";\nimport { IRequestInput } from \"./../../../common/request\";\n\nexport interface ICredentials {\n supplierId: string;\n apiKey: string;\n apiSecret: string;\n}\n\nexport interface IOptions {\n env: Environment;\n debug: boolean;\n timeout: number; // milliseconds\n proxy: any;\n}\n\nexport enum Environment {\n PRODUCTION,\n STAGE\n}\n\nexport interface IClientParams {\n credentials: ICredentials;\n options?: Partial<IOptions>;\n}\n\nexport class Client implements IClient {\n constructor(public params: IClientParams) {\n const defaultOptions: IOptions = {\n env: Environment.PRODUCTION,\n debug: false,\n timeout: 0, // no timeout\n proxy: undefined\n };\n this.params.options = { ...defaultOptions, ...this.params.options }; // {...{foo:'bar'}, ...undefined} == {foo:'bar'}\n }\n\n getBaseURL(): string {\n if (this.params.options?.env == Environment.STAGE) {\n return 'https://stageapigw.trendyol.com/integration/';\n }\n return 'https://apigw.trendyol.com/integration/';\n }\n\n request(request: Partial<IRequestInput>): Request {\n return new Request(this, request);\n }\n}\n"]}
|