@managespace/sdk 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/.eslintrc.js +9 -0
- package/.prettierrc.js +4 -0
- package/CHANGELOG.md +934 -0
- package/README.md +6 -0
- package/package.json +21 -0
- package/src/extensibility/functions/extensibility-function.ts +20 -0
- package/src/extensibility/functions/index.ts +2 -0
- package/src/extensibility/functions/project/all-topics.ts +34 -0
- package/src/extensibility/functions/project/billing.ts +249 -0
- package/src/extensibility/functions/project/document.ts +39 -0
- package/src/extensibility/functions/project/index.ts +5 -0
- package/src/extensibility/functions/project/managespace.ts +95 -0
- package/src/extensibility/functions/project/topics.type.ts +16 -0
- package/src/extensibility/index.ts +4 -0
- package/src/extensibility/types/control.ts +48 -0
- package/src/extensibility/types/default-result.ts +25 -0
- package/src/extensibility/types/extensibility.ts +12 -0
- package/src/extensibility/types/index.ts +5 -0
- package/src/extensibility/types/mapped-ports.ts +13 -0
- package/src/extensibility/types/step-function-signature.ts +11 -0
- package/src/extensibility/types/workflow-step.ts +63 -0
- package/src/extensibility/utils/index.ts +1 -0
- package/src/extensibility/utils/port.enum.ts +5 -0
- package/src/extensibility/workflow/index.ts +2 -0
- package/src/extensibility/workflow/workflow-step.ts +23 -0
- package/src/extensibility/workflow/workflow.ts +25 -0
- package/src/generated/.openapi-generator/FILES +9 -0
- package/src/generated/.openapi-generator/VERSION +1 -0
- package/src/generated/.openapi-generator-ignore +23 -0
- package/src/generated/api.ts +19623 -0
- package/src/generated/base.ts +86 -0
- package/src/generated/common.ts +150 -0
- package/src/generated/configuration.ts +110 -0
- package/src/generated/git_push.sh +57 -0
- package/src/generated/index.ts +18 -0
- package/src/index.ts +2 -0
- package/tsconfig.json +10 -0
package/README.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@managespace/sdk",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"lint:check": "eslint .",
|
|
6
|
+
"lint:fix": "eslint --fix ."
|
|
7
|
+
},
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./src/index.ts"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"tslib": "^2.4.0",
|
|
13
|
+
"zod": "^3.23.8"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@types/node": "^12",
|
|
17
|
+
"typescript": "^4.0",
|
|
18
|
+
"@repo/eslint-config": "*",
|
|
19
|
+
"@repo/typescript-config": "*"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DefaultApi } from '../../generated';
|
|
2
|
+
import { ExtReturnType } from '../types';
|
|
3
|
+
import { ExtPlugin, ExtBasePayload } from '../types';
|
|
4
|
+
|
|
5
|
+
export const defineExFn = <T extends ExtPlugin>(
|
|
6
|
+
callback: (
|
|
7
|
+
payload: ExtBasePayload & T['payload'],
|
|
8
|
+
api: DefaultApi,
|
|
9
|
+
) => Promise<ExtReturnType<T['responseType']>>,
|
|
10
|
+
) => {
|
|
11
|
+
// let fnDescription = 'some default description';
|
|
12
|
+
|
|
13
|
+
return {
|
|
14
|
+
message: 'anything here that could help with AST',
|
|
15
|
+
// setDescription: (description: string) => {
|
|
16
|
+
// fnDescription = description;
|
|
17
|
+
// },
|
|
18
|
+
callback,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// import * as Projects from "./index";
|
|
2
|
+
// import importSync from "import-sync";
|
|
3
|
+
// import { Billing } from './billing';
|
|
4
|
+
// import { Document } from './document';
|
|
5
|
+
import { ManageSpace } from './managespace';
|
|
6
|
+
|
|
7
|
+
// const foundTopics: string[] = [...Object.keys(Billing).map((topic) => `Billing.${topic}`)];
|
|
8
|
+
|
|
9
|
+
// Object.keys(Projects).forEach((project) => {
|
|
10
|
+
// const importedProject = importSync(`./${project}`);
|
|
11
|
+
// Object.keys(importedProject).forEach((topic) => {
|
|
12
|
+
// topics.push(`${project}.${topic}`);
|
|
13
|
+
// });
|
|
14
|
+
// });
|
|
15
|
+
|
|
16
|
+
// TODO: Ensure all these events exist in the new project/naming structure
|
|
17
|
+
// account_created
|
|
18
|
+
// catalog_updated
|
|
19
|
+
// invoice_created
|
|
20
|
+
// subscription_created
|
|
21
|
+
// move_in_requested
|
|
22
|
+
// move_out_requested
|
|
23
|
+
// create_calendar_event
|
|
24
|
+
// document_required
|
|
25
|
+
// catalog_created
|
|
26
|
+
// create_customer
|
|
27
|
+
// create_contact
|
|
28
|
+
// send_sms
|
|
29
|
+
|
|
30
|
+
export const allTopics = [
|
|
31
|
+
// ...Object.keys(Billing).map((topic) => `Billing.${topic}`),
|
|
32
|
+
// ...Object.keys(Document).map((topic) => `Document.${topic}`),
|
|
33
|
+
...Object.keys(ManageSpace).map((topic) => `ManageSpace.${topic}`),
|
|
34
|
+
];
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-namespace */
|
|
2
|
+
import {
|
|
3
|
+
BillingRunResponse,
|
|
4
|
+
ChargeResponse,
|
|
5
|
+
InvoiceResponse,
|
|
6
|
+
CreateBillingRun as CreateBillingRunPayload,
|
|
7
|
+
CreatePaymentRun as CreatePaymentRunPayload,
|
|
8
|
+
CustomChartOfAccounts,
|
|
9
|
+
CustomerResponse,
|
|
10
|
+
SubscriptionResponse,
|
|
11
|
+
ProductBillingResponse,
|
|
12
|
+
PlanResponse,
|
|
13
|
+
PaymentRunResponse,
|
|
14
|
+
CustomerId,
|
|
15
|
+
GetContactResponse,
|
|
16
|
+
GetCustomerResponse,
|
|
17
|
+
CreateProductBilling,
|
|
18
|
+
CreatePlanBilling,
|
|
19
|
+
CustomUpdateCustomer,
|
|
20
|
+
ChartOfAccountResponse,
|
|
21
|
+
ChartOfAccountsResponse,
|
|
22
|
+
RevenueRuleResponse,
|
|
23
|
+
CreateSubscriptionBilling,
|
|
24
|
+
CreatePaymentBilling,
|
|
25
|
+
PaymentResponse,
|
|
26
|
+
StatementResponse,
|
|
27
|
+
CancelSubscriptionBilling,
|
|
28
|
+
} from '../../../generated';
|
|
29
|
+
import { ExtPlugin } from '../../types';
|
|
30
|
+
// TODO: import this from common, import it all from common ideally
|
|
31
|
+
type BasePaginationQuery = { offset: number; limit: number };
|
|
32
|
+
|
|
33
|
+
export namespace Billing {
|
|
34
|
+
export class CreateBillingRun implements ExtPlugin {
|
|
35
|
+
responseType!: BillingRunResponse;
|
|
36
|
+
payload!: { createBillingRunPayload: CreateBillingRunPayload };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export class CreatePaymentRun implements ExtPlugin {
|
|
40
|
+
responseType!: PaymentRunResponse;
|
|
41
|
+
payload!: { createPaymentRunPayload: CreatePaymentRunPayload };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export class CreateChartOfAccounts implements ExtPlugin {
|
|
45
|
+
responseType!: ChartOfAccountsResponse;
|
|
46
|
+
payload!: { chartOfAccountPayload: CustomChartOfAccounts };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//TODO: Use SiteId instead of string?
|
|
50
|
+
export class CreateContact implements ExtPlugin {
|
|
51
|
+
responseType!: GetContactResponse;
|
|
52
|
+
payload!: {
|
|
53
|
+
siteId: string;
|
|
54
|
+
contactId: string;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export class ContactCreated implements ExtPlugin {
|
|
59
|
+
responseType!: any;
|
|
60
|
+
payload!: any;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export class CreateCustomer implements ExtPlugin {
|
|
64
|
+
responseType!: GetCustomerResponse;
|
|
65
|
+
payload!: {
|
|
66
|
+
siteId: string;
|
|
67
|
+
customerId: string;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export class CustomerCreated implements ExtPlugin {
|
|
72
|
+
responseType!: any;
|
|
73
|
+
payload!: any;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export class GetBillingRuns implements ExtPlugin {
|
|
77
|
+
responseType!: BillingRunResponse[];
|
|
78
|
+
payload!: BasePaginationQuery;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export class GetBillingRun implements ExtPlugin {
|
|
82
|
+
responseType!: BillingRunResponse;
|
|
83
|
+
payload!: { billingRunId: string };
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export class GetCharges implements ExtPlugin {
|
|
87
|
+
responseType!: ChargeResponse[];
|
|
88
|
+
payload!: { planId: string } & BasePaginationQuery;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export class GetCharge implements ExtPlugin {
|
|
92
|
+
responseType!: ChargeResponse;
|
|
93
|
+
payload!: { planId: string; chargeId: string };
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export class GetCustomers implements ExtPlugin {
|
|
97
|
+
responseType!: CustomerResponse[];
|
|
98
|
+
payload!: BasePaginationQuery;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export class GetCustomer implements ExtPlugin {
|
|
102
|
+
responseType!: CustomerResponse;
|
|
103
|
+
payload!: { customerId: CustomerId };
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export class GetInvoices implements ExtPlugin {
|
|
107
|
+
responseType!: InvoiceResponse[];
|
|
108
|
+
payload!: BasePaginationQuery;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export class GetInvoice implements ExtPlugin {
|
|
112
|
+
responseType!: InvoiceResponse;
|
|
113
|
+
payload!: {
|
|
114
|
+
invoiceId: string;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export class GetPaymentRuns implements ExtPlugin {
|
|
119
|
+
responseType!: PaymentRunResponse[];
|
|
120
|
+
payload!: BasePaginationQuery;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export class GetPaymentRun implements ExtPlugin {
|
|
124
|
+
responseType!: PaymentRunResponse;
|
|
125
|
+
payload!: { paymentRunId: string };
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export class GetPayments implements ExtPlugin {
|
|
129
|
+
responseType!: PaymentResponse[];
|
|
130
|
+
payload!: BasePaginationQuery;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export class GetPayment implements ExtPlugin {
|
|
134
|
+
responseType!: PaymentResponse;
|
|
135
|
+
payload!: { paymentId: string };
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export class GetPlans implements ExtPlugin {
|
|
139
|
+
responseType!: PlanResponse[];
|
|
140
|
+
payload!: BasePaginationQuery & { name?: string; active?: boolean };
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export class GetPlan implements ExtPlugin {
|
|
144
|
+
responseType!: PlanResponse;
|
|
145
|
+
payload!: { planId: string };
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export class GetProducts implements ExtPlugin {
|
|
149
|
+
responseType!: ProductBillingResponse[];
|
|
150
|
+
payload!: BasePaginationQuery;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export class GetProduct implements ExtPlugin {
|
|
154
|
+
responseType!: ProductBillingResponse;
|
|
155
|
+
payload!: { productId: string };
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export class GetSubscriptions implements ExtPlugin {
|
|
159
|
+
responseType!: SubscriptionResponse[];
|
|
160
|
+
payload!: BasePaginationQuery & { assetId?: string };
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export class GetSubscription implements ExtPlugin {
|
|
164
|
+
responseType!: SubscriptionResponse;
|
|
165
|
+
payload!: { subscriptionId: string };
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export class CreateProduct implements ExtPlugin {
|
|
169
|
+
responseType!: ProductBillingResponse;
|
|
170
|
+
payload!: { createProductPayload: CreateProductBilling };
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export class CreatePlan implements ExtPlugin {
|
|
174
|
+
responseType!: PlanResponse;
|
|
175
|
+
payload!: {
|
|
176
|
+
createPlanPayload: CreatePlanBilling;
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export class UpdateCustomer implements ExtPlugin {
|
|
181
|
+
responseType!: GetCustomerResponse;
|
|
182
|
+
payload!: {
|
|
183
|
+
siteId: string;
|
|
184
|
+
customerId: string;
|
|
185
|
+
updateCustomerPayload: CustomUpdateCustomer;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export class GetChartOfAccount implements ExtPlugin {
|
|
190
|
+
responseType!: ChartOfAccountResponse;
|
|
191
|
+
payload!: {
|
|
192
|
+
siteId: string;
|
|
193
|
+
chartOfAccountId: string;
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export class GetChartOfAccounts implements ExtPlugin {
|
|
198
|
+
responseType!: ChartOfAccountResponse[];
|
|
199
|
+
payload!: BasePaginationQuery;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export class GetRevenueRule implements ExtPlugin {
|
|
203
|
+
responseType!: RevenueRuleResponse;
|
|
204
|
+
payload!: { revenueRuleId: string };
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export class GetRevenueRules implements ExtPlugin {
|
|
208
|
+
responseType!: RevenueRuleResponse[];
|
|
209
|
+
payload!: BasePaginationQuery;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export class CreateSubscription implements ExtPlugin {
|
|
213
|
+
responseType!: SubscriptionResponse;
|
|
214
|
+
payload!: { createSubscriptionPayload: CreateSubscriptionBilling };
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export class CreatePayment implements ExtPlugin {
|
|
218
|
+
responseType!: PaymentResponse;
|
|
219
|
+
payload!: { createPaymentPayload: CreatePaymentBilling };
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export class GetStatements implements ExtPlugin {
|
|
223
|
+
responseType!: StatementResponse[];
|
|
224
|
+
payload!: BasePaginationQuery;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export class GetStatement implements ExtPlugin {
|
|
228
|
+
responseType!: StatementResponse;
|
|
229
|
+
payload!: { statementId: string };
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export class PaymentCreated implements ExtPlugin {
|
|
233
|
+
responseType!: any;
|
|
234
|
+
payload!: any;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export class InvoiceCreated implements ExtPlugin {
|
|
238
|
+
responseType!: any;
|
|
239
|
+
payload!: any;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export class CancelSubscription implements ExtPlugin {
|
|
243
|
+
responseType!: SubscriptionResponse;
|
|
244
|
+
payload!: {
|
|
245
|
+
subscriptionId: string;
|
|
246
|
+
cancelSubscriptionPayload: CancelSubscriptionBilling;
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-namespace */
|
|
2
|
+
import {
|
|
3
|
+
DocumentUrlsResponse,
|
|
4
|
+
CreateTemplate as CreateTemplatePayload,
|
|
5
|
+
} from '../../../generated';
|
|
6
|
+
import { ExtPlugin } from '../../types';
|
|
7
|
+
|
|
8
|
+
export namespace Document {
|
|
9
|
+
export class Create implements ExtPlugin {
|
|
10
|
+
responseType!: DocumentUrlsResponse;
|
|
11
|
+
payload!: {
|
|
12
|
+
context: string;
|
|
13
|
+
contactId?: string;
|
|
14
|
+
customerId?: string;
|
|
15
|
+
userId?: string;
|
|
16
|
+
assetId?: string;
|
|
17
|
+
workflowId?: string;
|
|
18
|
+
workflowStepId?: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export class CreateTemplate implements ExtPlugin {
|
|
22
|
+
responseType!: any;
|
|
23
|
+
payload!: CreateTemplatePayload;
|
|
24
|
+
}
|
|
25
|
+
export class Signed implements ExtPlugin {
|
|
26
|
+
responseType!: any;
|
|
27
|
+
payload!: {
|
|
28
|
+
orgId: string;
|
|
29
|
+
siteId: string;
|
|
30
|
+
documentId: string;
|
|
31
|
+
contactId: string;
|
|
32
|
+
customerId: string;
|
|
33
|
+
assetId: string;
|
|
34
|
+
workflowId: string;
|
|
35
|
+
workflowStepId: string;
|
|
36
|
+
allSignaturesGathered: boolean;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-namespace */
|
|
2
|
+
import {
|
|
3
|
+
CustomerResponse,
|
|
4
|
+
CustomAddCustomerContact,
|
|
5
|
+
WorkflowStepInstanceResponse,
|
|
6
|
+
WorkflowInstanceResponse,
|
|
7
|
+
} from '../../../generated';
|
|
8
|
+
import { ExtPlugin } from '../../types';
|
|
9
|
+
|
|
10
|
+
export namespace ManageSpace {
|
|
11
|
+
export class SmartBarRequest<
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13
|
+
TIntent extends string,
|
|
14
|
+
TEntities extends string[],
|
|
15
|
+
> implements ExtPlugin
|
|
16
|
+
{
|
|
17
|
+
responseType!: string[];
|
|
18
|
+
payload!: Record<TEntities[number], string | null> & {
|
|
19
|
+
userEmail: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
24
|
+
export class HandleEvent<JsonAta extends string> implements ExtPlugin {
|
|
25
|
+
responseType!: any;
|
|
26
|
+
payload!: any;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export class SubscriptionCreated implements ExtPlugin {
|
|
30
|
+
responseType!: any;
|
|
31
|
+
payload!: {
|
|
32
|
+
subscriptionId: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export class CreateMoveIn implements ExtPlugin {
|
|
37
|
+
responseType!: any;
|
|
38
|
+
payload!: any;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export class CreateMoveOut implements ExtPlugin {
|
|
42
|
+
responseType!: any;
|
|
43
|
+
payload!: any;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export class TestManualInput implements ExtPlugin {
|
|
47
|
+
responseType!: any;
|
|
48
|
+
payload!: any;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export class CustomerCreated implements ExtPlugin {
|
|
52
|
+
responseType!: any;
|
|
53
|
+
payload!: { customerId: string };
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export class CustomerUpdated implements ExtPlugin {
|
|
57
|
+
responseType!: any;
|
|
58
|
+
payload!: CustomerResponse & { customerId: string };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export class CustomerContactCreated implements ExtPlugin {
|
|
62
|
+
responseType!: any;
|
|
63
|
+
payload!: CustomAddCustomerContact & { customerId: string };
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export class ContactCreated implements ExtPlugin {
|
|
67
|
+
responseType!: any;
|
|
68
|
+
payload!: { contactId: string };
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export class WorkflowStepReady implements ExtPlugin {
|
|
72
|
+
responseType!: any;
|
|
73
|
+
payload!: WorkflowStepInstanceResponse;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export class WorkflowInstanceCreated implements ExtPlugin {
|
|
77
|
+
responseType!: any;
|
|
78
|
+
payload!: WorkflowInstanceResponse;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export class RepositoryUpdated implements ExtPlugin {
|
|
82
|
+
responseType!: any;
|
|
83
|
+
payload!: { branch: string; commit: string };
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export class JasonTestEvent implements ExtPlugin {
|
|
87
|
+
responseType!: any;
|
|
88
|
+
payload!: any;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export class JacksonTestEvent implements ExtPlugin {
|
|
92
|
+
responseType!: any;
|
|
93
|
+
payload!: any;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type Topics =
|
|
2
|
+
| 'ManageSpace.SmartBarRequest'
|
|
3
|
+
| 'ManageSpace.HandleEvent'
|
|
4
|
+
| 'ManageSpace.SubscriptionCreated'
|
|
5
|
+
| 'ManageSpace.CreateMoveIn'
|
|
6
|
+
| 'ManageSpace.CreateMoveOut'
|
|
7
|
+
| 'ManageSpace.TestManualInput'
|
|
8
|
+
| 'ManageSpace.CustomerCreated'
|
|
9
|
+
| 'ManageSpace.CustomerUpdated'
|
|
10
|
+
| 'ManageSpace.CustomerContactCreated'
|
|
11
|
+
| 'ManageSpace.ContactCreated'
|
|
12
|
+
| 'ManageSpace.WorkflowStepReady'
|
|
13
|
+
| 'ManageSpace.WorkflowInstanceCreated'
|
|
14
|
+
| 'ManageSpace.RepositoryUpdated'
|
|
15
|
+
| 'ManageSpace.JasonTestEvent'
|
|
16
|
+
| 'ManageSpace.JacksonTestEvent';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// import { ApiFunctions } from '.';
|
|
2
|
+
|
|
3
|
+
export type ControlValidation = {
|
|
4
|
+
type: string;
|
|
5
|
+
pattern: string;
|
|
6
|
+
errorMessage: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type PageControl = {
|
|
10
|
+
label: string;
|
|
11
|
+
type:
|
|
12
|
+
| 'number'
|
|
13
|
+
| 'text'
|
|
14
|
+
| 'date'
|
|
15
|
+
| 'checkbox'
|
|
16
|
+
| 'textarea'
|
|
17
|
+
| 'asset'
|
|
18
|
+
| 'customer'
|
|
19
|
+
| 'contact'
|
|
20
|
+
| 'user';
|
|
21
|
+
responseField: string;
|
|
22
|
+
required: boolean;
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
validation?: ControlValidation;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type SectionLayout = {
|
|
28
|
+
columns?: number;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type PageSection = {
|
|
32
|
+
heading: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
layout?: SectionLayout;
|
|
35
|
+
controls: PageControl[];
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type PageGroup = {
|
|
39
|
+
groupTitle: string;
|
|
40
|
+
groupDescription?: string;
|
|
41
|
+
sections: PageSection[];
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type UserIntervention = {
|
|
45
|
+
formTitle: string;
|
|
46
|
+
description: string;
|
|
47
|
+
pageGroups: PageGroup[];
|
|
48
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// TODO: Look at removing WaitForManualInput, Delay, ManualInputReceived so the user cannot use them - they are only for system use
|
|
2
|
+
export type DefaultPorts =
|
|
3
|
+
| 'Success'
|
|
4
|
+
| 'Exception'
|
|
5
|
+
| 'Warning'
|
|
6
|
+
| 'End'
|
|
7
|
+
| 'Delay'
|
|
8
|
+
| 'WaitForManualInput'
|
|
9
|
+
| 'ManualInputReceived';
|
|
10
|
+
|
|
11
|
+
export type ExtensibilityPorts = 'Success' | 'Error';
|
|
12
|
+
|
|
13
|
+
export const DefaultResult = [
|
|
14
|
+
'Success',
|
|
15
|
+
'Exception',
|
|
16
|
+
'Warning',
|
|
17
|
+
'End',
|
|
18
|
+
'Delay',
|
|
19
|
+
'WaitForManualInput',
|
|
20
|
+
'ManualInputReceived',
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
// export type DefaultPorts = (typeof DefaultResult)[number];
|
|
24
|
+
|
|
25
|
+
export type A = DefaultPorts | 'Error';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type ExtPlugin = {
|
|
2
|
+
responseType: any;
|
|
3
|
+
payload: any;
|
|
4
|
+
};
|
|
5
|
+
export type ExtBasePayload = {
|
|
6
|
+
orgId: string;
|
|
7
|
+
siteId?: string;
|
|
8
|
+
instanceId: string;
|
|
9
|
+
};
|
|
10
|
+
export type ExtReturnType<T, A = null> =
|
|
11
|
+
| ({ result: T; error?: never } & (A extends null ? unknown : A))
|
|
12
|
+
| { error: Error; result?: never };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DefaultPorts } from './default-result';
|
|
2
|
+
import { StepFunctionSignature } from './step-function-signature';
|
|
3
|
+
|
|
4
|
+
export type MappedPorts<T extends string> = {
|
|
5
|
+
[K in T]?:
|
|
6
|
+
| StepFunctionSignature
|
|
7
|
+
| DefaultPorts
|
|
8
|
+
| undefined
|
|
9
|
+
| {
|
|
10
|
+
callback: StepFunctionSignature;
|
|
11
|
+
setDescription: (description: string) => void;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DefaultApi } from '../../generated';
|
|
2
|
+
import {
|
|
3
|
+
WorkflowStepBasePayload,
|
|
4
|
+
WorkflowStepReturnType,
|
|
5
|
+
} from './workflow-step';
|
|
6
|
+
|
|
7
|
+
export type StepFunctionSignature = (
|
|
8
|
+
payload: WorkflowStepBasePayload & any,
|
|
9
|
+
api: DefaultApi,
|
|
10
|
+
state: any,
|
|
11
|
+
) => Promise<WorkflowStepReturnType<string>>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { UserIntervention } from './control';
|
|
2
|
+
|
|
3
|
+
export type WorkflowStepBasePayload = {
|
|
4
|
+
orgId: string;
|
|
5
|
+
siteId: string;
|
|
6
|
+
instanceId: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type WorkflowStepDelay =
|
|
10
|
+
| {
|
|
11
|
+
weeks: number;
|
|
12
|
+
days?: number;
|
|
13
|
+
hours?: number;
|
|
14
|
+
minutes?: number;
|
|
15
|
+
}
|
|
16
|
+
| {
|
|
17
|
+
weeks?: number;
|
|
18
|
+
days: number;
|
|
19
|
+
hours?: number;
|
|
20
|
+
minutes?: number;
|
|
21
|
+
}
|
|
22
|
+
| {
|
|
23
|
+
weeks?: number;
|
|
24
|
+
days?: number;
|
|
25
|
+
hours: number;
|
|
26
|
+
minutes?: number;
|
|
27
|
+
}
|
|
28
|
+
| {
|
|
29
|
+
weeks?: number;
|
|
30
|
+
days?: number;
|
|
31
|
+
hours?: number;
|
|
32
|
+
minutes: number;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type WorkflowStepReturnType<T, A = null> =
|
|
36
|
+
| ({
|
|
37
|
+
result: T;
|
|
38
|
+
state: any;
|
|
39
|
+
error?: never;
|
|
40
|
+
userIntervention?: never;
|
|
41
|
+
delay?: never;
|
|
42
|
+
} & (A extends null ? unknown : A))
|
|
43
|
+
| {
|
|
44
|
+
error: Error;
|
|
45
|
+
result?: never;
|
|
46
|
+
state?: never;
|
|
47
|
+
userIntervention?: never;
|
|
48
|
+
delay?: never;
|
|
49
|
+
}
|
|
50
|
+
| {
|
|
51
|
+
userIntervention: UserIntervention;
|
|
52
|
+
result?: never;
|
|
53
|
+
state?: never;
|
|
54
|
+
error?: never;
|
|
55
|
+
delay?: never;
|
|
56
|
+
}
|
|
57
|
+
| {
|
|
58
|
+
delay: WorkflowStepDelay;
|
|
59
|
+
userIntervention?: never;
|
|
60
|
+
result?: never;
|
|
61
|
+
state?: never;
|
|
62
|
+
error?: never;
|
|
63
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './port.enum';
|