@vqnguyen1/piece-narmi 0.0.1

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 ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@vqnguyen1/piece-narmi",
3
+ "version": "0.0.1",
4
+ "license": "MIT",
5
+ "type": "commonjs",
6
+ "main": "./src/index.js",
7
+ "types": "./src/index.d.ts",
8
+ "exports": {
9
+ ".": "./src/index.js"
10
+ },
11
+ "dependencies": {
12
+ "tslib": "^2.3.0"
13
+ },
14
+ "peerDependencies": {
15
+ "@activepieces/pieces-framework": "*",
16
+ "@activepieces/pieces-common": "*",
17
+ "@activepieces/shared": "*"
18
+ }
19
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ export declare const narmiAuth: import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ apiKey: import("@activepieces/pieces-framework").ShortTextProperty<false>;
4
+ }>;
5
+ export declare const narmi: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").CustomAuthProperty<{
6
+ baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
+ apiKey: import("@activepieces/pieces-framework").ShortTextProperty<false>;
8
+ }>>;
package/src/index.js ADDED
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.narmi = exports.narmiAuth = void 0;
4
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
5
+ const shared_1 = require("@activepieces/shared");
6
+ const create_account_application_1 = require("./lib/actions/create-account-application");
7
+ const get_account_application_1 = require("./lib/actions/get-account-application");
8
+ const update_account_application_1 = require("./lib/actions/update-account-application");
9
+ const submit_application_1 = require("./lib/actions/submit-application");
10
+ const run_kyc_1 = require("./lib/actions/run-kyc");
11
+ const get_products_1 = require("./lib/actions/get-products");
12
+ const get_csrf_token_1 = require("./lib/actions/get-csrf-token");
13
+ exports.narmiAuth = pieces_framework_1.PieceAuth.CustomAuth({
14
+ description: 'Narmi Account Opening API credentials',
15
+ required: true,
16
+ props: {
17
+ baseUrl: pieces_framework_1.Property.ShortText({
18
+ displayName: 'Base URL',
19
+ description: 'The base URL for the Narmi API (e.g., https://api.sandbox.narmi.dev)',
20
+ required: true,
21
+ defaultValue: 'https://api.sandbox.narmi.dev',
22
+ }),
23
+ apiKey: pieces_framework_1.Property.ShortText({
24
+ displayName: 'API Key',
25
+ description: 'Your Narmi API Key (OAuth2 token)',
26
+ required: false,
27
+ }),
28
+ },
29
+ });
30
+ exports.narmi = (0, pieces_framework_1.createPiece)({
31
+ displayName: 'Narmi',
32
+ auth: exports.narmiAuth,
33
+ minimumSupportedRelease: '0.20.0',
34
+ logoUrl: 'https://www.narmi.com/favicon.ico',
35
+ authors: ['vqnguyen1'],
36
+ categories: [shared_1.PieceCategory.BUSINESS_INTELLIGENCE],
37
+ actions: [
38
+ get_csrf_token_1.getCsrfToken,
39
+ create_account_application_1.createAccountApplication,
40
+ get_account_application_1.getAccountApplication,
41
+ update_account_application_1.updateAccountApplication,
42
+ submit_application_1.submitApplication,
43
+ run_kyc_1.runKyc,
44
+ get_products_1.getProducts,
45
+ ],
46
+ triggers: [],
47
+ });
48
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/custom/narmi/src/index.ts"],"names":[],"mappings":";;;AAAA,qEAAkF;AAClF,iDAAqD;AACrD,yFAAoF;AACpF,mFAA8E;AAC9E,yFAAoF;AACpF,yEAAqE;AACrE,mDAA+C;AAC/C,6DAAyD;AACzD,iEAA4D;AAE/C,QAAA,SAAS,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC5C,WAAW,EAAE,uCAAuC;IACpD,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACL,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,sEAAsE;YACnF,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,+BAA+B;SAC9C,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,mCAAmC;YAChD,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;CACF,CAAC,CAAC;AAEU,QAAA,KAAK,GAAG,IAAA,8BAAW,EAAC;IAC/B,WAAW,EAAE,OAAO;IACpB,IAAI,EAAE,iBAAS;IACf,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,mCAAmC;IAC5C,OAAO,EAAE,CAAC,WAAW,CAAC;IACtB,UAAU,EAAE,CAAC,sBAAa,CAAC,qBAAqB,CAAC;IACjD,OAAO,EAAE;QACP,6BAAY;QACZ,qDAAwB;QACxB,+CAAqB;QACrB,qDAAwB;QACxB,sCAAiB;QACjB,gBAAM;QACN,0BAAW;KACZ;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare const createAccountApplication: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ apiKey: import("@activepieces/pieces-framework").ShortTextProperty<false>;
4
+ }>, {
5
+ csrfToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
6
+ email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
+ firstName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
8
+ lastName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
+ phone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
+ selectedProducts: import("@activepieces/pieces-framework").ArrayProperty<false>;
11
+ additionalData: import("@activepieces/pieces-framework").JsonProperty<false>;
12
+ }>;
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createAccountApplication = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const pieces_common_1 = require("@activepieces/pieces-common");
7
+ const __1 = require("../..");
8
+ exports.createAccountApplication = (0, pieces_framework_1.createAction)({
9
+ name: 'create_account_application',
10
+ auth: __1.narmiAuth,
11
+ displayName: 'Create Account Application',
12
+ description: 'Create a new account application',
13
+ props: {
14
+ csrfToken: pieces_framework_1.Property.ShortText({
15
+ displayName: 'CSRF Token',
16
+ description: 'CSRF token obtained from GET /csrf endpoint',
17
+ required: true,
18
+ }),
19
+ email: pieces_framework_1.Property.ShortText({
20
+ displayName: 'Email',
21
+ description: 'Email address for the applicant',
22
+ required: true,
23
+ }),
24
+ firstName: pieces_framework_1.Property.ShortText({
25
+ displayName: 'First Name',
26
+ description: 'First name of the applicant',
27
+ required: false,
28
+ }),
29
+ lastName: pieces_framework_1.Property.ShortText({
30
+ displayName: 'Last Name',
31
+ description: 'Last name of the applicant',
32
+ required: false,
33
+ }),
34
+ phone: pieces_framework_1.Property.ShortText({
35
+ displayName: 'Phone',
36
+ description: 'Phone number',
37
+ required: false,
38
+ }),
39
+ selectedProducts: pieces_framework_1.Property.Array({
40
+ displayName: 'Selected Products',
41
+ description: 'Array of product IDs to apply for',
42
+ required: false,
43
+ }),
44
+ additionalData: pieces_framework_1.Property.Json({
45
+ displayName: 'Additional Data',
46
+ description: 'Additional application data as JSON',
47
+ required: false,
48
+ }),
49
+ },
50
+ run(context) {
51
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
52
+ const auth = context.auth;
53
+ const baseUrl = auth.baseUrl;
54
+ const { csrfToken, email, firstName, lastName, phone, selectedProducts, additionalData, } = context.propsValue;
55
+ const body = Object.assign({ email }, (additionalData || {}));
56
+ if (firstName || lastName) {
57
+ body.applicants = [
58
+ {
59
+ first_name: firstName,
60
+ last_name: lastName,
61
+ email,
62
+ phone,
63
+ },
64
+ ];
65
+ }
66
+ if (selectedProducts) {
67
+ body.selected_products = selectedProducts;
68
+ }
69
+ const response = yield pieces_common_1.httpClient.sendRequest({
70
+ method: pieces_common_1.HttpMethod.POST,
71
+ url: `${baseUrl}/v1/account_opening/`,
72
+ headers: {
73
+ 'accept': 'application/json',
74
+ 'Content-Type': 'application/json',
75
+ 'X-CSRFTOKEN': csrfToken,
76
+ },
77
+ body,
78
+ });
79
+ return response.body;
80
+ });
81
+ },
82
+ });
83
+ //# sourceMappingURL=create-account-application.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-account-application.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/custom/narmi/src/lib/actions/create-account-application.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,+DAAqE;AACrE,6BAAkC;AAErB,QAAA,wBAAwB,GAAG,IAAA,+BAAY,EAAC;IACnD,IAAI,EAAE,4BAA4B;IAClC,IAAI,EAAE,aAAS;IACf,WAAW,EAAE,4BAA4B;IACzC,WAAW,EAAE,kCAAkC;IAC/C,KAAK,EAAE;QACL,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,6CAA6C;YAC1D,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,iCAAiC;YAC9C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,6BAA6B;YAC1C,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,4BAA4B;YACzC,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YAC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QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const getAccountApplication: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ apiKey: import("@activepieces/pieces-framework").ShortTextProperty<false>;
4
+ }>, {
5
+ uuid: import("@activepieces/pieces-framework").ShortTextProperty<true>;
6
+ csrfToken: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
+ }>;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAccountApplication = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const pieces_common_1 = require("@activepieces/pieces-common");
7
+ const __1 = require("../..");
8
+ exports.getAccountApplication = (0, pieces_framework_1.createAction)({
9
+ name: 'get_account_application',
10
+ auth: __1.narmiAuth,
11
+ displayName: 'Get Account Application',
12
+ description: 'Get an account application by UUID',
13
+ props: {
14
+ uuid: pieces_framework_1.Property.ShortText({
15
+ displayName: 'Application UUID',
16
+ description: 'The UUID of the account application',
17
+ required: true,
18
+ }),
19
+ csrfToken: pieces_framework_1.Property.ShortText({
20
+ displayName: 'CSRF Token',
21
+ description: 'CSRF token obtained from GET /csrf endpoint',
22
+ required: false,
23
+ }),
24
+ },
25
+ run(context) {
26
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
27
+ const auth = context.auth;
28
+ const baseUrl = auth.baseUrl;
29
+ const { uuid, csrfToken } = context.propsValue;
30
+ const headers = {
31
+ 'accept': 'application/json',
32
+ };
33
+ if (csrfToken) {
34
+ headers['X-CSRFTOKEN'] = csrfToken;
35
+ }
36
+ const response = yield pieces_common_1.httpClient.sendRequest({
37
+ method: pieces_common_1.HttpMethod.GET,
38
+ url: `${baseUrl}/v1/account_opening/${uuid}/`,
39
+ headers,
40
+ });
41
+ return response.body;
42
+ });
43
+ },
44
+ });
45
+ //# sourceMappingURL=get-account-application.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-account-application.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/custom/narmi/src/lib/actions/get-account-application.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,+DAAqE;AACrE,6BAAkC;AAErB,QAAA,qBAAqB,GAAG,IAAA,+BAAY,EAAC;IAChD,IAAI,EAAE,yBAAyB;IAC/B,IAAI,EAAE,aAAS;IACf,WAAW,EAAE,yBAAyB;IACtC,WAAW,EAAE,oCAAoC;IACjD,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,kBAAkB;YAC/B,WAAW,EAAE,qCAAqC;YAClD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,6CAA6C;YAC1D,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,IAAI,GAAG,OAAO,CAAC,IAAW,CAAC;YACjC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;YAC7B,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAE/C,MAAM,OAAO,GAA2B;gBACtC,QAAQ,EAAE,kBAAkB;aAC7B,CAAC;YAEF,IAAI,SAAS,EAAE,CAAC;gBACd,OAAO,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC;YACrC,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,OAAO,uBAAuB,IAAI,GAAG;gBAC7C,OAAO;aACR,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const getCsrfToken: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ apiKey: import("@activepieces/pieces-framework").ShortTextProperty<false>;
4
+ }>, {
5
+ hasApplicantToken: import("@activepieces/pieces-framework").CheckboxProperty<false>;
6
+ }>;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCsrfToken = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const pieces_common_1 = require("@activepieces/pieces-common");
7
+ const __1 = require("../..");
8
+ exports.getCsrfToken = (0, pieces_framework_1.createAction)({
9
+ name: 'get_csrf_token',
10
+ auth: __1.narmiAuth,
11
+ displayName: 'Get CSRF Token',
12
+ description: 'Get a CSRF token for making authenticated requests',
13
+ props: {
14
+ hasApplicantToken: pieces_framework_1.Property.Checkbox({
15
+ displayName: 'Has Applicant Token',
16
+ description: 'Set to true if you have an applicant_token cookie to get an authenticated CSRF token',
17
+ required: false,
18
+ defaultValue: false,
19
+ }),
20
+ },
21
+ run(context) {
22
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
+ var _a;
24
+ const auth = context.auth;
25
+ const baseUrl = auth.baseUrl;
26
+ const { hasApplicantToken } = context.propsValue;
27
+ const response = yield pieces_common_1.httpClient.sendRequest({
28
+ method: pieces_common_1.HttpMethod.GET,
29
+ url: `${baseUrl}/v1/csrf/`,
30
+ headers: {
31
+ 'accept': 'application/json',
32
+ },
33
+ });
34
+ return {
35
+ success: true,
36
+ csrfToken: ((_a = response.headers) === null || _a === void 0 ? void 0 : _a['x-csrftoken']) || '',
37
+ body: response.body,
38
+ };
39
+ });
40
+ },
41
+ });
42
+ //# sourceMappingURL=get-csrf-token.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-csrf-token.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/custom/narmi/src/lib/actions/get-csrf-token.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,+DAAqE;AACrE,6BAAkC;AAErB,QAAA,YAAY,GAAG,IAAA,+BAAY,EAAC;IACvC,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,aAAS;IACf,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,oDAAoD;IACjE,KAAK,EAAE;QACL,iBAAiB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACnC,WAAW,EAAE,qBAAqB;YAClC,WAAW,EAAE,sFAAsF;YACnG,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,KAAK;SACpB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,IAAI,GAAG,OAAO,CAAC,IAAW,CAAC;YACjC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;YAC7B,MAAM,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEjD,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,OAAO,WAAW;gBAC1B,OAAO,EAAE;oBACP,QAAQ,EAAE,kBAAkB;iBAC7B;aACF,CAAC,CAAC;YAEH,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,CAAA,MAAA,QAAQ,CAAC,OAAO,0CAAG,aAAa,CAAC,KAAI,EAAE;gBAClD,IAAI,EAAE,QAAQ,CAAC,IAAI;aACpB,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const getProducts: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ apiKey: import("@activepieces/pieces-framework").ShortTextProperty<false>;
4
+ }>, {}>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getProducts = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const pieces_common_1 = require("@activepieces/pieces-common");
7
+ const __1 = require("../..");
8
+ exports.getProducts = (0, pieces_framework_1.createAction)({
9
+ name: 'get_products',
10
+ auth: __1.narmiAuth,
11
+ displayName: 'Get Products',
12
+ description: 'Get list of available Account Opening products',
13
+ props: {},
14
+ run(context) {
15
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
16
+ const auth = context.auth;
17
+ const baseUrl = auth.baseUrl;
18
+ const apiKey = auth.apiKey;
19
+ const headers = {
20
+ 'accept': 'application/json',
21
+ };
22
+ if (apiKey) {
23
+ headers['Authorization'] = `Bearer ${apiKey}`;
24
+ }
25
+ const response = yield pieces_common_1.httpClient.sendRequest({
26
+ method: pieces_common_1.HttpMethod.GET,
27
+ url: `${baseUrl}/v1/products/`,
28
+ headers,
29
+ });
30
+ return response.body;
31
+ });
32
+ },
33
+ });
34
+ //# sourceMappingURL=get-products.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-products.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/custom/narmi/src/lib/actions/get-products.ts"],"names":[],"mappings":";;;;AAAA,qEAEwC;AACxC,+DAAqE;AACrE,6BAAkC;AAErB,QAAA,WAAW,GAAG,IAAA,+BAAY,EAAC;IACtC,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,aAAS;IACf,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,gDAAgD;IAC7D,KAAK,EAAE,EAAE;IACH,GAAG,CAAC,OAAO;;YACf,MAAM,IAAI,GAAG,OAAO,CAAC,IAAW,CAAC;YACjC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;YAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;YAE3B,MAAM,OAAO,GAA2B;gBACtC,QAAQ,EAAE,kBAAkB;aAC7B,CAAC;YAEF,IAAI,MAAM,EAAE,CAAC;gBACX,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,MAAM,EAAE,CAAC;YAChD,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,OAAO,eAAe;gBAC9B,OAAO;aACR,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const runKyc: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ apiKey: import("@activepieces/pieces-framework").ShortTextProperty<false>;
4
+ }>, {
5
+ uuid: import("@activepieces/pieces-framework").ShortTextProperty<true>;
6
+ csrfToken: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
+ }>;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runKyc = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const pieces_common_1 = require("@activepieces/pieces-common");
7
+ const __1 = require("../..");
8
+ exports.runKyc = (0, pieces_framework_1.createAction)({
9
+ name: 'run_kyc',
10
+ auth: __1.narmiAuth,
11
+ displayName: 'Run KYC',
12
+ description: 'Initiate KYC execution for an account application',
13
+ props: {
14
+ uuid: pieces_framework_1.Property.ShortText({
15
+ displayName: 'Application UUID',
16
+ description: 'The UUID of the account application',
17
+ required: true,
18
+ }),
19
+ csrfToken: pieces_framework_1.Property.ShortText({
20
+ displayName: 'CSRF Token',
21
+ description: 'CSRF token obtained from GET /csrf endpoint',
22
+ required: false,
23
+ }),
24
+ },
25
+ run(context) {
26
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
27
+ const auth = context.auth;
28
+ const baseUrl = auth.baseUrl;
29
+ const { uuid, csrfToken } = context.propsValue;
30
+ const headers = {
31
+ 'accept': 'application/json',
32
+ 'Content-Type': 'application/json',
33
+ };
34
+ if (csrfToken) {
35
+ headers['X-CSRFTOKEN'] = csrfToken;
36
+ }
37
+ const response = yield pieces_common_1.httpClient.sendRequest({
38
+ method: pieces_common_1.HttpMethod.POST,
39
+ url: `${baseUrl}/v1/account_opening/${uuid}/kyc/`,
40
+ headers,
41
+ body: {},
42
+ });
43
+ return response.body;
44
+ });
45
+ },
46
+ });
47
+ //# sourceMappingURL=run-kyc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-kyc.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/custom/narmi/src/lib/actions/run-kyc.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,+DAAqE;AACrE,6BAAkC;AAErB,QAAA,MAAM,GAAG,IAAA,+BAAY,EAAC;IACjC,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,aAAS;IACf,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,mDAAmD;IAChE,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,kBAAkB;YAC/B,WAAW,EAAE,qCAAqC;YAClD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,6CAA6C;YAC1D,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,IAAI,GAAG,OAAO,CAAC,IAAW,CAAC;YACjC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;YAC7B,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAE/C,MAAM,OAAO,GAA2B;gBACtC,QAAQ,EAAE,kBAAkB;gBAC5B,cAAc,EAAE,kBAAkB;aACnC,CAAC;YAEF,IAAI,SAAS,EAAE,CAAC;gBACd,OAAO,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC;YACrC,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,GAAG,OAAO,uBAAuB,IAAI,OAAO;gBACjD,OAAO;gBACP,IAAI,EAAE,EAAE;aACT,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare const submitApplication: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ apiKey: import("@activepieces/pieces-framework").ShortTextProperty<false>;
4
+ }>, {
5
+ uuid: import("@activepieces/pieces-framework").ShortTextProperty<true>;
6
+ csrfToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
+ selectedProducts: import("@activepieces/pieces-framework").ArrayProperty<true>;
8
+ deviceId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
+ utmSource: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
+ }>;
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.submitApplication = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const pieces_common_1 = require("@activepieces/pieces-common");
7
+ const __1 = require("../..");
8
+ exports.submitApplication = (0, pieces_framework_1.createAction)({
9
+ name: 'submit_application',
10
+ auth: __1.narmiAuth,
11
+ displayName: 'Submit Application',
12
+ description: 'Submit an account application for processing',
13
+ props: {
14
+ uuid: pieces_framework_1.Property.ShortText({
15
+ displayName: 'Application UUID',
16
+ description: 'The UUID of the account application to submit',
17
+ required: true,
18
+ }),
19
+ csrfToken: pieces_framework_1.Property.ShortText({
20
+ displayName: 'CSRF Token',
21
+ description: 'CSRF token obtained from GET /csrf endpoint',
22
+ required: true,
23
+ }),
24
+ selectedProducts: pieces_framework_1.Property.Array({
25
+ displayName: 'Selected Products',
26
+ description: 'Array of product objects to submit with the application',
27
+ required: true,
28
+ }),
29
+ deviceId: pieces_framework_1.Property.ShortText({
30
+ displayName: 'Device ID',
31
+ description: 'Device ID to include in metadata (optional)',
32
+ required: false,
33
+ }),
34
+ utmSource: pieces_framework_1.Property.ShortText({
35
+ displayName: 'UTM Source',
36
+ description: 'UTM source to include in metadata (optional)',
37
+ required: false,
38
+ }),
39
+ },
40
+ run(context) {
41
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
42
+ const auth = context.auth;
43
+ const baseUrl = auth.baseUrl;
44
+ const { uuid, csrfToken, selectedProducts, deviceId, utmSource } = context.propsValue;
45
+ const body = {
46
+ selected_products: selectedProducts,
47
+ };
48
+ if (deviceId) {
49
+ body.device_id = deviceId;
50
+ }
51
+ if (utmSource) {
52
+ body.utm_source = utmSource;
53
+ }
54
+ const response = yield pieces_common_1.httpClient.sendRequest({
55
+ method: pieces_common_1.HttpMethod.POST,
56
+ url: `${baseUrl}/v1/account_opening/${uuid}/`,
57
+ headers: {
58
+ 'accept': 'application/json',
59
+ 'Content-Type': 'application/json',
60
+ 'X-CSRFTOKEN': csrfToken,
61
+ },
62
+ body,
63
+ });
64
+ return response.body;
65
+ });
66
+ },
67
+ });
68
+ //# sourceMappingURL=submit-application.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"submit-application.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/custom/narmi/src/lib/actions/submit-application.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,+DAAqE;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AC;YAC5B,CAAC;YAED,IAAI,SAAS,EAAE,CAAC;gBACd,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;YAC9B,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,GAAG,OAAO,uBAAuB,IAAI,GAAG;gBAC7C,OAAO,EAAE;oBACP,QAAQ,EAAE,kBAAkB;oBAC5B,cAAc,EAAE,kBAAkB;oBAClC,aAAa,EAAE,SAAS;iBACzB;gBACD,IAAI;aACL,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const updateAccountApplication: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ apiKey: import("@activepieces/pieces-framework").ShortTextProperty<false>;
4
+ }>, {
5
+ uuid: import("@activepieces/pieces-framework").ShortTextProperty<true>;
6
+ csrfToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
+ updateData: import("@activepieces/pieces-framework").JsonProperty<true>;
8
+ }>;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateAccountApplication = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const pieces_common_1 = require("@activepieces/pieces-common");
7
+ const __1 = require("../..");
8
+ exports.updateAccountApplication = (0, pieces_framework_1.createAction)({
9
+ name: 'update_account_application',
10
+ auth: __1.narmiAuth,
11
+ displayName: 'Update Account Application',
12
+ description: 'Update an existing account application',
13
+ props: {
14
+ uuid: pieces_framework_1.Property.ShortText({
15
+ displayName: 'Application UUID',
16
+ description: 'The UUID of the account application to update',
17
+ required: true,
18
+ }),
19
+ csrfToken: pieces_framework_1.Property.ShortText({
20
+ displayName: 'CSRF Token',
21
+ description: 'CSRF token obtained from GET /csrf endpoint',
22
+ required: true,
23
+ }),
24
+ updateData: pieces_framework_1.Property.Json({
25
+ displayName: 'Update Data',
26
+ description: 'JSON object containing the fields to update (e.g., applicants, selected_products, funding)',
27
+ required: true,
28
+ }),
29
+ },
30
+ run(context) {
31
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
32
+ const auth = context.auth;
33
+ const baseUrl = auth.baseUrl;
34
+ const { uuid, csrfToken, updateData } = context.propsValue;
35
+ const response = yield pieces_common_1.httpClient.sendRequest({
36
+ method: pieces_common_1.HttpMethod.PUT,
37
+ url: `${baseUrl}/v1/account_opening/${uuid}/`,
38
+ headers: {
39
+ 'accept': 'application/json',
40
+ 'Content-Type': 'application/json',
41
+ 'X-CSRFTOKEN': csrfToken,
42
+ },
43
+ body: updateData,
44
+ });
45
+ return response.body;
46
+ });
47
+ },
48
+ });
49
+ //# sourceMappingURL=update-account-application.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-account-application.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/custom/narmi/src/lib/actions/update-account-application.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,+DAAqE;AACrE,6BAAkC;AAErB,QAAA,wBAAwB,GAAG,IAAA,+BAAY,EAAC;IACnD,IAAI,EAAE,4BAA4B;IAClC,IAAI,EAAE,aAAS;IACf,WAAW,EAAE,4BAA4B;IACzC,WAAW,EAAE,wCAAwC;IACrD,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,kBAAkB;YAC/B,WAAW,EAAE,+CAA+C;YAC5D,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,6CAA6C;YAC1D,QAAQ,EAAE,IAAI;SACf,CAAC;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