@activepieces/piece-microsoft-dynamics-crm 0.3.2 → 0.3.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/package.json +7 -12
- package/src/index.js +15 -51
- package/src/index.d.ts +0 -3
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/create-record.d.ts +0 -5
- package/src/lib/actions/create-record.d.ts.map +0 -1
- package/src/lib/actions/create-record.js +0 -31
- package/src/lib/actions/create-record.js.map +0 -1
- package/src/lib/actions/delete-record.d.ts +0 -5
- package/src/lib/actions/delete-record.d.ts.map +0 -1
- package/src/lib/actions/delete-record.js +0 -31
- package/src/lib/actions/delete-record.js.map +0 -1
- package/src/lib/actions/get-record.d.ts +0 -5
- package/src/lib/actions/get-record.d.ts.map +0 -1
- package/src/lib/actions/get-record.js +0 -31
- package/src/lib/actions/get-record.js.map +0 -1
- package/src/lib/actions/update-record.d.ts +0 -6
- package/src/lib/actions/update-record.d.ts.map +0 -1
- package/src/lib/actions/update-record.js +0 -32
- package/src/lib/actions/update-record.js.map +0 -1
- package/src/lib/auth.d.ts +0 -2
- package/src/lib/auth.d.ts.map +0 -1
- package/src/lib/auth.js +0 -36
- package/src/lib/auth.js.map +0 -1
- package/src/lib/common/client.d.ts +0 -22
- package/src/lib/common/client.d.ts.map +0 -1
- package/src/lib/common/client.js +0 -114
- package/src/lib/common/client.js.map +0 -1
- package/src/lib/common/constants.d.ts +0 -20
- package/src/lib/common/constants.d.ts.map +0 -1
- package/src/lib/common/constants.js +0 -25
- package/src/lib/common/constants.js.map +0 -1
- package/src/lib/common/index.d.ts +0 -10
- package/src/lib/common/index.d.ts.map +0 -1
- package/src/lib/common/index.js +0 -175
- package/src/lib/common/index.js.map +0 -1
- package/src/lib/common/microsoft-cloud.d.ts +0 -4
- package/src/lib/common/microsoft-cloud.d.ts.map +0 -1
- package/src/lib/common/microsoft-cloud.js +0 -28
- package/src/lib/common/microsoft-cloud.js.map +0 -1
- package/src/lib/common/types.d.ts +0 -83
- package/src/lib/common/types.d.ts.map +0 -1
- package/src/lib/common/types.js +0 -3
- package/src/lib/common/types.js.map +0 -1
package/src/lib/auth.d.ts
DELETED
package/src/lib/auth.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,eAAe,+GA4B1B,CAAC"}
|
package/src/lib/auth.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
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 microsoft_cloud_1 = require("./common/microsoft-cloud");
|
|
6
|
-
const authDesc = `
|
|
7
|
-
Follow the [Azure app creation guide](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app#register-an-application),
|
|
8
|
-
set the **Redirect URI** to {{redirectUrl}} and add the **Dynamics CRM (Delegated) permissions** under **API permissions**.`;
|
|
9
|
-
exports.dynamicsCRMAuth = pieces_framework_1.PieceAuth.OAuth2({
|
|
10
|
-
description: authDesc,
|
|
11
|
-
props: {
|
|
12
|
-
cloud: microsoft_cloud_1.microsoftCloudProperty,
|
|
13
|
-
hostUrl: pieces_framework_1.Property.ShortText({
|
|
14
|
-
displayName: 'Host URL (without trailing slash)',
|
|
15
|
-
description: 'Host URL without trailing slash.For example **https://demo.crm.dynamics.com**',
|
|
16
|
-
required: true,
|
|
17
|
-
}),
|
|
18
|
-
tenantId: pieces_framework_1.Property.ShortText({
|
|
19
|
-
displayName: 'Tenant ID',
|
|
20
|
-
description: 'You can find this in the Azure portal.',
|
|
21
|
-
defaultValue: 'common',
|
|
22
|
-
required: true,
|
|
23
|
-
}),
|
|
24
|
-
proxyUrl: pieces_framework_1.Property.ShortText({
|
|
25
|
-
displayName: 'Proxy URL with Port',
|
|
26
|
-
description: 'Keep empty if not needed. Optional proxy URL used for establishing connections when proxying requests is needed. For example: **https://proxy.com:8080**.',
|
|
27
|
-
required: false,
|
|
28
|
-
}),
|
|
29
|
-
},
|
|
30
|
-
required: true,
|
|
31
|
-
scope: ['{hostUrl}/.default', 'openid', 'email', 'profile', 'offline_access'],
|
|
32
|
-
prompt: 'omit',
|
|
33
|
-
authUrl: 'https://{cloud}/{tenantId}/oauth2/v2.0/authorize',
|
|
34
|
-
tokenUrl: 'https://{cloud}/{tenantId}/oauth2/v2.0/token',
|
|
35
|
-
});
|
|
36
|
-
//# sourceMappingURL=auth.js.map
|
package/src/lib/auth.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":";;;AAAA,qEAAqE;AACrE,8DAAkE;AAElE,MAAM,QAAQ,GAAG;;6HAE4G,CAAC;AAEjH,QAAA,eAAe,GAAG,4BAAS,CAAC,MAAM,CAAC;IAC9C,WAAW,EAAE,QAAQ;IACrB,KAAK,EAAE;QACL,KAAK,EAAE,wCAAsB;QAC7B,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,kDAAkD;IAC3D,QAAQ,EAAE,8CAA8C;CACzD,CAAC,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { HttpHeaders, HttpMessageBody, HttpMethod, QueryParams } from '@activepieces/pieces-common';
|
|
2
|
-
import { EntityAttributeType } from './constants';
|
|
3
|
-
import { EntityAttributeResponse, EntityTypeAttributesResponse, EntityTypeResponse } from './types';
|
|
4
|
-
export declare class DynamicsCRMClient {
|
|
5
|
-
private hostUrl;
|
|
6
|
-
private accessToken;
|
|
7
|
-
private proxyUrl?;
|
|
8
|
-
constructor(hostUrl: string, accessToken: string, proxyUrl?: string | undefined);
|
|
9
|
-
makeRequest<T extends HttpMessageBody>(method: HttpMethod, resourceUri: string, headers?: HttpHeaders, query?: QueryParams, body?: any | undefined): Promise<T>;
|
|
10
|
-
createRecord(entityUrlPath: string, request: unknown): Promise<unknown>;
|
|
11
|
-
updatedRecord(entityUrlPath: string, recordId: string, request: unknown): Promise<unknown>;
|
|
12
|
-
getRecord(entityUrlPath: string, recordId: string): Promise<unknown>;
|
|
13
|
-
deleteRecord(entityUrlPath: string, recordId: string): Promise<unknown>;
|
|
14
|
-
fetchEntityTypes(): Promise<EntityTypeResponse>;
|
|
15
|
-
fetchEntityTypeAttributes(entitySetName: string): Promise<EntityTypeAttributesResponse>;
|
|
16
|
-
fetchEntityAttributes(entityName: string): Promise<EntityAttributeResponse>;
|
|
17
|
-
fetchOptionFieldValues(entityName: string, entityAttributeName: string, entityAttributeType: EntityAttributeType): Promise<{
|
|
18
|
-
label: string;
|
|
19
|
-
value: string | number;
|
|
20
|
-
}[]>;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/lib/common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AAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,EAAE,CAAC;CAkBxD"}
|
package/src/lib/common/client.js
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DynamicsCRMClient = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
-
const __1 = require("../..");
|
|
7
|
-
class DynamicsCRMClient {
|
|
8
|
-
constructor(hostUrl, accessToken, proxyUrl) {
|
|
9
|
-
this.hostUrl = hostUrl;
|
|
10
|
-
this.accessToken = accessToken;
|
|
11
|
-
this.proxyUrl = proxyUrl;
|
|
12
|
-
}
|
|
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);
|
|
16
|
-
const res = yield pieces_common_1.httpClient.sendRequest({
|
|
17
|
-
method: method,
|
|
18
|
-
url: `${baseUrl}/api/data/v9.2` + resourceUri,
|
|
19
|
-
authentication: {
|
|
20
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
21
|
-
token: this.accessToken,
|
|
22
|
-
},
|
|
23
|
-
headers: Object.assign({ Accept: 'application/json', 'OData-MaxVersion': '4.0', 'OData-Version': '4.0', 'Content-Type': 'application/json' }, headers),
|
|
24
|
-
queryParams: query,
|
|
25
|
-
body: body,
|
|
26
|
-
});
|
|
27
|
-
return res.body;
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
createRecord(entityUrlPath, request) {
|
|
31
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
return yield this.makeRequest(pieces_common_1.HttpMethod.POST, `/${entityUrlPath}`, {
|
|
33
|
-
// return created data in response
|
|
34
|
-
// docs: https://learn.microsoft.com/en-us/previous-versions/dynamicscrm-2016/developers-guide/gg328090(v=crm.8)#create-with-data-returned
|
|
35
|
-
Prefer: 'return=representation',
|
|
36
|
-
}, undefined, request);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
updatedRecord(entityUrlPath, recordId, request) {
|
|
40
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
return yield this.makeRequest(pieces_common_1.HttpMethod.PATCH, `/${entityUrlPath}(${recordId})`, {
|
|
42
|
-
// return created data in response
|
|
43
|
-
// docs: https://learn.microsoft.com/en-us/previous-versions/dynamicscrm-2016/developers-guide/mt607664(v=crm.8)#update-with-data-returned
|
|
44
|
-
Prefer: 'return=representation',
|
|
45
|
-
}, undefined, request);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
getRecord(entityUrlPath, recordId) {
|
|
49
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
50
|
-
return yield this.makeRequest(pieces_common_1.HttpMethod.GET, `/${entityUrlPath}(${recordId})`);
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
deleteRecord(entityUrlPath, recordId) {
|
|
54
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
return yield this.makeRequest(pieces_common_1.HttpMethod.DELETE, `/${entityUrlPath}(${recordId})`);
|
|
56
|
-
});
|
|
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
|
-
}
|
|
78
|
-
fetchEntityAttributes(entityName) {
|
|
79
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
80
|
-
// fetch entity attribute data
|
|
81
|
-
// docs: https://learn.microsoft.com/en-us/previous-versions/dynamicscrm-2016/developers-guide/mt788314(v=crm.8)#retrieve-metadata-items-by-name
|
|
82
|
-
return yield this.makeRequest(pieces_common_1.HttpMethod.GET, `/EntityDefinitions(LogicalName='${entityName}')/Attributes`, undefined, {
|
|
83
|
-
$select: [
|
|
84
|
-
'AttributeType',
|
|
85
|
-
'LogicalName',
|
|
86
|
-
'Description',
|
|
87
|
-
'DisplayName',
|
|
88
|
-
'IsPrimaryName',
|
|
89
|
-
'IsValidForCreate',
|
|
90
|
-
].join(','),
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
fetchOptionFieldValues(entityName, entityAttributeName, entityAttributeType) {
|
|
95
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
96
|
-
var _a, _b;
|
|
97
|
-
const res = yield this.makeRequest(pieces_common_1.HttpMethod.GET, `/EntityDefinitions(LogicalName='${entityName}')/Attributes(LogicalName='${entityAttributeName}')/Microsoft.Dynamics.CRM.${entityAttributeType}AttributeMetadata`, undefined, {
|
|
98
|
-
$select: 'LogicalName',
|
|
99
|
-
$expand: 'OptionSet($select=Options),GlobalOptionSet($select=Options)',
|
|
100
|
-
});
|
|
101
|
-
const optionSet = (_a = res.OptionSet) !== null && _a !== void 0 ? _a : res.GlobalOptionSet;
|
|
102
|
-
const options = ((_b = optionSet === null || optionSet === void 0 ? void 0 : optionSet.Options) === null || _b === void 0 ? void 0 : _b.map(({ Value, Label }) => {
|
|
103
|
-
var _a;
|
|
104
|
-
return ({
|
|
105
|
-
value: Value,
|
|
106
|
-
label: (_a = Label.UserLocalizedLabel.Label) !== null && _a !== void 0 ? _a : String(Value),
|
|
107
|
-
});
|
|
108
|
-
})) || [];
|
|
109
|
-
return options;
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
exports.DynamicsCRMClient = DynamicsCRMClient;
|
|
114
|
-
//# sourceMappingURL=client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../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,E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,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,20 +0,0 @@
|
|
|
1
|
-
export declare enum EntityAttributeType {
|
|
2
|
-
PICKLIST = "Picklist",
|
|
3
|
-
VIRTUAL = "Virtual",
|
|
4
|
-
UNIQUE_IDENTIFIER = "Uniqueidentifier",
|
|
5
|
-
STRING = "String",
|
|
6
|
-
MEMO = "Memo",
|
|
7
|
-
MONEY = "Money",
|
|
8
|
-
DOUBLE = "Double",
|
|
9
|
-
INTEGER = "Integer",
|
|
10
|
-
LOOKUP = "Lookup",
|
|
11
|
-
DATETIME = "DateTime",
|
|
12
|
-
BOOLEAN = "Boolean",
|
|
13
|
-
BIGINT = "BigInt",
|
|
14
|
-
DECIMAL = "Decimal",
|
|
15
|
-
OWNER = "Owner",
|
|
16
|
-
ENTITY_NAME = "EntityName",
|
|
17
|
-
STATE = "State",
|
|
18
|
-
STATUS = "Status"
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/constants.ts"],"names":[],"mappings":"AAEA,oBAAY,mBAAmB;IAC7B,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,iBAAiB,qBAAqB;IACtC,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,WAAW,eAAe;IAC1B,KAAK,UAAU;IACf,MAAM,WAAW;CAClB"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// docs: https://learn.microsoft.com/en-us/previous-versions/dynamicscrm-2016/developers-guide/mt608066(v=crm.8)
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.EntityAttributeType = void 0;
|
|
5
|
-
var EntityAttributeType;
|
|
6
|
-
(function (EntityAttributeType) {
|
|
7
|
-
EntityAttributeType["PICKLIST"] = "Picklist";
|
|
8
|
-
EntityAttributeType["VIRTUAL"] = "Virtual";
|
|
9
|
-
EntityAttributeType["UNIQUE_IDENTIFIER"] = "Uniqueidentifier";
|
|
10
|
-
EntityAttributeType["STRING"] = "String";
|
|
11
|
-
EntityAttributeType["MEMO"] = "Memo";
|
|
12
|
-
EntityAttributeType["MONEY"] = "Money";
|
|
13
|
-
EntityAttributeType["DOUBLE"] = "Double";
|
|
14
|
-
EntityAttributeType["INTEGER"] = "Integer";
|
|
15
|
-
EntityAttributeType["LOOKUP"] = "Lookup";
|
|
16
|
-
EntityAttributeType["DATETIME"] = "DateTime";
|
|
17
|
-
EntityAttributeType["BOOLEAN"] = "Boolean";
|
|
18
|
-
EntityAttributeType["BIGINT"] = "BigInt";
|
|
19
|
-
EntityAttributeType["DECIMAL"] = "Decimal";
|
|
20
|
-
EntityAttributeType["OWNER"] = "Owner";
|
|
21
|
-
EntityAttributeType["ENTITY_NAME"] = "EntityName";
|
|
22
|
-
EntityAttributeType["STATE"] = "State";
|
|
23
|
-
EntityAttributeType["STATUS"] = "Status";
|
|
24
|
-
})(EntityAttributeType || (exports.EntityAttributeType = EntityAttributeType = {}));
|
|
25
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../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"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { PiecePropValueSchema } from '@activepieces/pieces-framework';
|
|
2
|
-
import { dynamicsCRMAuth } from '../auth';
|
|
3
|
-
import { DynamicsCRMClient } from './client';
|
|
4
|
-
export declare function makeClient(auth: PiecePropValueSchema<typeof dynamicsCRMAuth>): DynamicsCRMClient;
|
|
5
|
-
export declare const DynamicsCRMCommon: {
|
|
6
|
-
entityType: (description: string) => import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
|
7
|
-
recordId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
|
8
|
-
entityFields: (isCreate?: boolean) => import("@activepieces/pieces-framework").DynamicProperties<true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,oBAAoB,EAErB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,wBAAgB,UAAU,CAAC,IAAI,EAAE,oBAAoB,CAAC,OAAO,eAAe,CAAC,qBAO5E;AAED,eAAO,MAAM,iBAAiB;8BACF,MAAM;;;CA2MjC,CAAC"}
|
package/src/lib/common/index.js
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DynamicsCRMCommon = void 0;
|
|
4
|
-
exports.makeClient = makeClient;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
8
|
-
const auth_1 = require("../auth");
|
|
9
|
-
const __1 = require("../../");
|
|
10
|
-
const client_1 = require("./client");
|
|
11
|
-
const constants_1 = require("./constants");
|
|
12
|
-
function makeClient(auth) {
|
|
13
|
-
var _a, _b;
|
|
14
|
-
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']);
|
|
15
|
-
return client;
|
|
16
|
-
}
|
|
17
|
-
exports.DynamicsCRMCommon = {
|
|
18
|
-
entityType: (description) => pieces_framework_1.Property.Dropdown({
|
|
19
|
-
auth: auth_1.dynamicsCRMAuth,
|
|
20
|
-
displayName: 'Entity Type',
|
|
21
|
-
refreshers: [],
|
|
22
|
-
description,
|
|
23
|
-
required: true,
|
|
24
|
-
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
25
|
-
if (!auth) {
|
|
26
|
-
return {
|
|
27
|
-
disabled: true,
|
|
28
|
-
options: [],
|
|
29
|
-
placeholder: '',
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
const client = makeClient(auth);
|
|
33
|
-
const res = yield client.fetchEntityTypes();
|
|
34
|
-
return {
|
|
35
|
-
disabled: false,
|
|
36
|
-
options: res.value.map((val) => {
|
|
37
|
-
return {
|
|
38
|
-
label: val.EntitySetName,
|
|
39
|
-
value: val.EntitySetName,
|
|
40
|
-
};
|
|
41
|
-
}),
|
|
42
|
-
};
|
|
43
|
-
}),
|
|
44
|
-
}),
|
|
45
|
-
recordId: pieces_framework_1.Property.Dropdown({
|
|
46
|
-
auth: auth_1.dynamicsCRMAuth,
|
|
47
|
-
displayName: 'Record ID',
|
|
48
|
-
refreshers: ['entityType'],
|
|
49
|
-
required: true,
|
|
50
|
-
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, entityType }) {
|
|
51
|
-
var _b, _c;
|
|
52
|
-
if (!auth || !entityType) {
|
|
53
|
-
return {
|
|
54
|
-
disabled: true,
|
|
55
|
-
options: [],
|
|
56
|
-
placeholder: 'Please select entity type first.',
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
const client = makeClient(auth);
|
|
60
|
-
const res = yield client.fetchEntityTypeAttributes(entityType);
|
|
61
|
-
if (!res.value[0]) {
|
|
62
|
-
return {
|
|
63
|
-
disabled: true,
|
|
64
|
-
options: [],
|
|
65
|
-
placeholder: 'Please select entity type first.',
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
const entityUrlPath = entityType;
|
|
69
|
-
const entityPrimaryKey = res.value[0].PrimaryIdAttribute;
|
|
70
|
-
const entityprimaryNameAttribute = res.value[0].PrimaryNameAttribute;
|
|
71
|
-
const authValue = auth;
|
|
72
|
-
const request = {
|
|
73
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
74
|
-
url: `${(0, __1.getBaseUrl)((_b = authValue.props) === null || _b === void 0 ? void 0 : _b['hostUrl'], (_c = authValue.props) === null || _c === void 0 ? void 0 : _c['proxyUrl'])}/api/data/v9.2/${entityUrlPath}`,
|
|
75
|
-
queryParams: {
|
|
76
|
-
$select: entityprimaryNameAttribute,
|
|
77
|
-
},
|
|
78
|
-
authentication: {
|
|
79
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
80
|
-
token: authValue.access_token,
|
|
81
|
-
},
|
|
82
|
-
headers: {
|
|
83
|
-
Accept: 'application/json',
|
|
84
|
-
'OData-MaxVersion': '4.0',
|
|
85
|
-
'OData-Version': '4.0',
|
|
86
|
-
'Content-Type': 'application/json',
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
const { body } = yield pieces_common_1.httpClient.sendRequest(request);
|
|
90
|
-
return {
|
|
91
|
-
disabled: false,
|
|
92
|
-
options: body.value.map((val) => {
|
|
93
|
-
var _a;
|
|
94
|
-
return {
|
|
95
|
-
label: (_a = val[entityprimaryNameAttribute]) !== null && _a !== void 0 ? _a : val[entityPrimaryKey],
|
|
96
|
-
value: val[entityPrimaryKey],
|
|
97
|
-
};
|
|
98
|
-
}),
|
|
99
|
-
};
|
|
100
|
-
}),
|
|
101
|
-
}),
|
|
102
|
-
entityFields: (isCreate = true) => pieces_framework_1.Property.DynamicProperties({
|
|
103
|
-
auth: auth_1.dynamicsCRMAuth,
|
|
104
|
-
displayName: 'Entity Fields',
|
|
105
|
-
refreshers: ['auth', 'entityType'],
|
|
106
|
-
required: true,
|
|
107
|
-
props: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, entityType }) {
|
|
108
|
-
var _b, _c, _d, _e, _f, _g;
|
|
109
|
-
if (!auth)
|
|
110
|
-
return {};
|
|
111
|
-
if (!entityType)
|
|
112
|
-
return {};
|
|
113
|
-
const fields = {};
|
|
114
|
-
const client = makeClient(auth);
|
|
115
|
-
const typeRes = yield client.fetchEntityTypeAttributes(entityType);
|
|
116
|
-
if (!typeRes.value[0]) {
|
|
117
|
-
return {
|
|
118
|
-
disabled: true,
|
|
119
|
-
options: [],
|
|
120
|
-
placeholder: 'Please select entity type first.',
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
const res = yield client.fetchEntityAttributes(typeRes.value[0].LogicalName);
|
|
124
|
-
for (const field of res.value) {
|
|
125
|
-
if (field.IsValidForCreate &&
|
|
126
|
-
![
|
|
127
|
-
constants_1.EntityAttributeType.ENTITY_NAME,
|
|
128
|
-
constants_1.EntityAttributeType.LOOKUP,
|
|
129
|
-
constants_1.EntityAttributeType.MEMO,
|
|
130
|
-
constants_1.EntityAttributeType.MONEY,
|
|
131
|
-
constants_1.EntityAttributeType.OWNER,
|
|
132
|
-
constants_1.EntityAttributeType.VIRTUAL,
|
|
133
|
-
constants_1.EntityAttributeType.UNIQUE_IDENTIFIER,
|
|
134
|
-
].includes(field.AttributeType)) {
|
|
135
|
-
const params = {
|
|
136
|
-
displayName: (_d = (_c = (_b = field.DisplayName) === null || _b === void 0 ? void 0 : _b.UserLocalizedLabel) === null || _c === void 0 ? void 0 : _c.Label) !== null && _d !== void 0 ? _d : field.LogicalName,
|
|
137
|
-
description: (_g = (_f = (_e = field.Description) === null || _e === void 0 ? void 0 : _e.UserLocalizedLabel) === null || _f === void 0 ? void 0 : _f.Label) !== null && _g !== void 0 ? _g : '',
|
|
138
|
-
required: field.IsPrimaryName && isCreate,
|
|
139
|
-
};
|
|
140
|
-
switch (field.AttributeType) {
|
|
141
|
-
case constants_1.EntityAttributeType.BIGINT:
|
|
142
|
-
case constants_1.EntityAttributeType.DECIMAL:
|
|
143
|
-
case constants_1.EntityAttributeType.DOUBLE:
|
|
144
|
-
case constants_1.EntityAttributeType.INTEGER:
|
|
145
|
-
fields[field.LogicalName] = pieces_framework_1.Property.Number(params);
|
|
146
|
-
break;
|
|
147
|
-
case constants_1.EntityAttributeType.DATETIME:
|
|
148
|
-
fields[field.LogicalName] = pieces_framework_1.Property.DateTime(params);
|
|
149
|
-
break;
|
|
150
|
-
case constants_1.EntityAttributeType.BOOLEAN:
|
|
151
|
-
fields[field.LogicalName] = pieces_framework_1.Property.Checkbox(params);
|
|
152
|
-
break;
|
|
153
|
-
case constants_1.EntityAttributeType.STRING:
|
|
154
|
-
fields[field.LogicalName] = pieces_framework_1.Property.ShortText(params);
|
|
155
|
-
break;
|
|
156
|
-
case constants_1.EntityAttributeType.PICKLIST:
|
|
157
|
-
case constants_1.EntityAttributeType.STATE:
|
|
158
|
-
case constants_1.EntityAttributeType.STATUS: {
|
|
159
|
-
const options = yield client.fetchOptionFieldValues(typeRes.value[0].LogicalName, field.LogicalName, field.AttributeType);
|
|
160
|
-
fields[field.LogicalName] = pieces_framework_1.Property.StaticDropdown(Object.assign(Object.assign({}, params), { options: {
|
|
161
|
-
disabled: false,
|
|
162
|
-
options: options,
|
|
163
|
-
} }));
|
|
164
|
-
break;
|
|
165
|
-
}
|
|
166
|
-
default:
|
|
167
|
-
break;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
return fields;
|
|
172
|
-
}),
|
|
173
|
-
}),
|
|
174
|
-
};
|
|
175
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/common/index.ts"],"names":[],"mappings":";;;AAgBA,gCAOC;;AAvBD,+DAKqC;AACrC,qEAIwC;AACxC,kCAA0C;AAC1C,8BAAoC;AACpC,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;AAEY,QAAA,iBAAiB,GAAG;IAC/B,UAAU,EAAE,CAAC,WAAmB,EAAE,EAAE,CAClC,2BAAQ,CAAC,QAAQ,CAAC;QAChB,IAAI,EAAE,sBAAe;QACrB,WAAW,EAAE,aAAa;QAC1B,UAAU,EAAE,EAAE;QACd,WAAW;QACX,QAAQ,EAAE,IAAI;QAC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,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAC5B,KAAK,CAAC,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 +0,0 @@
|
|
|
1
|
-
import { OAuth2PropertyValue } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const microsoftCloudProperty: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
3
|
-
export declare function getMicrosoftCloudFromAuth(auth: OAuth2PropertyValue): string;
|
|
4
|
-
//# sourceMappingURL=microsoft-cloud.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"microsoft-cloud.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/microsoft-cloud.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAY,MAAM,gCAAgC,CAAC;AAK/E,eAAO,MAAM,sBAAsB,+EAYjC,CAAC;AAMH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CAE3E"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.microsoftCloudProperty = void 0;
|
|
4
|
-
exports.getMicrosoftCloudFromAuth = getMicrosoftCloudFromAuth;
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const COMMERCIAL_LOGIN_HOST = 'login.microsoftonline.com';
|
|
7
|
-
const GOV_LOGIN_HOST = 'login.microsoftonline.us';
|
|
8
|
-
exports.microsoftCloudProperty = pieces_framework_1.Property.StaticDropdown({
|
|
9
|
-
displayName: 'Cloud Environment',
|
|
10
|
-
description: 'Select your Microsoft cloud environment.',
|
|
11
|
-
required: true,
|
|
12
|
-
defaultValue: COMMERCIAL_LOGIN_HOST,
|
|
13
|
-
options: {
|
|
14
|
-
disabled: false,
|
|
15
|
-
options: [
|
|
16
|
-
{ label: 'Commercial (Global)', value: COMMERCIAL_LOGIN_HOST },
|
|
17
|
-
{ label: 'US Government (GCC High)', value: GOV_LOGIN_HOST },
|
|
18
|
-
],
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
function resolveCloudHost(cloudLoginHost) {
|
|
22
|
-
return cloudLoginHost !== null && cloudLoginHost !== void 0 ? cloudLoginHost : COMMERCIAL_LOGIN_HOST;
|
|
23
|
-
}
|
|
24
|
-
function getMicrosoftCloudFromAuth(auth) {
|
|
25
|
-
var _a;
|
|
26
|
-
return resolveCloudHost((_a = auth.props) === null || _a === void 0 ? void 0 : _a['cloud']);
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=microsoft-cloud.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"microsoft-cloud.js","sourceRoot":"","sources":["../../../../src/lib/common/microsoft-cloud.ts"],"names":[],"mappings":";;;AAuBA,8DAEC;AAzBD,qEAA+E;AAE/E,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AAC1D,MAAM,cAAc,GAAG,0BAA0B,CAAC;AAErC,QAAA,sBAAsB,GAAG,2BAAQ,CAAC,cAAc,CAAC;IAC5D,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,0CAA0C;IACvD,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,qBAAqB;IACnC,OAAO,EAAE;QACP,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE;YACP,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAE,qBAAqB,EAAE;YAC9D,EAAE,KAAK,EAAE,0BAA0B,EAAE,KAAK,EAAE,cAAc,EAAE;SAC7D;KACF;CACF,CAAC,CAAC;AAEH,SAAS,gBAAgB,CAAC,cAAyC;IACjE,OAAO,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,qBAAqB,CAAC;AACjD,CAAC;AAED,SAAgB,yBAAyB,CAAC,IAAyB;;IACjE,OAAO,gBAAgB,CAAC,MAAA,IAAI,CAAC,KAAK,0CAAG,OAAO,CAAuB,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -1,83 +0,0 @@
|
|
|
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
|
-
};
|
|
19
|
-
export type EntityAttributeResponse = {
|
|
20
|
-
'@odata.context': string;
|
|
21
|
-
value: {
|
|
22
|
-
'@odata.type': string;
|
|
23
|
-
AttributeType: EntityAttributeType;
|
|
24
|
-
LogicalName: string;
|
|
25
|
-
MetadataId: string;
|
|
26
|
-
IsValidForCreate: boolean;
|
|
27
|
-
IsPrimaryName: boolean;
|
|
28
|
-
Description: {
|
|
29
|
-
UserLocalizedLabel: {
|
|
30
|
-
Label: string;
|
|
31
|
-
LanguageCode: number;
|
|
32
|
-
IsManaged: boolean;
|
|
33
|
-
MetadataId: string;
|
|
34
|
-
HasChanged: boolean;
|
|
35
|
-
} | null;
|
|
36
|
-
} | null;
|
|
37
|
-
DisplayName: {
|
|
38
|
-
UserLocalizedLabel: {
|
|
39
|
-
Label: string;
|
|
40
|
-
LanguageCode: number;
|
|
41
|
-
IsManaged: boolean;
|
|
42
|
-
MetadataId: string;
|
|
43
|
-
HasChanged: boolean;
|
|
44
|
-
} | null;
|
|
45
|
-
} | null;
|
|
46
|
-
}[];
|
|
47
|
-
};
|
|
48
|
-
export type EntityAttributeOptionsResponse = {
|
|
49
|
-
'@odata.context': string;
|
|
50
|
-
LogicalName: string;
|
|
51
|
-
MetadataId: string;
|
|
52
|
-
OptionSet: {
|
|
53
|
-
MetadataId: string;
|
|
54
|
-
Options: {
|
|
55
|
-
Value: number;
|
|
56
|
-
Label: {
|
|
57
|
-
UserLocalizedLabel: {
|
|
58
|
-
Label: string;
|
|
59
|
-
LanguageCode: number;
|
|
60
|
-
IsManaged: boolean;
|
|
61
|
-
MetadataId: string;
|
|
62
|
-
HasChanged: boolean;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
}[];
|
|
66
|
-
} | null;
|
|
67
|
-
GlobalOptionSet: {
|
|
68
|
-
MetadataId: string;
|
|
69
|
-
Options: {
|
|
70
|
-
Value: number;
|
|
71
|
-
Label: {
|
|
72
|
-
UserLocalizedLabel: {
|
|
73
|
-
Label: string;
|
|
74
|
-
LanguageCode: number;
|
|
75
|
-
IsManaged: boolean;
|
|
76
|
-
MetadataId: string;
|
|
77
|
-
HasChanged: boolean;
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
}[];
|
|
81
|
-
} | null;
|
|
82
|
-
};
|
|
83
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,gBAAgB,EAAE,MAAM,CAAC;IACz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,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE;QACT,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE;YACP,KAAK,EAAE,MAAM,CAAC;YACd,KAAK,EAAE;gBACL,kBAAkB,EAAE;oBAClB,KAAK,EAAE,MAAM,CAAC;oBACd,YAAY,EAAE,MAAM,CAAC;oBACrB,SAAS,EAAE,OAAO,CAAC;oBACnB,UAAU,EAAE,MAAM,CAAC;oBACnB,UAAU,EAAE,OAAO,CAAC;iBACrB,CAAC;aACH,CAAC;SACH,EAAE,CAAC;KACL,GAAG,IAAI,CAAC;IACT,eAAe,EAAE;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE;YACP,KAAK,EAAE,MAAM,CAAC;YACd,KAAK,EAAE;gBACL,kBAAkB,EAAE;oBAClB,KAAK,EAAE,MAAM,CAAC;oBACd,YAAY,EAAE,MAAM,CAAC;oBACrB,SAAS,EAAE,OAAO,CAAC;oBACnB,UAAU,EAAE,MAAM,CAAC;oBACnB,UAAU,EAAE,OAAO,CAAC;iBACrB,CAAC;aACH,CAAC;SACH,EAAE,CAAC;KACL,GAAG,IAAI,CAAC;CACV,CAAC"}
|
package/src/lib/common/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/lib/common/types.ts"],"names":[],"mappings":""}
|