@activepieces/piece-microsoft-dynamics-crm 0.2.4 → 0.2.5
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/package.json +9 -23
- package/src/index.d.ts +0 -1
- package/src/index.js +6 -53
- package/src/index.js.map +1 -1
- package/src/lib/actions/create-record.js +2 -2
- package/src/lib/actions/create-record.js.map +1 -1
- package/src/lib/actions/delete-record.js +2 -2
- package/src/lib/actions/delete-record.js.map +1 -1
- package/src/lib/actions/get-record.js +2 -2
- package/src/lib/actions/get-record.js.map +1 -1
- package/src/lib/actions/update-record.js +2 -2
- package/src/lib/actions/update-record.js.map +1 -1
- package/src/lib/auth.d.ts +1 -0
- package/src/lib/auth.js +34 -0
- package/src/lib/auth.js.map +1 -0
- package/src/lib/common/index.d.ts +1 -1
- package/src/lib/common/index.js +4 -3
- package/src/lib/common/index.js.map +1 -1
- package/README.md +0 -1
package/package.json
CHANGED
|
@@ -1,27 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-microsoft-dynamics-crm",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"axios": "1.13.5",
|
|
8
|
-
"axios-retry": "4.4.1",
|
|
9
|
-
"deepmerge-ts": "7.1.0",
|
|
10
|
-
"form-data": "4.0.4",
|
|
11
|
-
"mime-types": "2.1.35",
|
|
12
|
-
"nanoid": "3.3.8",
|
|
13
|
-
"semver": "7.6.0",
|
|
14
|
-
"socket.io-client": "4.8.1",
|
|
15
|
-
"zod": "4.1.13",
|
|
16
|
-
"@activepieces/pieces-common": "0.11.6",
|
|
17
|
-
"@activepieces/pieces-framework": "0.25.4",
|
|
18
|
-
"@activepieces/shared": "0.37.0",
|
|
19
|
-
"tslib": "2.6.2"
|
|
20
|
-
},
|
|
21
|
-
"resolutions": {
|
|
22
|
-
"rollup": "npm:@rollup/wasm-node"
|
|
3
|
+
"version": "0.2.5",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"build": "tsc -p tsconfig.lib.json",
|
|
6
|
+
"lint": "eslint 'src/**/*.ts'"
|
|
23
7
|
},
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@activepieces/pieces-common": "workspace:*",
|
|
10
|
+
"@activepieces/pieces-framework": "workspace:*",
|
|
11
|
+
"@activepieces/shared": "workspace:*"
|
|
12
|
+
}
|
|
27
13
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export declare const dynamicsCRMAuth: import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>;
|
|
2
1
|
export declare function getBaseUrl(host: string, proxyUrl?: string): string;
|
|
3
2
|
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,63 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.microsoftDynamicsCrm =
|
|
3
|
+
exports.microsoftDynamicsCrm = void 0;
|
|
4
4
|
exports.getBaseUrl = getBaseUrl;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
7
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
8
|
+
const shared_1 = require("@activepieces/shared");
|
|
8
9
|
const create_record_1 = require("./lib/actions/create-record");
|
|
9
10
|
const delete_record_1 = require("./lib/actions/delete-record");
|
|
10
11
|
const get_record_1 = require("./lib/actions/get-record");
|
|
11
12
|
const update_record_1 = require("./lib/actions/update-record");
|
|
12
|
-
const
|
|
13
|
-
const authDesc = `
|
|
14
|
-
1. Sign in to [Microsoft Azure Portal](https://portal.azure.com/).
|
|
15
|
-
2. From the left sidebar, go to **Microsoft Enfra ID**.
|
|
16
|
-
3. Under **Manage**, click on **App registrations**.
|
|
17
|
-
4. Click the **New registration** button.
|
|
18
|
-
5. Enter a **Name** for your app.
|
|
19
|
-
6. For **Supported account types**, choose:
|
|
20
|
-
- **Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts**
|
|
21
|
-
- Or select based on your requirement.
|
|
22
|
-
7. In **Redirect URI**, select **Web** and add the given URL.
|
|
23
|
-
8. Click **Register**.
|
|
24
|
-
9. After registration, you’ll be redirected to the app’s overview page. Copy the **Application (client) ID**.
|
|
25
|
-
10. From the left menu, go to **Certificates & secrets**.
|
|
26
|
-
- Under **Client secrets**, click **New client secret**.
|
|
27
|
-
- Provide a description, set an expiry, and click **Add**.
|
|
28
|
-
- Copy the **Value** of the client secret (this will not be shown again).
|
|
29
|
-
11. Go to **API permissions** from the left menu.
|
|
30
|
-
- Click **Add a permission**.
|
|
31
|
-
- Select **Dynamics CRM** → **Delegated permissions**.
|
|
32
|
-
- Click **Add permissions**.
|
|
33
|
-
12. Copy your **Client ID** and **Client Secret**.
|
|
34
|
-
`;
|
|
35
|
-
exports.dynamicsCRMAuth = pieces_framework_1.PieceAuth.OAuth2({
|
|
36
|
-
description: authDesc,
|
|
37
|
-
props: {
|
|
38
|
-
hostUrl: pieces_framework_1.Property.ShortText({
|
|
39
|
-
displayName: 'Host URL (without trailing slash)',
|
|
40
|
-
description: 'Host URL without trailing slash.For example **https://demo.crm.dynamics.com**',
|
|
41
|
-
required: true,
|
|
42
|
-
}),
|
|
43
|
-
tenantId: pieces_framework_1.Property.ShortText({
|
|
44
|
-
displayName: 'Tenant ID',
|
|
45
|
-
description: 'You can find this in the Azure portal.',
|
|
46
|
-
defaultValue: 'common',
|
|
47
|
-
required: true,
|
|
48
|
-
}),
|
|
49
|
-
proxyUrl: pieces_framework_1.Property.ShortText({
|
|
50
|
-
displayName: 'Proxy URL with Port',
|
|
51
|
-
description: 'Keep empty if not needed. Optional proxy URL used for establishing connections when proxying requests is needed. For example: **https://proxy.com:8080**.',
|
|
52
|
-
required: false,
|
|
53
|
-
}),
|
|
54
|
-
},
|
|
55
|
-
required: true,
|
|
56
|
-
scope: ['{hostUrl}/.default', 'openid', 'email', 'profile', 'offline_access'],
|
|
57
|
-
prompt: 'omit',
|
|
58
|
-
authUrl: 'https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/authorize',
|
|
59
|
-
tokenUrl: 'https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token',
|
|
60
|
-
});
|
|
13
|
+
const auth_1 = require("./lib/auth");
|
|
61
14
|
function getBaseUrl(host, proxyUrl) {
|
|
62
15
|
if (proxyUrl && proxyUrl !== '') {
|
|
63
16
|
return proxyUrl;
|
|
@@ -66,7 +19,7 @@ function getBaseUrl(host, proxyUrl) {
|
|
|
66
19
|
}
|
|
67
20
|
exports.microsoftDynamicsCrm = (0, pieces_framework_1.createPiece)({
|
|
68
21
|
displayName: 'Microsoft Dynamics CRM',
|
|
69
|
-
auth:
|
|
22
|
+
auth: auth_1.dynamicsCRMAuth,
|
|
70
23
|
description: 'Customer relationship management software package developed by Microsoft.',
|
|
71
24
|
minimumSupportedRelease: '0.27.1',
|
|
72
25
|
logoUrl: 'https://cdn.activepieces.com/pieces/microsoft-dynamics-crm.png',
|
|
@@ -78,7 +31,7 @@ exports.microsoftDynamicsCrm = (0, pieces_framework_1.createPiece)({
|
|
|
78
31
|
get_record_1.getRecordAction,
|
|
79
32
|
update_record_1.updateRecordAction,
|
|
80
33
|
(0, pieces_common_1.createCustomApiCallAction)({
|
|
81
|
-
auth:
|
|
34
|
+
auth: auth_1.dynamicsCRMAuth,
|
|
82
35
|
baseUrl: (auth) => {
|
|
83
36
|
const props = auth === null || auth === void 0 ? void 0 : auth.props;
|
|
84
37
|
if (!props) {
|
|
@@ -88,7 +41,7 @@ exports.microsoftDynamicsCrm = (0, pieces_framework_1.createPiece)({
|
|
|
88
41
|
},
|
|
89
42
|
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
90
43
|
return ({
|
|
91
|
-
Authorization: `Bearer ${
|
|
44
|
+
Authorization: `Bearer ${auth.access_token}`,
|
|
92
45
|
});
|
|
93
46
|
}),
|
|
94
47
|
}),
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/microsoft-dynamics-crm/src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/microsoft-dynamics-crm/src/index.ts"],"names":[],"mappings":";;;AASA,gCAKC;;AAdD,+DAAwE;AACxE,qEAA6D;AAC7D,iDAAqD;AACrD,+DAAiE;AACjE,+DAAiE;AACjE,yDAA2D;AAC3D,+DAAiE;AACjE,qCAA6C;AAE7C,SAAgB,UAAU,CAAC,IAAY,EAAE,QAAiB;IACxD,IAAI,QAAQ,IAAI,QAAQ,KAAK,EAAE,EAAE,CAAC;QAChC,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAEY,QAAA,oBAAoB,GAAG,IAAA,8BAAW,EAAC;IAC9C,WAAW,EAAE,wBAAwB;IACrC,IAAI,EAAE,sBAAe;IACrB,WAAW,EACT,2EAA2E;IAC7E,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,gEAAgE;IACzE,OAAO,EAAE,CAAC,YAAY,CAAC;IACvB,UAAU,EAAE,CAAC,sBAAa,CAAC,aAAa,CAAC;IACzC,OAAO,EAAE;QACP,kCAAkB;QAClB,kCAAkB;QAClB,4BAAe;QACf,kCAAkB;QAClB,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,sBAAe;YACrB,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;gBAChB,MAAM,KAAK,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAC;gBAC1B,IAAI,CAAC,KAAK,EAAE,CAAC;oBACX,OAAO,EAAE,CAAC;gBACZ,CAAC;gBACD,OAAO,GAAG,UAAU,CAClB,KAAK,CAAC,SAAS,CAAW,EAC1B,KAAK,CAAC,UAAU,CAAW,CAC5B,gBAAgB,CAAC;YACpB,CAAC;YACD,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,WAAW,IAAI,CAAC,YAAY,EAAE;iBAC9C,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createRecordAction = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const
|
|
6
|
+
const auth_1 = require("../auth");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
8
|
exports.createRecordAction = (0, pieces_framework_1.createAction)({
|
|
9
|
-
auth:
|
|
9
|
+
auth: auth_1.dynamicsCRMAuth,
|
|
10
10
|
name: 'dynamics_crm_create_record',
|
|
11
11
|
displayName: 'Create Record',
|
|
12
12
|
description: 'Creates a new record.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-record.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/microsoft-dynamics-crm/src/lib/actions/create-record.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,
|
|
1
|
+
{"version":3,"file":"create-record.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/microsoft-dynamics-crm/src/lib/actions/create-record.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,kCAA0C;AAC1C,sCAA0D;AAE7C,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,sBAAe;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,IAAI,CACb,CAAC;YAEF,OAAO,MAAM,MAAM,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QAC1D,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.deleteRecordAction = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const
|
|
6
|
+
const auth_1 = require("../auth");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
8
|
exports.deleteRecordAction = (0, pieces_framework_1.createAction)({
|
|
9
|
-
auth:
|
|
9
|
+
auth: auth_1.dynamicsCRMAuth,
|
|
10
10
|
name: 'dynamics_crm_delete_record',
|
|
11
11
|
displayName: 'Delete Record',
|
|
12
12
|
description: 'Deletes an existing record.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-record.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/microsoft-dynamics-crm/src/lib/actions/delete-record.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,
|
|
1
|
+
{"version":3,"file":"delete-record.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/microsoft-dynamics-crm/src/lib/actions/delete-record.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,kCAA0C;AAC1C,sCAA0D;AAE7C,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,sBAAe;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,IAAI,CACb,CAAC;YAEF,OAAO,MAAM,MAAM,CAAC,YAAY,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;QAC5D,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getRecordAction = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const
|
|
6
|
+
const auth_1 = require("../auth");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
8
|
exports.getRecordAction = (0, pieces_framework_1.createAction)({
|
|
9
|
-
auth:
|
|
9
|
+
auth: auth_1.dynamicsCRMAuth,
|
|
10
10
|
name: 'dynamics_crm_get_record',
|
|
11
11
|
displayName: 'Get Record',
|
|
12
12
|
description: 'Retrieves an existing record.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-record.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/microsoft-dynamics-crm/src/lib/actions/get-record.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,
|
|
1
|
+
{"version":3,"file":"get-record.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/microsoft-dynamics-crm/src/lib/actions/get-record.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,kCAA0C;AAC1C,sCAA0D;AAE7C,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,sBAAe;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,IAAI,CACb,CAAC;YAEF,OAAO,MAAM,MAAM,CAAC,SAAS,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;QACzD,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.updateRecordAction = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const
|
|
6
|
+
const auth_1 = require("../auth");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
8
|
exports.updateRecordAction = (0, pieces_framework_1.createAction)({
|
|
9
|
-
auth:
|
|
9
|
+
auth: auth_1.dynamicsCRMAuth,
|
|
10
10
|
name: 'dynamics_crm_update_record',
|
|
11
11
|
displayName: 'Update Record',
|
|
12
12
|
description: 'Updates an existing record.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-record.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/microsoft-dynamics-crm/src/lib/actions/update-record.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,
|
|
1
|
+
{"version":3,"file":"update-record.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/microsoft-dynamics-crm/src/lib/actions/update-record.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,kCAA0C;AAC1C,sCAA0D;AAE7C,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,sBAAe;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,IAAI,CACb,CAAC;YAEF,OAAO,MAAM,MAAM,CAAC,aAAa,CAAC,aAAa,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QACrE,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const dynamicsCRMAuth: import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>;
|
package/src/lib/auth.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dynamicsCRMAuth = void 0;
|
|
4
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
|
+
const authDesc = `
|
|
6
|
+
Follow the [Azure app creation guide](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app#register-an-application),
|
|
7
|
+
set the **Redirect URI** to {{redirectUrl}} and add the **Dynamics CRM (Delegated) permissions** under **API permissions**.`;
|
|
8
|
+
exports.dynamicsCRMAuth = pieces_framework_1.PieceAuth.OAuth2({
|
|
9
|
+
description: authDesc,
|
|
10
|
+
props: {
|
|
11
|
+
hostUrl: pieces_framework_1.Property.ShortText({
|
|
12
|
+
displayName: 'Host URL (without trailing slash)',
|
|
13
|
+
description: 'Host URL without trailing slash.For example **https://demo.crm.dynamics.com**',
|
|
14
|
+
required: true,
|
|
15
|
+
}),
|
|
16
|
+
tenantId: pieces_framework_1.Property.ShortText({
|
|
17
|
+
displayName: 'Tenant ID',
|
|
18
|
+
description: 'You can find this in the Azure portal.',
|
|
19
|
+
defaultValue: 'common',
|
|
20
|
+
required: true,
|
|
21
|
+
}),
|
|
22
|
+
proxyUrl: pieces_framework_1.Property.ShortText({
|
|
23
|
+
displayName: 'Proxy URL with Port',
|
|
24
|
+
description: 'Keep empty if not needed. Optional proxy URL used for establishing connections when proxying requests is needed. For example: **https://proxy.com:8080**.',
|
|
25
|
+
required: false,
|
|
26
|
+
}),
|
|
27
|
+
},
|
|
28
|
+
required: true,
|
|
29
|
+
scope: ['{hostUrl}/.default', 'openid', 'email', 'profile', 'offline_access'],
|
|
30
|
+
prompt: 'omit',
|
|
31
|
+
authUrl: 'https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/authorize',
|
|
32
|
+
tokenUrl: 'https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token',
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/community/microsoft-dynamics-crm/src/lib/auth.ts"],"names":[],"mappings":";;;AAAA,qEAAqE;AAErE,MAAM,QAAQ,GAAG;;6HAE4G,CAAC;AAEjH,QAAA,eAAe,GAAG,4BAAS,CAAC,MAAM,CAAC;IAC9C,WAAW,EAAE,QAAQ;IACrB,KAAK,EAAE;QACL,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,mCAAmC;YAChD,WAAW,EACT,+EAA+E;YACjF,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,wCAAwC;YACrD,YAAY,EAAE,QAAQ;YACtB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,qBAAqB;YAClC,WAAW,EACT,2JAA2J;YAC7J,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACD,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,CAAC,oBAAoB,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,CAAC;IAC7E,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,oEAAoE;IAC7E,QAAQ,EAAE,gEAAgE;CAC3E,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PiecePropValueSchema } from '@activepieces/pieces-framework';
|
|
2
|
-
import { dynamicsCRMAuth } from '
|
|
2
|
+
import { dynamicsCRMAuth } from '../auth';
|
|
3
3
|
import { DynamicsCRMClient } from './client';
|
|
4
4
|
export declare function makeClient(auth: PiecePropValueSchema<typeof dynamicsCRMAuth>): DynamicsCRMClient;
|
|
5
5
|
export declare const DynamicsCRMCommon: {
|
package/src/lib/common/index.js
CHANGED
|
@@ -5,6 +5,7 @@ exports.makeClient = makeClient;
|
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
7
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
8
|
+
const auth_1 = require("../auth");
|
|
8
9
|
const __1 = require("../../");
|
|
9
10
|
const client_1 = require("./client");
|
|
10
11
|
const constants_1 = require("./constants");
|
|
@@ -15,7 +16,7 @@ function makeClient(auth) {
|
|
|
15
16
|
}
|
|
16
17
|
exports.DynamicsCRMCommon = {
|
|
17
18
|
entityType: (description) => pieces_framework_1.Property.Dropdown({
|
|
18
|
-
auth:
|
|
19
|
+
auth: auth_1.dynamicsCRMAuth,
|
|
19
20
|
displayName: 'Entity Type',
|
|
20
21
|
refreshers: [],
|
|
21
22
|
description,
|
|
@@ -42,7 +43,7 @@ exports.DynamicsCRMCommon = {
|
|
|
42
43
|
}),
|
|
43
44
|
}),
|
|
44
45
|
recordId: pieces_framework_1.Property.Dropdown({
|
|
45
|
-
auth:
|
|
46
|
+
auth: auth_1.dynamicsCRMAuth,
|
|
46
47
|
displayName: 'Record ID',
|
|
47
48
|
refreshers: ['entityType'],
|
|
48
49
|
required: true,
|
|
@@ -99,7 +100,7 @@ exports.DynamicsCRMCommon = {
|
|
|
99
100
|
}),
|
|
100
101
|
}),
|
|
101
102
|
entityFields: (isCreate = true) => pieces_framework_1.Property.DynamicProperties({
|
|
102
|
-
auth:
|
|
103
|
+
auth: auth_1.dynamicsCRMAuth,
|
|
103
104
|
displayName: 'Entity Fields',
|
|
104
105
|
refreshers: ['auth', 'entityType'],
|
|
105
106
|
required: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/microsoft-dynamics-crm/src/lib/common/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/microsoft-dynamics-crm/src/lib/common/index.ts"],"names":[],"mappings":";;;AAgBA,gCAOC;;AAvBD,+DAKqC;AACrC,qEAIwC;AACxC,kCAA0C;AAC1C,8BAAoC;AACpC,qCAA6C;AAC7C,2CAAkD;AAEl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