@halix/action-sdk 1.0.2 → 1.0.3
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/lib/cjs/index.js
CHANGED
|
@@ -12,9 +12,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.initialize = exports.prepareErrorResponse = exports.prepareSuccessResponse = exports.getValueFromObject = exports.compareValues = exports.sortObjectArray = exports.saveRelatedObject = exports.getObject = exports.getRelatedObjects = exports.params = exports.userContext = exports.actionSubject = exports.serviceAddress = exports.sandboxKey = exports.authToken = void 0;
|
|
15
|
+
exports.initialize = exports.prepareErrorResponse = exports.prepareSuccessResponse = exports.getValueFromObject = exports.compareValues = exports.sortObjectArray = exports.saveRelatedObject = exports.getObject = exports.getRelatedObjects = exports.useBody = exports.params = exports.userContext = exports.actionSubject = exports.serviceAddress = exports.sandboxKey = exports.authToken = void 0;
|
|
16
16
|
const axios_1 = __importDefault(require("axios"));
|
|
17
|
-
let useBody = false;
|
|
18
17
|
function getRelatedObjects(parentElementId, parentKey, elementId, filter) {
|
|
19
18
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
19
|
let params;
|
|
@@ -125,7 +124,7 @@ function getValueFromObject(object, attribute) {
|
|
|
125
124
|
}
|
|
126
125
|
exports.getValueFromObject = getValueFromObject;
|
|
127
126
|
function prepareSuccessResponse(returnVal) {
|
|
128
|
-
if (useBody) {
|
|
127
|
+
if (exports.useBody) {
|
|
129
128
|
return {
|
|
130
129
|
statusCode: 200,
|
|
131
130
|
body: JSON.stringify(returnVal)
|
|
@@ -135,7 +134,7 @@ function prepareSuccessResponse(returnVal) {
|
|
|
135
134
|
}
|
|
136
135
|
exports.prepareSuccessResponse = prepareSuccessResponse;
|
|
137
136
|
function prepareErrorResponse(errorMessage) {
|
|
138
|
-
if (useBody) {
|
|
137
|
+
if (exports.useBody) {
|
|
139
138
|
return {
|
|
140
139
|
statusCode: 400,
|
|
141
140
|
body: JSON.stringify({ errorMessage })
|
|
@@ -148,7 +147,7 @@ function initialize(event) {
|
|
|
148
147
|
let body = event;
|
|
149
148
|
if (event.body) {
|
|
150
149
|
body = event.body;
|
|
151
|
-
useBody = true;
|
|
150
|
+
exports.useBody = true;
|
|
152
151
|
}
|
|
153
152
|
({ authToken: exports.authToken, sandboxKey: exports.sandboxKey, serviceAddress: exports.serviceAddress, actionSubject: exports.actionSubject, userContext: exports.userContext, params: exports.params } = body);
|
|
154
153
|
}
|
package/lib/cjs/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare let authToken: string, sandboxKey: string, serviceAddress: string, actionSubject: string, userContext: string, params: string;
|
|
1
|
+
export declare let authToken: string, sandboxKey: string, serviceAddress: string, actionSubject: string, userContext: string, params: string, useBody: boolean;
|
|
2
2
|
export declare function getRelatedObjects(parentElementId: string, parentKey: string, elementId: string, filter: string): Promise<any>;
|
|
3
3
|
export declare function getObject(dataElementId: string, key: string): Promise<any>;
|
|
4
4
|
export declare function saveRelatedObject(parentElementId: string, parentKey: string, elementId: string, objectToSave: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAGA,eAAO,IAAI,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAGA,eAAO,IAAI,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM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, params;
|
|
3
|
-
let useBody = false;
|
|
2
|
+
export let authToken, sandboxKey, serviceAddress, actionSubject, userContext, params, useBody;
|
|
4
3
|
export async function getRelatedObjects(parentElementId, parentKey, elementId, filter) {
|
|
5
4
|
let params;
|
|
6
5
|
if (filter) {
|
package/lib/esm/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare let authToken: string, sandboxKey: string, serviceAddress: string, actionSubject: string, userContext: string, params: string;
|
|
1
|
+
export declare let authToken: string, sandboxKey: string, serviceAddress: string, actionSubject: string, userContext: string, params: string, useBody: boolean;
|
|
2
2
|
export declare function getRelatedObjects(parentElementId: string, parentKey: string, elementId: string, filter: string): Promise<any>;
|
|
3
3
|
export declare function getObject(dataElementId: string, key: string): Promise<any>;
|
|
4
4
|
export declare function saveRelatedObject(parentElementId: string, parentKey: string, elementId: string, objectToSave: string): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAGA,eAAO,IAAI,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAGA,eAAO,IAAI,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC;AAEvJ,wBAAsB,iBAAiB,CAAC,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,gBAiBpH;AAED,wBAAsB,SAAS,CA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