@activepieces/piece-microsoft-dynamics-crm 0.0.6 → 0.1.0
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/README.md +9 -2
- package/package.json +4 -5
- package/src/index.d.ts +1 -0
- package/src/index.js +24 -15
- package/src/index.js.map +1 -1
- package/src/lib/actions/create-record.d.ts +1 -1
- package/src/lib/actions/create-record.js +1 -2
- package/src/lib/actions/create-record.js.map +1 -1
- package/src/lib/actions/delete-record.d.ts +1 -1
- package/src/lib/actions/delete-record.js +1 -2
- package/src/lib/actions/delete-record.js.map +1 -1
- package/src/lib/actions/get-record.d.ts +1 -1
- package/src/lib/actions/get-record.js +1 -2
- package/src/lib/actions/get-record.js.map +1 -1
- package/src/lib/actions/update-record.d.ts +1 -1
- package/src/lib/actions/update-record.js +1 -2
- package/src/lib/actions/update-record.js.map +1 -1
- package/src/lib/common/client.d.ts +5 -2
- package/src/lib/common/client.js +27 -5
- package/src/lib/common/client.js.map +1 -1
- package/src/lib/common/constants.d.ts +0 -9
- package/src/lib/common/constants.js +1 -234
- package/src/lib/common/constants.js.map +1 -1
- package/src/lib/common/index.d.ts +1 -1
- package/src/lib/common/index.js +52 -22
- package/src/lib/common/index.js.map +1 -1
- package/src/lib/common/types.d.ts +17 -0
package/README.md
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
# pieces-microsoft-dynamics-crm
|
|
2
|
-
|
|
3
|
-
This library was generated with [Nx](https://nx.dev).
|
|
2
|
+
# PREMIUM PIECE ON ACTIVEPIECES
|
|
4
3
|
|
|
5
4
|
## Building
|
|
6
5
|
|
|
7
6
|
Run `nx build pieces-microsoft-dynamics-crm` to build the library.
|
|
7
|
+
|
|
8
|
+
## Documentation
|
|
9
|
+
|
|
10
|
+
For detailed documentation, visit [Activepieces Documentation](https://www.activepieces.com/docs/getting-started/introduction).
|
|
11
|
+
|
|
12
|
+
## PLEASE CHECK THE LICENESE
|
|
13
|
+
|
|
14
|
+
This package is licensed under the The Activepieces Enterprise License. See the [LICENSE](https://github.com/activepieces/activepieces/blob/main/packages/ee/LICENSE) file for details.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-microsoft-dynamics-crm",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"license": {
|
|
5
5
|
"type": "COMMERCIAL",
|
|
6
6
|
"url": "https://raw.githubusercontent.com/activepieces/activepieces/main/packages/ee/LICENSE"
|
|
@@ -10,12 +10,11 @@
|
|
|
10
10
|
"axios": "1.6.7",
|
|
11
11
|
"dayjs": "1.11.9",
|
|
12
12
|
"is-base64": "1.1.0",
|
|
13
|
-
"lodash": "4.17.21",
|
|
14
13
|
"nanoid": "3.3.6",
|
|
15
14
|
"semver": "7.6.0",
|
|
16
|
-
"@activepieces/pieces-common": "0.2.
|
|
17
|
-
"@activepieces/pieces-framework": "0.7.
|
|
18
|
-
"@activepieces/shared": "0.10.
|
|
15
|
+
"@activepieces/pieces-common": "0.2.15",
|
|
16
|
+
"@activepieces/pieces-framework": "0.7.32",
|
|
17
|
+
"@activepieces/shared": "0.10.108",
|
|
19
18
|
"tslib": "1.14.1"
|
|
20
19
|
},
|
|
21
20
|
"main": "./src/index.js",
|
package/src/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export declare const dynamicsCRMAuth: import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>;
|
|
2
|
+
export declare function getBaseUrl(host: string, proxyUrl?: string): string;
|
|
2
3
|
export declare const microsoftDynamicsCrm: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.microsoftDynamicsCrm = exports.dynamicsCRMAuth = void 0;
|
|
3
|
+
exports.microsoftDynamicsCrm = exports.getBaseUrl = exports.dynamicsCRMAuth = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
5
6
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
7
|
const create_record_1 = require("./lib/actions/create-record");
|
|
@@ -15,24 +16,30 @@ exports.dynamicsCRMAuth = pieces_framework_1.PieceAuth.OAuth2({
|
|
|
15
16
|
description: 'Host URL without trailing slash.For example **https://demo.crm.dynamics.com**',
|
|
16
17
|
required: true,
|
|
17
18
|
}),
|
|
18
|
-
|
|
19
|
+
tenantId: pieces_framework_1.Property.ShortText({
|
|
19
20
|
displayName: 'Tenant ID',
|
|
20
21
|
description: 'You can find this in the Azure portal.',
|
|
21
22
|
defaultValue: 'common',
|
|
22
23
|
required: true,
|
|
23
24
|
}),
|
|
25
|
+
proxyUrl: pieces_framework_1.Property.ShortText({
|
|
26
|
+
displayName: 'Proxy URL with Port',
|
|
27
|
+
description: 'Only to use for establishing connections (only needed when proxying requests). For example **https://proxy.com:8080**.',
|
|
28
|
+
required: false,
|
|
29
|
+
}),
|
|
24
30
|
},
|
|
25
31
|
required: true,
|
|
26
|
-
scope: [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
'email',
|
|
30
|
-
'profile',
|
|
31
|
-
'offline_access',
|
|
32
|
-
],
|
|
33
|
-
authUrl: 'https://login.microsoftonline.com/{tenatId}/oauth2/v2.0/authorize',
|
|
34
|
-
tokenUrl: 'https://login.microsoftonline.com/{tenatId}/oauth2/v2.0/token',
|
|
32
|
+
scope: ['{hostUrl}/.default', 'openid', 'email', 'profile', 'offline_access'],
|
|
33
|
+
authUrl: 'https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/authorize',
|
|
34
|
+
tokenUrl: 'https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token',
|
|
35
35
|
});
|
|
36
|
+
function getBaseUrl(host, proxyUrl) {
|
|
37
|
+
if (proxyUrl) {
|
|
38
|
+
return proxyUrl;
|
|
39
|
+
}
|
|
40
|
+
return host;
|
|
41
|
+
}
|
|
42
|
+
exports.getBaseUrl = getBaseUrl;
|
|
36
43
|
exports.microsoftDynamicsCrm = (0, pieces_framework_1.createPiece)({
|
|
37
44
|
displayName: 'Microsoft Dynamics CRM',
|
|
38
45
|
auth: exports.dynamicsCRMAuth,
|
|
@@ -49,11 +56,13 @@ exports.microsoftDynamicsCrm = (0, pieces_framework_1.createPiece)({
|
|
|
49
56
|
(0, pieces_common_1.createCustomApiCallAction)({
|
|
50
57
|
auth: exports.dynamicsCRMAuth,
|
|
51
58
|
baseUrl: (auth) => {
|
|
52
|
-
|
|
53
|
-
return `${(
|
|
59
|
+
const props = auth.props;
|
|
60
|
+
return `${getBaseUrl(props === null || props === void 0 ? void 0 : props['hostUrl'], props.proxyUrl)}/api/data/v9.2`;
|
|
54
61
|
},
|
|
55
|
-
authMapping: (auth) => ({
|
|
56
|
-
|
|
62
|
+
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
63
|
+
return ({
|
|
64
|
+
Authorization: `Bearer ${auth.access_token}`,
|
|
65
|
+
});
|
|
57
66
|
}),
|
|
58
67
|
}),
|
|
59
68
|
],
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/ee/pieces/microsoft-dynamics-crm/src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/ee/pieces/microsoft-dynamics-crm/src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAwE;AACxE,qEAKwC;AACxC,+DAAiE;AACjE,+DAAiE;AACjE,yDAA2D;AAC3D,+DAAiE;AACjE,iDAAqD;AAExC,QAAA,eAAe,GAAG,4BAAS,CAAC,MAAM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AE,CAAC,IAAI,EAAE,EAAE;gBAChB,MAAM,KAAK,GAAI,IAA4B,CAAC,KAG3C,CAAC;gBACF,OAAO,GAAG,UAAU,CAClB,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,SAAS,CAAC,EAClB,KAAK,CAAC,QAAQ,CACf,gBAAgB,CAAC;YACpB,CAAC;YACD,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,WAAY,IAA4B,CAAC,YAAY,EAAE;iBACvE,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const createRecordAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
-
entityType: import("@activepieces/pieces-framework").
|
|
2
|
+
entityType: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
3
3
|
fields: import("@activepieces/pieces-framework").DynamicProperties<true>;
|
|
4
4
|
}>;
|
|
@@ -5,7 +5,6 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
6
|
const __1 = require("../../");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
|
-
const constants_1 = require("../common/constants");
|
|
9
8
|
exports.createRecordAction = (0, pieces_framework_1.createAction)({
|
|
10
9
|
auth: __1.dynamicsCRMAuth,
|
|
11
10
|
name: 'dynamics_crm_create_record',
|
|
@@ -18,7 +17,7 @@ exports.createRecordAction = (0, pieces_framework_1.createAction)({
|
|
|
18
17
|
run(context) {
|
|
19
18
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
20
19
|
const { entityType, fields } = context.propsValue;
|
|
21
|
-
const entityUrlPath =
|
|
20
|
+
const entityUrlPath = entityType;
|
|
22
21
|
const client = (0, common_1.makeClient)(context.auth);
|
|
23
22
|
return yield client.createRecord(entityUrlPath, fields);
|
|
24
23
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-record.js","sourceRoot":"","sources":["../../../../../../../../packages/ee/pieces/microsoft-dynamics-crm/src/lib/actions/create-record.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,8BAAyC;AACzC,sCAA0D;
|
|
1
|
+
{"version":3,"file":"create-record.js","sourceRoot":"","sources":["../../../../../../../../packages/ee/pieces/microsoft-dynamics-crm/src/lib/actions/create-record.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,8BAAyC;AACzC,sCAA0D;AAE7C,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,mBAAe;IACrB,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,uBAAuB;IACpC,KAAK,EAAE;QACL,UAAU,EAAE,0BAAiB,CAAC,UAAU,CACtC,mEAAmE,CACpE;QACD,MAAM,EAAE,0BAAiB,CAAC,YAAY,CAAC,IAAI,CAAC;KAC7C;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAElD,MAAM,aAAa,GAAG,UAAoB,CAAC;YAE3C,MAAM,MAAM,GAAG,IAAA,mBAAU,EACvB,OAAO,CAAC,IAAoD,CAC7D,CAAC;YAEF,OAAO,MAAM,MAAM,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QAC1D,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const deleteRecordAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
-
entityType: import("@activepieces/pieces-framework").
|
|
2
|
+
entityType: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
3
3
|
recordId: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
4
4
|
}>;
|
|
@@ -5,7 +5,6 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
6
|
const __1 = require("../../");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
|
-
const constants_1 = require("../common/constants");
|
|
9
8
|
exports.deleteRecordAction = (0, pieces_framework_1.createAction)({
|
|
10
9
|
auth: __1.dynamicsCRMAuth,
|
|
11
10
|
name: 'dynamics_crm_delete_record',
|
|
@@ -18,7 +17,7 @@ exports.deleteRecordAction = (0, pieces_framework_1.createAction)({
|
|
|
18
17
|
run(context) {
|
|
19
18
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
20
19
|
const { entityType, recordId } = context.propsValue;
|
|
21
|
-
const entityUrlPath =
|
|
20
|
+
const entityUrlPath = entityType;
|
|
22
21
|
const client = (0, common_1.makeClient)(context.auth);
|
|
23
22
|
return yield client.deleteRecord(entityUrlPath, recordId);
|
|
24
23
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-record.js","sourceRoot":"","sources":["../../../../../../../../packages/ee/pieces/microsoft-dynamics-crm/src/lib/actions/delete-record.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,8BAAyC;AACzC,sCAA0D;
|
|
1
|
+
{"version":3,"file":"delete-record.js","sourceRoot":"","sources":["../../../../../../../../packages/ee/pieces/microsoft-dynamics-crm/src/lib/actions/delete-record.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,8BAAyC;AACzC,sCAA0D;AAE7C,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,mBAAe;IACrB,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,6BAA6B;IAC1C,KAAK,EAAE;QACL,UAAU,EAAE,0BAAiB,CAAC,UAAU,CACtC,iEAAiE,CAClE;QACD,QAAQ,EAAE,0BAAiB,CAAC,QAAQ;KACrC;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEpD,MAAM,aAAa,GAAG,UAAoB,CAAC;YAE3C,MAAM,MAAM,GAAG,IAAA,mBAAU,EACvB,OAAO,CAAC,IAAoD,CAC7D,CAAC;YAEF,OAAO,MAAM,MAAM,CAAC,YAAY,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;QAC5D,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const getRecordAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
-
entityType: import("@activepieces/pieces-framework").
|
|
2
|
+
entityType: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
3
3
|
recordId: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
4
4
|
}>;
|
|
@@ -5,7 +5,6 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
6
|
const __1 = require("../../");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
|
-
const constants_1 = require("../common/constants");
|
|
9
8
|
exports.getRecordAction = (0, pieces_framework_1.createAction)({
|
|
10
9
|
auth: __1.dynamicsCRMAuth,
|
|
11
10
|
name: 'dynamics_crm_get_record',
|
|
@@ -18,7 +17,7 @@ exports.getRecordAction = (0, pieces_framework_1.createAction)({
|
|
|
18
17
|
run(context) {
|
|
19
18
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
20
19
|
const { entityType, recordId } = context.propsValue;
|
|
21
|
-
const entityUrlPath =
|
|
20
|
+
const entityUrlPath = entityType;
|
|
22
21
|
const client = (0, common_1.makeClient)(context.auth);
|
|
23
22
|
return yield client.getRecord(entityUrlPath, recordId);
|
|
24
23
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-record.js","sourceRoot":"","sources":["../../../../../../../../packages/ee/pieces/microsoft-dynamics-crm/src/lib/actions/get-record.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,8BAAyC;AACzC,sCAA0D;
|
|
1
|
+
{"version":3,"file":"get-record.js","sourceRoot":"","sources":["../../../../../../../../packages/ee/pieces/microsoft-dynamics-crm/src/lib/actions/get-record.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,8BAAyC;AACzC,sCAA0D;AAE7C,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,mBAAe;IACrB,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,+BAA+B;IAC5C,KAAK,EAAE;QACL,UAAU,EAAE,0BAAiB,CAAC,UAAU,CACtC,mEAAmE,CACpE;QACD,QAAQ,EAAE,0BAAiB,CAAC,QAAQ;KACrC;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEpD,MAAM,aAAa,GAAG,UAAoB,CAAC;YAE3C,MAAM,MAAM,GAAG,IAAA,mBAAU,EACvB,OAAO,CAAC,IAAoD,CAC7D,CAAC;YAEF,OAAO,MAAM,MAAM,CAAC,SAAS,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;QACzD,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const updateRecordAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
-
entityType: import("@activepieces/pieces-framework").
|
|
2
|
+
entityType: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
3
3
|
recordId: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
4
4
|
fields: import("@activepieces/pieces-framework").DynamicProperties<true>;
|
|
5
5
|
}>;
|
|
@@ -5,7 +5,6 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
6
|
const __1 = require("../../");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
|
-
const constants_1 = require("../common/constants");
|
|
9
8
|
exports.updateRecordAction = (0, pieces_framework_1.createAction)({
|
|
10
9
|
auth: __1.dynamicsCRMAuth,
|
|
11
10
|
name: 'dynamics_crm_update_record',
|
|
@@ -19,7 +18,7 @@ exports.updateRecordAction = (0, pieces_framework_1.createAction)({
|
|
|
19
18
|
run(context) {
|
|
20
19
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
21
20
|
const { entityType, recordId, fields } = context.propsValue;
|
|
22
|
-
const entityUrlPath =
|
|
21
|
+
const entityUrlPath = entityType;
|
|
23
22
|
const client = (0, common_1.makeClient)(context.auth);
|
|
24
23
|
return yield client.updatedRecord(entityUrlPath, recordId, fields);
|
|
25
24
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-record.js","sourceRoot":"","sources":["../../../../../../../../packages/ee/pieces/microsoft-dynamics-crm/src/lib/actions/update-record.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,8BAAyC;AACzC,sCAA0D;
|
|
1
|
+
{"version":3,"file":"update-record.js","sourceRoot":"","sources":["../../../../../../../../packages/ee/pieces/microsoft-dynamics-crm/src/lib/actions/update-record.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,8BAAyC;AACzC,sCAA0D;AAE7C,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,mBAAe;IACrB,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,6BAA6B;IAC1C,KAAK,EAAE;QACL,UAAU,EAAE,0BAAiB,CAAC,UAAU,CACtC,mEAAmE,CACpE;QACD,QAAQ,EAAE,0BAAiB,CAAC,QAAQ;QACpC,MAAM,EAAE,0BAAiB,CAAC,YAAY,CAAC,KAAK,CAAC;KAC9C;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAE5D,MAAM,aAAa,GAAG,UAAoB,CAAC;YAE3C,MAAM,MAAM,GAAG,IAAA,mBAAU,EACvB,OAAO,CAAC,IAAoD,CAC7D,CAAC;YAEF,OAAO,MAAM,MAAM,CAAC,aAAa,CAAC,aAAa,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QACrE,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { HttpHeaders, HttpMessageBody, HttpMethod, QueryParams } from '@activepieces/pieces-common';
|
|
2
2
|
import { EntityAttributeType } from './constants';
|
|
3
|
-
import { EntityAttributeResponse } from './types';
|
|
3
|
+
import { EntityAttributeResponse, EntityTypeAttributesResponse, EntityTypeResponse } from './types';
|
|
4
4
|
export declare class DynamicsCRMClient {
|
|
5
5
|
private hostUrl;
|
|
6
6
|
private accessToken;
|
|
7
|
-
|
|
7
|
+
private proxyUrl?;
|
|
8
|
+
constructor(hostUrl: string, accessToken: string, proxyUrl?: string | undefined);
|
|
8
9
|
makeRequest<T extends HttpMessageBody>(method: HttpMethod, resourceUri: string, headers?: HttpHeaders, query?: QueryParams, body?: any | undefined): Promise<T>;
|
|
9
10
|
createRecord(entityUrlPath: string, request: unknown): Promise<unknown>;
|
|
10
11
|
updatedRecord(entityUrlPath: string, recordId: string, request: unknown): Promise<unknown>;
|
|
11
12
|
getRecord(entityUrlPath: string, recordId: string): Promise<unknown>;
|
|
12
13
|
deleteRecord(entityUrlPath: string, recordId: string): Promise<unknown>;
|
|
14
|
+
fetchEntityTypes(): Promise<EntityTypeResponse>;
|
|
15
|
+
fetchEntityTypeAttributes(entitySetName: string): Promise<EntityTypeAttributesResponse>;
|
|
13
16
|
fetchEntityAttributes(entityName: string): Promise<EntityAttributeResponse>;
|
|
14
17
|
fetchOptionFieldValues(entityName: string, entityAttributeName: string, entityAttributeType: EntityAttributeType): Promise<{
|
|
15
18
|
label: string;
|
package/src/lib/common/client.js
CHANGED
|
@@ -3,14 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DynamicsCRMClient = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
+
const __1 = require("../..");
|
|
6
7
|
class DynamicsCRMClient {
|
|
7
|
-
constructor(hostUrl, accessToken) {
|
|
8
|
+
constructor(hostUrl, accessToken, proxyUrl) {
|
|
8
9
|
this.hostUrl = hostUrl;
|
|
9
10
|
this.accessToken = accessToken;
|
|
11
|
+
this.proxyUrl = proxyUrl;
|
|
10
12
|
}
|
|
11
|
-
makeRequest(
|
|
12
|
-
return tslib_1.__awaiter(this,
|
|
13
|
-
const baseUrl = this.hostUrl.replace(/\/$/, '');
|
|
13
|
+
makeRequest(method_1, resourceUri_1, headers_1, query_1) {
|
|
14
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* (method, resourceUri, headers, query, body = undefined) {
|
|
15
|
+
const baseUrl = (0, __1.getBaseUrl)(this.hostUrl.replace(/\/$/, ''), this.proxyUrl);
|
|
14
16
|
const res = yield pieces_common_1.httpClient.sendRequest({
|
|
15
17
|
method: method,
|
|
16
18
|
url: `${baseUrl}/api/data/v9.2` + resourceUri,
|
|
@@ -53,6 +55,26 @@ class DynamicsCRMClient {
|
|
|
53
55
|
return yield this.makeRequest(pieces_common_1.HttpMethod.DELETE, `/${entityUrlPath}(${recordId})`);
|
|
54
56
|
});
|
|
55
57
|
}
|
|
58
|
+
fetchEntityTypes() {
|
|
59
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
// fetch entity type data
|
|
61
|
+
return yield this.makeRequest(pieces_common_1.HttpMethod.GET, `/EntityDefinitions`, undefined, {
|
|
62
|
+
$select: ['EntitySetName', 'LogicalName'].join(','),
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
fetchEntityTypeAttributes(entitySetName) {
|
|
67
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
return yield this.makeRequest(pieces_common_1.HttpMethod.GET, `/EntityDefinitions`, undefined, {
|
|
69
|
+
$select: [
|
|
70
|
+
'PrimaryIdAttribute',
|
|
71
|
+
'PrimaryNameAttribute',
|
|
72
|
+
'LogicalName',
|
|
73
|
+
].join(','),
|
|
74
|
+
$filter: `EntitySetName eq '${entitySetName}'`,
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
}
|
|
56
78
|
fetchEntityAttributes(entityName) {
|
|
57
79
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
58
80
|
// fetch entity attribute data
|
|
@@ -70,8 +92,8 @@ class DynamicsCRMClient {
|
|
|
70
92
|
});
|
|
71
93
|
}
|
|
72
94
|
fetchOptionFieldValues(entityName, entityAttributeName, entityAttributeType) {
|
|
73
|
-
var _a, _b;
|
|
74
95
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
96
|
+
var _a, _b;
|
|
75
97
|
const res = yield this.makeRequest(pieces_common_1.HttpMethod.GET, `/EntityDefinitions(LogicalName='${entityName}')/Attributes(LogicalName='${entityAttributeName}')/Microsoft.Dynamics.CRM.${entityAttributeType}AttributeMetadata`, undefined, {
|
|
76
98
|
$select: 'LogicalName',
|
|
77
99
|
$expand: 'OptionSet($select=Options),GlobalOptionSet($select=Options)',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../../../../packages/ee/pieces/microsoft-dynamics-crm/src/lib/common/client.ts"],"names":[],"mappings":";;;;AAAA,+DAOqC;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../../../../packages/ee/pieces/microsoft-dynamics-crm/src/lib/common/client.ts"],"names":[],"mappings":";;;;AAAA,+DAOqC;AAQrC,6BAAmC;AAEnC,MAAa,iBAAiB;IAC5B,YACU,OAAe,EACf,WAAmB,EACnB,QAAiB;QAFjB,YAAO,GAAP,OAAO,CAAQ;QACf,gBAAW,GAAX,WAAW,CAAQ;QACnB,aAAQ,GAAR,QAAQ,CAAS;IACxB,CAAC;IACE,WAAW;qEACf,MAAkB,EAClB,WAAmB,EACnB,OAAqB,EACrB,KAAmB,EACnB,OAAwB,SAAS;YAEjC,MAAM,OAAO,GAAG,IAAA,cAAU,EAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC3E,MAAM,GAAG,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAI;gBAC1C,MAAM,EAAE,MAAM;gBACd,GAAG,EAAE,GAAG,OAAO,gBAAgB,GAAG,WAAW;gBAC7C,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,IAAI,CAAC,WAAW;iBACxB;gBACD,OAAO,kBACL,MAAM,EAAE,kBAAkB,EAC1B,kBAAkB,EAAE,KAAK,EACzB,eAAe,EAAE,KAAK,EACtB,cAAc,EAAE,kBAAkB,IAC/B,OAAO,CACX;gBACD,WAAW,EAAE,KAAK;gBAClB,IAAI,EAAE,IAAI;aACX,CAAC,CAAC;YACH,OAAO,GAAG,CAAC,IAAI,CAAC;QAClB,CAAC;KAAA;IAEK,YAAY,CAAC,aAAqB,EAAE,OAAgB;;YACxD,OAAO,MAAM,IAAI,CAAC,WAAW,CAC3B,0BAAU,CAAC,IAAI,EACf,IAAI,aAAa,EAAE,EACnB;gBACE,kCAAkC;gBAClC,0IAA0I;gBAC1I,MAAM,EAAE,uBAAuB;aACh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A8B;YAC9B,gJAAgJ;YAChJ,OAAO,MAAM,IAAI,CAAC,WAAW,CAC3B,0BAAU,CAAC,GAAG,EACd,mCAAmC,UAAU,eAAe,EAC5D,SAAS,EACT;gBACE,OAAO,EAAE;oBACP,eAAe;oBACf,aAAa;oBACb,aAAa;oBACb,aAAa;oBACb,eAAe;oBACf,kBAAkB;iBACnB,CAAC,IAAI,CAAC,GAAG,CAAC;aACZ,CACF,CAAC;QACJ,CAAC;KAAA;IAEK,sBAAsB,CAC1B,UAAkB,EAClB,mBAA2B,EAC3B,mBAAwC;;;YAExC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,WAAW,CAChC,0BAAU,CAAC,GAAG,EACd,mCAAmC,UAAU,8BAA8B,mBAAmB,6BAA6B,mBAAmB,mBAAmB,EACjK,SAAS,EACT;gBACE,OAAO,EAAE,aAAa;gBACtB,OAAO,EAAE,6DAA6D;aACvE,CACF,CAAC;YACF,MAAM,SAAS,GAAG,MAAA,GAAG,CAAC,SAAS,mCAAI,GAAG,CAAC,eAAe,CAAC;YACvD,MAAM,OAAO,GACX,CAAA,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,OAAO,0CAAE,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;;gBAAC,OAAA,CAAC;oBAC7C,KAAK,EAAE,KAAK;oBACZ,KAAK,EAAE,MAAA,KAAK,CAAC,kBAAkB,CAAC,KAAK,mCAAI,MAAM,CAAC,KAAK,CAAC;iBACvD,CAAC,CAAA;aAAA,CAAC,KAAI,EAAE,CAAC;YACZ,OAAO,OAAO,CAAC;QACjB,CAAC;KAAA;CACF;AAvJD,8CAuJC"}
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
export declare const EntityDetails: {
|
|
2
|
-
[key: string]: {
|
|
3
|
-
displayName: string;
|
|
4
|
-
value: string;
|
|
5
|
-
urlPath: string;
|
|
6
|
-
primaryKey: string;
|
|
7
|
-
primaryNameAttribute: string;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
1
|
export declare enum EntityAttributeType {
|
|
11
2
|
PICKLIST = "Picklist",
|
|
12
3
|
VIRTUAL = "Virtual",
|
|
@@ -1,240 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// docs: https://learn.microsoft.com/en-us/previous-versions/dynamicscrm-2016/developers-guide/mt608066(v=crm.8)
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.EntityAttributeType =
|
|
5
|
-
exports.EntityDetails = {
|
|
6
|
-
account: {
|
|
7
|
-
displayName: 'Account',
|
|
8
|
-
value: 'account',
|
|
9
|
-
urlPath: 'accounts',
|
|
10
|
-
primaryKey: 'accountid',
|
|
11
|
-
primaryNameAttribute: 'name',
|
|
12
|
-
},
|
|
13
|
-
actioncard: {
|
|
14
|
-
displayName: 'Action Card',
|
|
15
|
-
value: 'actioncard',
|
|
16
|
-
urlPath: 'actioncards',
|
|
17
|
-
primaryKey: 'actioncardid',
|
|
18
|
-
primaryNameAttribute: 'title',
|
|
19
|
-
},
|
|
20
|
-
actioncarduserstate: {
|
|
21
|
-
displayName: 'ActionCardUserState',
|
|
22
|
-
value: 'actioncarduserstate',
|
|
23
|
-
urlPath: 'actioncarduserstates',
|
|
24
|
-
primaryKey: 'actioncarduserstateid',
|
|
25
|
-
primaryNameAttribute: 'actioncarduserstateid',
|
|
26
|
-
},
|
|
27
|
-
calendar: {
|
|
28
|
-
displayName: 'Calendar',
|
|
29
|
-
value: 'calendar',
|
|
30
|
-
urlPath: 'calendars',
|
|
31
|
-
primaryKey: 'calendarid',
|
|
32
|
-
primaryNameAttribute: 'name',
|
|
33
|
-
},
|
|
34
|
-
contact: {
|
|
35
|
-
displayName: 'Contact',
|
|
36
|
-
value: 'contact',
|
|
37
|
-
urlPath: 'contacts',
|
|
38
|
-
primaryKey: 'contractid',
|
|
39
|
-
primaryNameAttribute: 'fullname',
|
|
40
|
-
},
|
|
41
|
-
campaign: {
|
|
42
|
-
displayName: 'Campaign',
|
|
43
|
-
value: 'campaign',
|
|
44
|
-
urlPath: 'campaigns',
|
|
45
|
-
primaryKey: 'campaignid',
|
|
46
|
-
primaryNameAttribute: 'name',
|
|
47
|
-
},
|
|
48
|
-
campaignactivity: {
|
|
49
|
-
displayName: 'Campaign Activity',
|
|
50
|
-
value: 'campaignactivity',
|
|
51
|
-
urlPath: 'campaignactivities',
|
|
52
|
-
primaryKey: 'activityid',
|
|
53
|
-
primaryNameAttribute: 'subject',
|
|
54
|
-
},
|
|
55
|
-
campaignactivityitem: {
|
|
56
|
-
displayName: 'Campaign Activity Item',
|
|
57
|
-
value: 'campaignactivityitem',
|
|
58
|
-
urlPath: 'campaignactivityitems',
|
|
59
|
-
primaryKey: 'campaignactivityitemid',
|
|
60
|
-
primaryNameAttribute: 'campaignactivityitemid ',
|
|
61
|
-
},
|
|
62
|
-
campaignitem: {
|
|
63
|
-
displayName: 'Campaign Item',
|
|
64
|
-
value: 'campaignitem',
|
|
65
|
-
urlPath: 'campaignitems',
|
|
66
|
-
primaryKey: 'campaignitemid',
|
|
67
|
-
primaryNameAttribute: 'campaignitemid',
|
|
68
|
-
},
|
|
69
|
-
campaignresponse: {
|
|
70
|
-
displayName: 'Campaign Response',
|
|
71
|
-
value: 'campaignresponse',
|
|
72
|
-
urlPath: 'campaignresponses',
|
|
73
|
-
primaryKey: 'activityid',
|
|
74
|
-
primaryNameAttribute: 'subject',
|
|
75
|
-
},
|
|
76
|
-
category: {
|
|
77
|
-
displayName: 'Category',
|
|
78
|
-
value: 'category',
|
|
79
|
-
urlPath: 'categories',
|
|
80
|
-
primaryKey: 'categoryid',
|
|
81
|
-
primaryNameAttribute: 'title',
|
|
82
|
-
},
|
|
83
|
-
characteristic: {
|
|
84
|
-
displayName: 'Characteristic',
|
|
85
|
-
value: 'characteristic',
|
|
86
|
-
urlPath: 'characteristics',
|
|
87
|
-
primaryKey: 'characteristicid',
|
|
88
|
-
primaryNameAttribute: 'name',
|
|
89
|
-
},
|
|
90
|
-
goal: {
|
|
91
|
-
displayName: 'Goal',
|
|
92
|
-
value: 'goal',
|
|
93
|
-
urlPath: 'goals',
|
|
94
|
-
primaryKey: 'goalid',
|
|
95
|
-
primaryNameAttribute: 'title',
|
|
96
|
-
},
|
|
97
|
-
lead: {
|
|
98
|
-
displayName: 'Lead',
|
|
99
|
-
value: 'lead',
|
|
100
|
-
urlPath: 'leads',
|
|
101
|
-
primaryKey: 'leadid',
|
|
102
|
-
primaryNameAttribute: 'fullname',
|
|
103
|
-
},
|
|
104
|
-
incident: {
|
|
105
|
-
displayName: 'Case / Incident',
|
|
106
|
-
value: 'incident',
|
|
107
|
-
urlPath: 'incidents',
|
|
108
|
-
primaryKey: 'incidentid',
|
|
109
|
-
primaryNameAttribute: 'title',
|
|
110
|
-
},
|
|
111
|
-
invoice: {
|
|
112
|
-
displayName: 'Invoice',
|
|
113
|
-
value: 'invoice',
|
|
114
|
-
urlPath: 'invoices',
|
|
115
|
-
primaryKey: 'invoiceid',
|
|
116
|
-
primaryNameAttribute: 'name',
|
|
117
|
-
},
|
|
118
|
-
invoicedetail: {
|
|
119
|
-
displayName: 'Invoice Product',
|
|
120
|
-
value: 'invoicedetail',
|
|
121
|
-
urlPath: 'invoicedetails',
|
|
122
|
-
primaryKey: 'invoicedetailid',
|
|
123
|
-
primaryNameAttribute: 'productidname',
|
|
124
|
-
},
|
|
125
|
-
kbarticle: {
|
|
126
|
-
displayName: 'Article',
|
|
127
|
-
value: 'kbarticle',
|
|
128
|
-
urlPath: 'kbarticles',
|
|
129
|
-
primaryKey: 'kbarticleid',
|
|
130
|
-
primaryNameAttribute: 'title',
|
|
131
|
-
},
|
|
132
|
-
kbarticlecomment: {
|
|
133
|
-
displayName: 'Article Comment',
|
|
134
|
-
value: 'kbarticlecomment',
|
|
135
|
-
urlPath: 'kbarticlecomments',
|
|
136
|
-
primaryKey: 'kbarticlecommentid',
|
|
137
|
-
primaryNameAttribute: 'title',
|
|
138
|
-
},
|
|
139
|
-
list: {
|
|
140
|
-
displayName: 'Marketing List',
|
|
141
|
-
value: 'list',
|
|
142
|
-
urlPath: 'lists',
|
|
143
|
-
primaryKey: 'listid',
|
|
144
|
-
primaryNameAttribute: 'listname',
|
|
145
|
-
},
|
|
146
|
-
listmember: {
|
|
147
|
-
displayName: 'Marketing List Member',
|
|
148
|
-
value: 'listmember',
|
|
149
|
-
urlPath: 'listmembers',
|
|
150
|
-
primaryKey: 'listmemberid',
|
|
151
|
-
primaryNameAttribute: 'listmemberid',
|
|
152
|
-
},
|
|
153
|
-
feedback: {
|
|
154
|
-
displayName: 'Feedback',
|
|
155
|
-
value: 'feedback',
|
|
156
|
-
urlPath: 'feedback',
|
|
157
|
-
primaryKey: 'feedbackid',
|
|
158
|
-
primaryNameAttribute: 'title',
|
|
159
|
-
},
|
|
160
|
-
opportunity: {
|
|
161
|
-
displayName: 'Opportunity',
|
|
162
|
-
value: 'opportunity',
|
|
163
|
-
urlPath: 'opportunities',
|
|
164
|
-
primaryKey: 'opportunityid',
|
|
165
|
-
primaryNameAttribute: 'name',
|
|
166
|
-
},
|
|
167
|
-
organization: {
|
|
168
|
-
displayName: 'Organization',
|
|
169
|
-
value: 'organization',
|
|
170
|
-
urlPath: 'organizations',
|
|
171
|
-
primaryKey: 'organizationid',
|
|
172
|
-
primaryNameAttribute: 'name',
|
|
173
|
-
},
|
|
174
|
-
post: {
|
|
175
|
-
displayName: 'Post',
|
|
176
|
-
value: 'post',
|
|
177
|
-
urlPath: 'posts',
|
|
178
|
-
primaryKey: 'postid',
|
|
179
|
-
primaryNameAttribute: 'text',
|
|
180
|
-
},
|
|
181
|
-
postcomment: {
|
|
182
|
-
displayName: 'Post Comment',
|
|
183
|
-
value: 'postcomment',
|
|
184
|
-
urlPath: 'postcomments',
|
|
185
|
-
primaryKey: 'postcommentid',
|
|
186
|
-
primaryNameAttribute: 'text',
|
|
187
|
-
},
|
|
188
|
-
product: {
|
|
189
|
-
displayName: 'Product',
|
|
190
|
-
value: 'product',
|
|
191
|
-
urlPath: 'products',
|
|
192
|
-
primaryKey: 'productid',
|
|
193
|
-
primaryNameAttribute: 'name',
|
|
194
|
-
},
|
|
195
|
-
publisher: {
|
|
196
|
-
displayName: 'Publisher',
|
|
197
|
-
value: 'publisher',
|
|
198
|
-
urlPath: 'publishers',
|
|
199
|
-
primaryKey: 'publisherid',
|
|
200
|
-
primaryNameAttribute: 'friendlyname',
|
|
201
|
-
},
|
|
202
|
-
quote: {
|
|
203
|
-
displayName: 'Quote',
|
|
204
|
-
value: 'quote',
|
|
205
|
-
urlPath: 'quotes',
|
|
206
|
-
primaryKey: 'quoteid',
|
|
207
|
-
primaryNameAttribute: 'name',
|
|
208
|
-
},
|
|
209
|
-
quotedetail: {
|
|
210
|
-
displayName: 'Quote Product',
|
|
211
|
-
value: 'quotedetail',
|
|
212
|
-
urlPath: 'quotedetails',
|
|
213
|
-
primaryKey: 'quotedetailid',
|
|
214
|
-
primaryNameAttribute: 'productidname',
|
|
215
|
-
},
|
|
216
|
-
salesorder: {
|
|
217
|
-
displayName: 'Order',
|
|
218
|
-
value: 'salesorder',
|
|
219
|
-
urlPath: 'salesorders',
|
|
220
|
-
primaryKey: 'salesorderid',
|
|
221
|
-
primaryNameAttribute: 'name',
|
|
222
|
-
},
|
|
223
|
-
salesorderdetail: {
|
|
224
|
-
displayName: 'Order Product',
|
|
225
|
-
value: 'salesorderdetail',
|
|
226
|
-
urlPath: 'salesorderdetails',
|
|
227
|
-
primaryKey: 'salesorderdetailid',
|
|
228
|
-
primaryNameAttribute: 'productidname',
|
|
229
|
-
},
|
|
230
|
-
task: {
|
|
231
|
-
displayName: 'Task',
|
|
232
|
-
value: 'task',
|
|
233
|
-
urlPath: 'tasks',
|
|
234
|
-
primaryKey: 'activityid',
|
|
235
|
-
primaryNameAttribute: 'subject',
|
|
236
|
-
},
|
|
237
|
-
};
|
|
4
|
+
exports.EntityAttributeType = void 0;
|
|
238
5
|
var EntityAttributeType;
|
|
239
6
|
(function (EntityAttributeType) {
|
|
240
7
|
EntityAttributeType["PICKLIST"] = "Picklist";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../../packages/ee/pieces/microsoft-dynamics-crm/src/lib/common/constants.ts"],"names":[],"mappings":";AAAA,gHAAgH;;;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../../packages/ee/pieces/microsoft-dynamics-crm/src/lib/common/constants.ts"],"names":[],"mappings":";AAAA,gHAAgH;;;AAEhH,IAAY,mBAkBX;AAlBD,WAAY,mBAAmB;IAC7B,4CAAqB,CAAA;IACrB,0CAAmB,CAAA;IACnB,6DAAsC,CAAA;IACtC,wCAAiB,CAAA;IACjB,oCAAa,CAAA;IACb,sCAAe,CAAA;IACf,wCAAiB,CAAA;IACjB,0CAAmB,CAAA;IACnB,wCAAiB,CAAA;IACjB,4CAAqB,CAAA;IACrB,0CAAmB,CAAA;IACnB,wCAAiB,CAAA;IACjB,0CAAmB,CAAA;IACnB,sCAAe,CAAA;IACf,iDAA0B,CAAA;IAC1B,sCAAe,CAAA;IACf,wCAAiB,CAAA;AACnB,CAAC,EAlBW,mBAAmB,mCAAnB,mBAAmB,QAkB9B"}
|
|
@@ -3,7 +3,7 @@ import { dynamicsCRMAuth } from '../../';
|
|
|
3
3
|
import { DynamicsCRMClient } from './client';
|
|
4
4
|
export declare function makeClient(auth: PiecePropValueSchema<typeof dynamicsCRMAuth>): DynamicsCRMClient;
|
|
5
5
|
export declare const DynamicsCRMCommon: {
|
|
6
|
-
entityType: (description: string) => import("@activepieces/pieces-framework").
|
|
6
|
+
entityType: (description: string) => import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
7
7
|
recordId: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
8
8
|
entityFields: (isCreate?: boolean) => import("@activepieces/pieces-framework").DynamicProperties<true>;
|
|
9
9
|
};
|
package/src/lib/common/index.js
CHANGED
|
@@ -4,35 +4,48 @@ exports.DynamicsCRMCommon = exports.makeClient = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
6
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const __1 = require("../../");
|
|
7
8
|
const client_1 = require("./client");
|
|
8
9
|
const constants_1 = require("./constants");
|
|
9
10
|
function makeClient(auth) {
|
|
10
|
-
var _a;
|
|
11
|
-
const client = new client_1.DynamicsCRMClient((_a = auth.props) === null || _a === void 0 ? void 0 : _a['hostUrl'], auth.access_token);
|
|
11
|
+
var _a, _b;
|
|
12
|
+
const client = new client_1.DynamicsCRMClient((_a = auth.props) === null || _a === void 0 ? void 0 : _a['hostUrl'], auth.access_token, (_b = auth.props) === null || _b === void 0 ? void 0 : _b['proxyUrl']);
|
|
12
13
|
return client;
|
|
13
14
|
}
|
|
14
15
|
exports.makeClient = makeClient;
|
|
15
16
|
exports.DynamicsCRMCommon = {
|
|
16
|
-
entityType: (description) => pieces_framework_1.Property.
|
|
17
|
+
entityType: (description) => pieces_framework_1.Property.Dropdown({
|
|
17
18
|
displayName: 'Entity Type',
|
|
19
|
+
refreshers: [],
|
|
18
20
|
description,
|
|
19
21
|
required: true,
|
|
20
|
-
options: {
|
|
21
|
-
|
|
22
|
-
options: Object.keys(constants_1.EntityDetails).map((key) => {
|
|
22
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
23
|
+
if (!auth) {
|
|
23
24
|
return {
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
disabled: true,
|
|
26
|
+
options: [],
|
|
27
|
+
placeholder: '',
|
|
26
28
|
};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
+
}
|
|
30
|
+
const client = makeClient(auth);
|
|
31
|
+
const res = yield client.fetchEntityTypes();
|
|
32
|
+
return {
|
|
33
|
+
disabled: false,
|
|
34
|
+
options: res.value.map((val) => {
|
|
35
|
+
return {
|
|
36
|
+
label: val.EntitySetName,
|
|
37
|
+
value: val.EntitySetName,
|
|
38
|
+
};
|
|
39
|
+
}),
|
|
40
|
+
};
|
|
41
|
+
}),
|
|
29
42
|
}),
|
|
30
43
|
recordId: pieces_framework_1.Property.Dropdown({
|
|
31
44
|
displayName: 'Record ID',
|
|
32
45
|
refreshers: ['entityType'],
|
|
33
46
|
required: true,
|
|
34
|
-
options: (
|
|
35
|
-
var
|
|
47
|
+
options: (_b) => tslib_1.__awaiter(void 0, [_b], void 0, function* ({ auth, entityType }) {
|
|
48
|
+
var _c, _d;
|
|
36
49
|
if (!auth || !entityType) {
|
|
37
50
|
return {
|
|
38
51
|
disabled: true,
|
|
@@ -40,13 +53,22 @@ exports.DynamicsCRMCommon = {
|
|
|
40
53
|
placeholder: 'Please select entity type first.',
|
|
41
54
|
};
|
|
42
55
|
}
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
|
|
56
|
+
const client = makeClient(auth);
|
|
57
|
+
const res = yield client.fetchEntityTypeAttributes(entityType);
|
|
58
|
+
if (!res.value[0]) {
|
|
59
|
+
return {
|
|
60
|
+
disabled: true,
|
|
61
|
+
options: [],
|
|
62
|
+
placeholder: 'Please select entity type first.',
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
const entityUrlPath = entityType;
|
|
66
|
+
const entityPrimaryKey = res.value[0].PrimaryIdAttribute;
|
|
67
|
+
const entityprimaryNameAttribute = res.value[0].PrimaryNameAttribute;
|
|
46
68
|
const authValue = auth;
|
|
47
69
|
const request = {
|
|
48
70
|
method: pieces_common_1.HttpMethod.GET,
|
|
49
|
-
url: `${(
|
|
71
|
+
url: `${(0, __1.getBaseUrl)((_c = authValue.props) === null || _c === void 0 ? void 0 : _c['hostUrl'], (_d = authValue.props) === null || _d === void 0 ? void 0 : _d['proxyUrl'])}/api/data/v9.2/${entityUrlPath}`,
|
|
50
72
|
queryParams: {
|
|
51
73
|
$select: entityprimaryNameAttribute,
|
|
52
74
|
},
|
|
@@ -78,15 +100,23 @@ exports.DynamicsCRMCommon = {
|
|
|
78
100
|
displayName: 'Entity Fields',
|
|
79
101
|
refreshers: ['auth', 'entityType'],
|
|
80
102
|
required: true,
|
|
81
|
-
props: (
|
|
82
|
-
var
|
|
103
|
+
props: (_e) => tslib_1.__awaiter(void 0, [_e], void 0, function* ({ auth, entityType }) {
|
|
104
|
+
var _f, _g, _h, _j, _k, _l;
|
|
83
105
|
if (!auth)
|
|
84
106
|
return {};
|
|
85
107
|
if (!entityType)
|
|
86
108
|
return {};
|
|
87
109
|
const fields = {};
|
|
88
110
|
const client = makeClient(auth);
|
|
89
|
-
const
|
|
111
|
+
const typeRes = yield client.fetchEntityTypeAttributes(entityType);
|
|
112
|
+
if (!typeRes.value[0]) {
|
|
113
|
+
return {
|
|
114
|
+
disabled: true,
|
|
115
|
+
options: [],
|
|
116
|
+
placeholder: 'Please select entity type first.',
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
const res = yield client.fetchEntityAttributes(typeRes.value[0].LogicalName);
|
|
90
120
|
for (const field of res.value) {
|
|
91
121
|
if (field.IsValidForCreate &&
|
|
92
122
|
![
|
|
@@ -99,8 +129,8 @@ exports.DynamicsCRMCommon = {
|
|
|
99
129
|
constants_1.EntityAttributeType.UNIQUE_IDENTIFIER,
|
|
100
130
|
].includes(field.AttributeType)) {
|
|
101
131
|
const params = {
|
|
102
|
-
displayName: (
|
|
103
|
-
description: (
|
|
132
|
+
displayName: (_h = (_g = (_f = field.DisplayName) === null || _f === void 0 ? void 0 : _f.UserLocalizedLabel) === null || _g === void 0 ? void 0 : _g.Label) !== null && _h !== void 0 ? _h : field.LogicalName,
|
|
133
|
+
description: (_l = (_k = (_j = field.Description) === null || _j === void 0 ? void 0 : _j.UserLocalizedLabel) === null || _k === void 0 ? void 0 : _k.Label) !== null && _l !== void 0 ? _l : '',
|
|
104
134
|
required: field.IsPrimaryName && isCreate,
|
|
105
135
|
};
|
|
106
136
|
switch (field.AttributeType) {
|
|
@@ -122,7 +152,7 @@ exports.DynamicsCRMCommon = {
|
|
|
122
152
|
case constants_1.EntityAttributeType.PICKLIST:
|
|
123
153
|
case constants_1.EntityAttributeType.STATE:
|
|
124
154
|
case constants_1.EntityAttributeType.STATUS: {
|
|
125
|
-
const options = yield client.fetchOptionFieldValues(
|
|
155
|
+
const options = yield client.fetchOptionFieldValues(typeRes.value[0].LogicalName, field.LogicalName, field.AttributeType);
|
|
126
156
|
fields[field.LogicalName] = pieces_framework_1.Property.StaticDropdown(Object.assign(Object.assign({}, params), { options: {
|
|
127
157
|
disabled: false,
|
|
128
158
|
options: options,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/ee/pieces/microsoft-dynamics-crm/src/lib/common/index.ts"],"names":[],"mappings":";;;;AAAA,+DAKqC;AACrC,qEAIwC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/ee/pieces/microsoft-dynamics-crm/src/lib/common/index.ts"],"names":[],"mappings":";;;;AAAA,+DAKqC;AACrC,qEAIwC;AACxC,8BAAqD;AACrD,qCAA6C;AAC7C,2CAAkD;AAElD,SAAgB,UAAU,CAAC,IAAkD;;IAC3E,MAAM,MAAM,GAAG,IAAI,0BAAiB,CAClC,MAAA,IAAI,CAAC,KAAK,0CAAG,SAAS,CAAC,EACvB,IAAI,CAAC,YAAY,EACjB,MAAA,IAAI,CAAC,KAAK,0CAAG,UAAU,CAAC,CACzB,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC;AAPD,gCAOC;AAEY,QAAA,iBAAiB,GAAG;IAC/B,UAAU,EAAE,CAAC,WAAmB,EAAE,EAAE,CAClC,2BAAQ,CAAC,QAAQ,CAAC;QAChB,WAAW,EAAE,aAAa;QAC1B,UAAU,EAAE,EAAE;QACd,WAAW;QACX,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,KAAiB,E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,WAAW,EACjB,KAAK,CAAC,aAAa,CACpB,CAAC;4BACF,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,2BAAQ,CAAC,cAAc,iCAC9C,MAAM,KACT,OAAO,EAAE;oCACP,QAAQ,EAAE,KAAK;oCACf,OAAO,EAAE,OAAO;iCACjB,IACD,CAAC;4BACH,MAAM;wBACR,CAAC;wBACD;4BACE,MAAM;oBACV,CAAC;gBACH,CAAC;YACH,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC,CAAA;KACF,CAAC;CACL,CAAC"}
|
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
import { EntityAttributeType } from './constants';
|
|
2
|
+
export type EntityTypeResponse = {
|
|
3
|
+
'@odata.context': string;
|
|
4
|
+
value: {
|
|
5
|
+
'@odata.type': string;
|
|
6
|
+
LogicalName: string;
|
|
7
|
+
EntitySetName: string;
|
|
8
|
+
}[];
|
|
9
|
+
};
|
|
10
|
+
export type EntityTypeAttributesResponse = {
|
|
11
|
+
'@odata.context': string;
|
|
12
|
+
value: {
|
|
13
|
+
'@odata.type': string;
|
|
14
|
+
PrimaryIdAttribute: string;
|
|
15
|
+
PrimaryNameAttribute: string;
|
|
16
|
+
LogicalName: string;
|
|
17
|
+
}[];
|
|
18
|
+
};
|
|
2
19
|
export type EntityAttributeResponse = {
|
|
3
20
|
'@odata.context': string;
|
|
4
21
|
value: {
|