drapcode-developer-sdk 1.0.12 → 1.0.14
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/build/index.d.ts +2 -0
- package/build/index.js +24 -11
- package/build/methods/methods.d.ts +1 -0
- package/build/methods/methods.js +13 -1
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export declare class DrapcodeApis {
|
|
|
26
26
|
private version?;
|
|
27
27
|
private protocol;
|
|
28
28
|
constructor(projectSeoName: string, opts?: DrapcodeApiOptions);
|
|
29
|
+
constructor(project_seo_name: string, xApiKey: string, authorization: string, environment: Environment | string);
|
|
29
30
|
setProjectSeoName(seo_name: string): void;
|
|
30
31
|
getProjectSeoName(): string;
|
|
31
32
|
setXApiKey(apiKey: string): void;
|
|
@@ -98,6 +99,7 @@ export declare class DrapcodeApis {
|
|
|
98
99
|
addReferenceItem(collectionName: string, body: any): Promise<unknown>;
|
|
99
100
|
getItemsByids(collectionName: string, body: any): Promise<unknown>;
|
|
100
101
|
sendEmail(templateId: string, sendTo: string): Promise<unknown>;
|
|
102
|
+
aboutMe(body: any): Promise<unknown>;
|
|
101
103
|
}
|
|
102
104
|
export * from "./utils/index";
|
|
103
105
|
export * from "./utils/crypt";
|
package/build/index.js
CHANGED
|
@@ -69,9 +69,7 @@ var Environment;
|
|
|
69
69
|
Environment["ALPHA"] = "ALPHA";
|
|
70
70
|
})(Environment = exports.Environment || (exports.Environment = {}));
|
|
71
71
|
var DrapcodeApis = /** @class */ (function () {
|
|
72
|
-
|
|
73
|
-
function DrapcodeApis(projectSeoName, opts) {
|
|
74
|
-
if (opts === void 0) { opts = {}; }
|
|
72
|
+
function DrapcodeApis(projectSeoName, opts, authorization, environment) {
|
|
75
73
|
var _a;
|
|
76
74
|
//Network/URL Related
|
|
77
75
|
this.API_PATH = "drapcode.io/api";
|
|
@@ -80,14 +78,22 @@ var DrapcodeApis = /** @class */ (function () {
|
|
|
80
78
|
this.version = 1;
|
|
81
79
|
this.protocol = "https";
|
|
82
80
|
this.seoName = projectSeoName;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
81
|
+
if (typeof opts === "object" && opts != null) {
|
|
82
|
+
this.xApiKey = opts.xApiKey;
|
|
83
|
+
this.xTenantId = opts.xTenantId;
|
|
84
|
+
this.xSubTenantId = opts.xSubTenantId;
|
|
85
|
+
this.authorization = opts.authorization;
|
|
86
|
+
this.environment =
|
|
87
|
+
(_a = opts.environment) !== null && _a !== void 0 ? _a : Environment.PRODUCTION;
|
|
88
|
+
this.builderKey = opts.builderKey;
|
|
89
|
+
this.version = opts.version;
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
this.xApiKey = opts;
|
|
93
|
+
this.authorization = authorization;
|
|
94
|
+
this.environment = environment !== null && environment !== void 0 ? environment : Environment.PRODUCTION;
|
|
95
|
+
this.version = 1;
|
|
96
|
+
}
|
|
91
97
|
}
|
|
92
98
|
DrapcodeApis.prototype.setProjectSeoName = function (seo_name) {
|
|
93
99
|
this.seoName = seo_name;
|
|
@@ -346,6 +352,13 @@ var DrapcodeApis = /** @class */ (function () {
|
|
|
346
352
|
});
|
|
347
353
|
});
|
|
348
354
|
};
|
|
355
|
+
DrapcodeApis.prototype.aboutMe = function (body) {
|
|
356
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
357
|
+
return __generator(this, function (_a) {
|
|
358
|
+
return [2 /*return*/, this.callApi(methods_1.aboutMe, body)];
|
|
359
|
+
});
|
|
360
|
+
});
|
|
361
|
+
};
|
|
349
362
|
return DrapcodeApis;
|
|
350
363
|
}());
|
|
351
364
|
exports.DrapcodeApis = DrapcodeApis;
|
|
@@ -72,3 +72,4 @@ export declare const deleteFieldItem: (baseurl: string, headers: Record<string,
|
|
|
72
72
|
* EMAIL
|
|
73
73
|
*/
|
|
74
74
|
export declare const sendEmail: (baseurl: string, headers: Record<string, string>, version: number, templateId: string, sendTo: any) => Promise<unknown>;
|
|
75
|
+
export declare const aboutMe: (baseurl: string, headers: Record<string, string>, version: number, body: any) => Promise<unknown>;
|
package/build/methods/methods.js
CHANGED
|
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.sendEmail = exports.deleteFieldItem = exports.clearItem = exports.deleteItemWithUuid = exports.updateItemWithUuid = exports.lastItem = exports.getItemWithUuid = exports.getItemsByids = exports.getAllItems = exports.getItemsCountWithFilter = exports.getItemsWithFilter = exports.createItem = exports.getItemOnly = exports.removeReferenceItem = exports.addReferenceItem = exports.bulkDeleteItems = exports.validateItem = exports.saveCSVData = exports.countItemByValue = exports.bulkCreateItems = void 0;
|
|
39
|
+
exports.aboutMe = exports.sendEmail = exports.deleteFieldItem = exports.clearItem = exports.deleteItemWithUuid = exports.updateItemWithUuid = exports.lastItem = exports.getItemWithUuid = exports.getItemsByids = exports.getAllItems = exports.getItemsCountWithFilter = exports.getItemsWithFilter = exports.createItem = exports.getItemOnly = exports.removeReferenceItem = exports.addReferenceItem = exports.bulkDeleteItems = exports.validateItem = exports.saveCSVData = exports.countItemByValue = exports.bulkCreateItems = void 0;
|
|
40
40
|
var constants_1 = require("../utils/constants");
|
|
41
41
|
var util_1 = require("../utils/util");
|
|
42
42
|
var request = function (version, url, options, process) {
|
|
@@ -419,3 +419,15 @@ var sendEmail = function (baseurl, headers, version, templateId, sendTo) { retur
|
|
|
419
419
|
});
|
|
420
420
|
}); };
|
|
421
421
|
exports.sendEmail = sendEmail;
|
|
422
|
+
var aboutMe = function (baseurl, headers, version, body) { return __awaiter(void 0, void 0, void 0, function () {
|
|
423
|
+
var url;
|
|
424
|
+
return __generator(this, function (_a) {
|
|
425
|
+
url = "".concat(baseurl, "/user/me");
|
|
426
|
+
return [2 /*return*/, request(version, url, {
|
|
427
|
+
method: "POST",
|
|
428
|
+
headers: headers,
|
|
429
|
+
body: JSON.stringify(body),
|
|
430
|
+
})];
|
|
431
|
+
});
|
|
432
|
+
}); };
|
|
433
|
+
exports.aboutMe = aboutMe;
|