@budibase/types 2.5.6-alpha.3 → 2.5.6-alpha.30

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.
Files changed (81) hide show
  1. package/dist/cjs/api/account/license.d.ts +15 -2
  2. package/dist/cjs/api/web/user.d.ts +17 -15
  3. package/dist/cjs/documents/account/account.d.ts +5 -1
  4. package/dist/cjs/documents/account/account.js.map +1 -1
  5. package/dist/cjs/documents/app/automation.d.ts +57 -8
  6. package/dist/cjs/documents/app/automation.js +37 -1
  7. package/dist/cjs/documents/app/automation.js.map +1 -1
  8. package/dist/cjs/documents/app/table.d.ts +3 -0
  9. package/dist/cjs/documents/global/plugin.d.ts +2 -1
  10. package/dist/cjs/documents/global/plugin.js +1 -0
  11. package/dist/cjs/documents/global/plugin.js.map +1 -1
  12. package/dist/cjs/documents/global/quotas.d.ts +1 -0
  13. package/dist/cjs/sdk/licensing/billing.d.ts +1 -0
  14. package/dist/cjs/sdk/licensing/feature.d.ts +4 -0
  15. package/dist/cjs/sdk/licensing/feature.js.map +1 -1
  16. package/dist/cjs/sdk/licensing/license.d.ts +3 -2
  17. package/dist/cjs/sdk/licensing/plan.d.ts +25 -6
  18. package/dist/cjs/sdk/licensing/plan.js +9 -1
  19. package/dist/cjs/sdk/licensing/plan.js.map +1 -1
  20. package/dist/cjs/sdk/licensing/quota.d.ts +10 -5
  21. package/dist/cjs/sdk/licensing/quota.js +1 -1
  22. package/dist/cjs/sdk/licensing/quota.js.map +1 -1
  23. package/dist/cjs/sdk/locks.d.ts +10 -2
  24. package/dist/cjs/sdk/locks.js +2 -0
  25. package/dist/cjs/sdk/locks.js.map +1 -1
  26. package/dist/cjs/shared/index.d.ts +1 -0
  27. package/dist/cjs/shared/index.js +18 -0
  28. package/dist/cjs/shared/index.js.map +1 -0
  29. package/dist/cjs/shared/typeUtils.d.ts +3 -0
  30. package/dist/cjs/shared/typeUtils.js +3 -0
  31. package/dist/cjs/shared/typeUtils.js.map +1 -0
  32. package/dist/cjs/tsconfig-cjs.build.tsbuildinfo +1 -1
  33. package/dist/mjs/api/account/license.d.ts +15 -2
  34. package/dist/mjs/api/web/user.d.ts +17 -15
  35. package/dist/mjs/documents/account/account.d.ts +5 -1
  36. package/dist/mjs/documents/account/account.js +1 -1
  37. package/dist/mjs/documents/account/account.js.map +1 -1
  38. package/dist/mjs/documents/app/automation.d.ts +57 -8
  39. package/dist/mjs/documents/app/automation.js +36 -0
  40. package/dist/mjs/documents/app/automation.js.map +1 -1
  41. package/dist/mjs/documents/app/table.d.ts +3 -0
  42. package/dist/mjs/documents/global/plugin.d.ts +2 -1
  43. package/dist/mjs/documents/global/plugin.js +1 -0
  44. package/dist/mjs/documents/global/plugin.js.map +1 -1
  45. package/dist/mjs/documents/global/quotas.d.ts +1 -0
  46. package/dist/mjs/sdk/licensing/billing.d.ts +1 -0
  47. package/dist/mjs/sdk/licensing/feature.d.ts +4 -0
  48. package/dist/mjs/sdk/licensing/feature.js.map +1 -1
  49. package/dist/mjs/sdk/licensing/license.d.ts +3 -2
  50. package/dist/mjs/sdk/licensing/plan.d.ts +25 -6
  51. package/dist/mjs/sdk/licensing/plan.js +8 -0
  52. package/dist/mjs/sdk/licensing/plan.js.map +1 -1
  53. package/dist/mjs/sdk/licensing/quota.d.ts +10 -5
  54. package/dist/mjs/sdk/licensing/quota.js +1 -1
  55. package/dist/mjs/sdk/licensing/quota.js.map +1 -1
  56. package/dist/mjs/sdk/locks.d.ts +10 -2
  57. package/dist/mjs/sdk/locks.js +2 -0
  58. package/dist/mjs/sdk/locks.js.map +1 -1
  59. package/dist/mjs/shared/index.d.ts +1 -0
  60. package/dist/mjs/shared/index.js +2 -0
  61. package/dist/mjs/shared/index.js.map +1 -0
  62. package/dist/mjs/shared/typeUtils.d.ts +3 -0
  63. package/dist/mjs/shared/typeUtils.js +2 -0
  64. package/dist/mjs/shared/typeUtils.js.map +1 -0
  65. package/dist/mjs/tsconfig.build.tsbuildinfo +1 -1
  66. package/package.json +3 -2
  67. package/src/api/account/license.ts +19 -2
  68. package/src/api/web/user.ts +12 -8
  69. package/src/documents/account/account.ts +7 -12
  70. package/src/documents/app/automation.ts +65 -8
  71. package/src/documents/app/table.ts +3 -0
  72. package/src/documents/global/plugin.ts +1 -0
  73. package/src/documents/global/quotas.ts +1 -0
  74. package/src/sdk/licensing/billing.ts +1 -0
  75. package/src/sdk/licensing/feature.ts +4 -0
  76. package/src/sdk/licensing/license.ts +3 -2
  77. package/src/sdk/licensing/plan.ts +29 -7
  78. package/src/sdk/licensing/quota.ts +9 -6
  79. package/src/sdk/locks.ts +9 -0
  80. package/src/shared/index.ts +1 -0
  81. package/src/shared/typeUtils.ts +3 -0
@@ -1,6 +1,30 @@
1
1
  /// <reference types="node" />
2
2
  import { Document } from "../document";
3
3
  import { EventEmitter } from "events";
4
+ export declare enum AutomationIOType {
5
+ OBJECT = "object",
6
+ STRING = "string",
7
+ BOOLEAN = "boolean",
8
+ NUMBER = "number",
9
+ ARRAY = "array"
10
+ }
11
+ export declare enum AutomationCustomIOType {
12
+ TABLE = "table",
13
+ ROW = "row",
14
+ ROWS = "rows",
15
+ WIDE = "wide",
16
+ QUERY = "query",
17
+ QUERY_PARAMS = "queryParams",
18
+ QUERY_LIMIT = "queryLimit",
19
+ LOOP_OPTION = "loopOption",
20
+ ITEM = "item",
21
+ CODE = "code",
22
+ FILTERS = "filters",
23
+ COLUMN = "column",
24
+ TRIGGER_SCHEMA = "triggerSchema",
25
+ CRON = "cron",
26
+ WEBHOOK_URL = "webhookUrl"
27
+ }
4
28
  export declare enum AutomationTriggerStepId {
5
29
  ROW_SAVED = "ROW_SAVED",
6
30
  ROW_UPDATED = "ROW_UPDATED",
@@ -9,6 +33,11 @@ export declare enum AutomationTriggerStepId {
9
33
  APP = "APP",
10
34
  CRON = "CRON"
11
35
  }
36
+ export declare enum AutomationStepType {
37
+ LOGIC = "LOGIC",
38
+ ACTION = "ACTION",
39
+ TRIGGER = "TRIGGER"
40
+ }
12
41
  export declare enum AutomationActionStepId {
13
42
  SEND_EMAIL_SMTP = "SEND_EMAIL_SMTP",
14
43
  CREATE_ROW = "CREATE_ROW",
@@ -28,21 +57,44 @@ export declare enum AutomationActionStepId {
28
57
  zapier = "zapier",
29
58
  integromat = "integromat"
30
59
  }
60
+ export declare const AutomationStepIdArray: (AutomationActionStepId | AutomationTriggerStepId)[];
31
61
  export interface Automation extends Document {
32
62
  definition: {
33
63
  steps: AutomationStep[];
34
64
  trigger: AutomationTrigger;
35
65
  };
66
+ screenId?: string;
67
+ uiTree?: any;
36
68
  appId: string;
37
69
  live?: boolean;
38
70
  name: string;
71
+ internal?: boolean;
72
+ type?: string;
73
+ }
74
+ interface BaseIOStructure {
75
+ type?: AutomationIOType;
76
+ customType?: AutomationCustomIOType;
77
+ title?: string;
78
+ description?: string;
79
+ enum?: string[];
80
+ pretty?: string[];
81
+ properties?: {
82
+ [key: string]: BaseIOStructure;
83
+ };
84
+ required?: string[];
85
+ }
86
+ interface InputOutputBlock {
87
+ properties: {
88
+ [key: string]: BaseIOStructure;
89
+ };
90
+ required?: string[];
39
91
  }
40
92
  export interface AutomationStepSchema {
41
93
  name: string;
42
94
  tagline: string;
43
95
  icon: string;
44
96
  description: string;
45
- type: string;
97
+ type: AutomationStepType;
46
98
  internal?: boolean;
47
99
  deprecated?: boolean;
48
100
  stepId: AutomationTriggerStepId | AutomationActionStepId;
@@ -51,14 +103,10 @@ export interface AutomationStepSchema {
51
103
  [key: string]: any;
52
104
  };
53
105
  schema: {
54
- inputs: {
55
- [key: string]: any;
56
- };
57
- outputs: {
58
- [key: string]: any;
59
- };
60
- required?: string[];
106
+ inputs: InputOutputBlock;
107
+ outputs: InputOutputBlock;
61
108
  };
109
+ custom?: boolean;
62
110
  }
63
111
  export interface AutomationStep extends AutomationStepSchema {
64
112
  id: string;
@@ -107,3 +155,4 @@ export declare type AutomationStepInput = {
107
155
  appId: string;
108
156
  apiKey?: string;
109
157
  };
158
+ export {};
@@ -1,3 +1,29 @@
1
+ export var AutomationIOType;
2
+ (function (AutomationIOType) {
3
+ AutomationIOType["OBJECT"] = "object";
4
+ AutomationIOType["STRING"] = "string";
5
+ AutomationIOType["BOOLEAN"] = "boolean";
6
+ AutomationIOType["NUMBER"] = "number";
7
+ AutomationIOType["ARRAY"] = "array";
8
+ })(AutomationIOType || (AutomationIOType = {}));
9
+ export var AutomationCustomIOType;
10
+ (function (AutomationCustomIOType) {
11
+ AutomationCustomIOType["TABLE"] = "table";
12
+ AutomationCustomIOType["ROW"] = "row";
13
+ AutomationCustomIOType["ROWS"] = "rows";
14
+ AutomationCustomIOType["WIDE"] = "wide";
15
+ AutomationCustomIOType["QUERY"] = "query";
16
+ AutomationCustomIOType["QUERY_PARAMS"] = "queryParams";
17
+ AutomationCustomIOType["QUERY_LIMIT"] = "queryLimit";
18
+ AutomationCustomIOType["LOOP_OPTION"] = "loopOption";
19
+ AutomationCustomIOType["ITEM"] = "item";
20
+ AutomationCustomIOType["CODE"] = "code";
21
+ AutomationCustomIOType["FILTERS"] = "filters";
22
+ AutomationCustomIOType["COLUMN"] = "column";
23
+ AutomationCustomIOType["TRIGGER_SCHEMA"] = "triggerSchema";
24
+ AutomationCustomIOType["CRON"] = "cron";
25
+ AutomationCustomIOType["WEBHOOK_URL"] = "webhookUrl";
26
+ })(AutomationCustomIOType || (AutomationCustomIOType = {}));
1
27
  export var AutomationTriggerStepId;
2
28
  (function (AutomationTriggerStepId) {
3
29
  AutomationTriggerStepId["ROW_SAVED"] = "ROW_SAVED";
@@ -7,6 +33,12 @@ export var AutomationTriggerStepId;
7
33
  AutomationTriggerStepId["APP"] = "APP";
8
34
  AutomationTriggerStepId["CRON"] = "CRON";
9
35
  })(AutomationTriggerStepId || (AutomationTriggerStepId = {}));
36
+ export var AutomationStepType;
37
+ (function (AutomationStepType) {
38
+ AutomationStepType["LOGIC"] = "LOGIC";
39
+ AutomationStepType["ACTION"] = "ACTION";
40
+ AutomationStepType["TRIGGER"] = "TRIGGER";
41
+ })(AutomationStepType || (AutomationStepType = {}));
10
42
  export var AutomationActionStepId;
11
43
  (function (AutomationActionStepId) {
12
44
  AutomationActionStepId["SEND_EMAIL_SMTP"] = "SEND_EMAIL_SMTP";
@@ -28,6 +60,10 @@ export var AutomationActionStepId;
28
60
  AutomationActionStepId["zapier"] = "zapier";
29
61
  AutomationActionStepId["integromat"] = "integromat";
30
62
  })(AutomationActionStepId || (AutomationActionStepId = {}));
63
+ export const AutomationStepIdArray = [
64
+ ...Object.values(AutomationActionStepId),
65
+ ...Object.values(AutomationTriggerStepId),
66
+ ];
31
67
  export var AutomationStatus;
32
68
  (function (AutomationStatus) {
33
69
  AutomationStatus["SUCCESS"] = "success";
@@ -1 +1 @@
1
- {"version":3,"file":"automation.js","sourceRoot":"","sources":["../../../../src/documents/app/automation.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,uBAOX;AAPD,WAAY,uBAAuB;IACjC,kDAAuB,CAAA;IACvB,sDAA2B,CAAA;IAC3B,sDAA2B,CAAA;IAC3B,8CAAmB,CAAA;IACnB,sCAAW,CAAA;IACX,wCAAa,CAAA;AACf,CAAC,EAPW,uBAAuB,KAAvB,uBAAuB,QAOlC;AAED,MAAM,CAAN,IAAY,sBAmBX;AAnBD,WAAY,sBAAsB;IAChC,6DAAmC,CAAA;IACnC,mDAAyB,CAAA;IACzB,mDAAyB,CAAA;IACzB,mDAAyB,CAAA;IACzB,uDAA6B,CAAA;IAC7B,+DAAqC,CAAA;IACrC,2DAAiC,CAAA;IACjC,yDAA+B,CAAA;IAC/B,mDAAyB,CAAA;IACzB,yCAAe,CAAA;IACf,2CAAiB,CAAA;IACjB,mDAAyB,CAAA;IACzB,uCAAa,CAAA;IACb,qEAAqE;IACrE,6CAAmB,CAAA;IACnB,yCAAe,CAAA;IACf,2CAAiB,CAAA;IACjB,mDAAyB,CAAA;AAC3B,CAAC,EAnBW,sBAAsB,KAAtB,sBAAsB,QAmBjC;AAiDD,MAAM,CAAN,IAAY,gBAMX;AAND,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,mCAAe,CAAA;IACf,uCAAmB,CAAA;IACnB,mDAA+B,CAAA;IAC/B,mDAA+B,CAAA;AACjC,CAAC,EANW,gBAAgB,KAAhB,gBAAgB,QAM3B"}
1
+ {"version":3,"file":"automation.js","sourceRoot":"","sources":["../../../../src/documents/app/automation.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,gBAMX;AAND,WAAY,gBAAgB;IAC1B,qCAAiB,CAAA;IACjB,qCAAiB,CAAA;IACjB,uCAAmB,CAAA;IACnB,qCAAiB,CAAA;IACjB,mCAAe,CAAA;AACjB,CAAC,EANW,gBAAgB,KAAhB,gBAAgB,QAM3B;AAED,MAAM,CAAN,IAAY,sBAgBX;AAhBD,WAAY,sBAAsB;IAChC,yCAAe,CAAA;IACf,qCAAW,CAAA;IACX,uCAAa,CAAA;IACb,uCAAa,CAAA;IACb,yCAAe,CAAA;IACf,sDAA4B,CAAA;IAC5B,oDAA0B,CAAA;IAC1B,oDAA0B,CAAA;IAC1B,uCAAa,CAAA;IACb,uCAAa,CAAA;IACb,6CAAmB,CAAA;IACnB,2CAAiB,CAAA;IACjB,0DAAgC,CAAA;IAChC,uCAAa,CAAA;IACb,oDAA0B,CAAA;AAC5B,CAAC,EAhBW,sBAAsB,KAAtB,sBAAsB,QAgBjC;AAED,MAAM,CAAN,IAAY,uBAOX;AAPD,WAAY,uBAAuB;IACjC,kDAAuB,CAAA;IACvB,sDAA2B,CAAA;IAC3B,sDAA2B,CAAA;IAC3B,8CAAmB,CAAA;IACnB,sCAAW,CAAA;IACX,wCAAa,CAAA;AACf,CAAC,EAPW,uBAAuB,KAAvB,uBAAuB,QAOlC;AAED,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,qCAAe,CAAA;IACf,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACrB,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B;AAED,MAAM,CAAN,IAAY,sBAmBX;AAnBD,WAAY,sBAAsB;IAChC,6DAAmC,CAAA;IACnC,mDAAyB,CAAA;IACzB,mDAAyB,CAAA;IACzB,mDAAyB,CAAA;IACzB,uDAA6B,CAAA;IAC7B,+DAAqC,CAAA;IACrC,2DAAiC,CAAA;IACjC,yDAA+B,CAAA;IAC/B,mDAAyB,CAAA;IACzB,yCAAe,CAAA;IACf,2CAAiB,CAAA;IACjB,mDAAyB,CAAA;IACzB,uCAAa,CAAA;IACb,qEAAqE;IACrE,6CAAmB,CAAA;IACnB,yCAAe,CAAA;IACf,2CAAiB,CAAA;IACjB,mDAAyB,CAAA;AAC3B,CAAC,EAnBW,sBAAsB,KAAtB,sBAAsB,QAmBjC;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,GAAG,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC;IACxC,GAAG,MAAM,CAAC,MAAM,CAAC,uBAAuB,CAAC;CAC1C,CAAA;AAqED,MAAM,CAAN,IAAY,gBAMX;AAND,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,mCAAe,CAAA;IACf,uCAAmB,CAAA;IACnB,mDAA+B,CAAA;IAC/B,mDAA+B,CAAA;AACjC,CAAC,EANW,gBAAgB,KAAhB,gBAAgB,QAM3B"}
@@ -29,6 +29,8 @@ export interface FieldSchema {
29
29
  timeOnly?: boolean;
30
30
  lastID?: number;
31
31
  useRichText?: boolean | null;
32
+ order?: number;
33
+ width?: number;
32
34
  meta?: {
33
35
  toTable: string;
34
36
  toKey: string;
@@ -77,6 +79,7 @@ export interface Table extends Document {
77
79
  [key: string]: any;
78
80
  };
79
81
  created?: boolean;
82
+ rowHeight?: number;
80
83
  }
81
84
  export interface TableRequest extends Table {
82
85
  _rename?: RenameColumn;
@@ -1,7 +1,8 @@
1
1
  import { Document } from "../document";
2
2
  export declare enum PluginType {
3
3
  DATASOURCE = "datasource",
4
- COMPONENT = "component"
4
+ COMPONENT = "component",
5
+ AUTOMATION = "automation"
5
6
  }
6
7
  export declare enum PluginSource {
7
8
  NPM = "NPM",
@@ -2,6 +2,7 @@ export var PluginType;
2
2
  (function (PluginType) {
3
3
  PluginType["DATASOURCE"] = "datasource";
4
4
  PluginType["COMPONENT"] = "component";
5
+ PluginType["AUTOMATION"] = "automation";
5
6
  })(PluginType || (PluginType = {}));
6
7
  export var PluginSource;
7
8
  (function (PluginSource) {
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../src/documents/global/plugin.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,uCAAyB,CAAA;IACzB,qCAAuB,CAAA;AACzB,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAED,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,2BAAW,CAAA;IACX,iCAAiB,CAAA;IACjB,2BAAW,CAAA;IACX,oCAAoB,CAAA;AACtB,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAwBD,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA"}
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../src/documents/global/plugin.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,uCAAyB,CAAA;IACzB,qCAAuB,CAAA;IACvB,uCAAyB,CAAA;AAC3B,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB;AAED,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,2BAAW,CAAA;IACX,iCAAiB,CAAA;IACjB,2BAAW,CAAA;IACX,oCAAoB,CAAA;AACtB,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAwBD,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA"}
@@ -18,6 +18,7 @@ export declare type QuotaTriggers = {
18
18
  export interface StaticUsage {
19
19
  [StaticQuotaName.APPS]: number;
20
20
  [StaticQuotaName.PLUGINS]: number;
21
+ [StaticQuotaName.USERS]: number;
21
22
  [StaticQuotaName.USER_GROUPS]: number;
22
23
  [StaticQuotaName.ROWS]: number;
23
24
  triggers: {
@@ -5,6 +5,7 @@ export interface Customer {
5
5
  }
6
6
  export interface Subscription {
7
7
  amount: number;
8
+ currency: string;
8
9
  quantity: number;
9
10
  duration: PriceDuration;
10
11
  cancelAt: number | null | undefined;
@@ -1,3 +1,4 @@
1
+ import { PlanType } from "./plan";
1
2
  export declare enum Feature {
2
3
  USER_GROUPS = "userGroups",
3
4
  APP_BACKUPS = "appBackups",
@@ -7,3 +8,6 @@ export declare enum Feature {
7
8
  BRANDING = "branding",
8
9
  SCIM = "scim"
9
10
  }
11
+ export declare type PlanFeatures = {
12
+ [key in PlanType]: Feature[] | undefined;
13
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"feature.js","sourceRoot":"","sources":["../../../../src/sdk/licensing/feature.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,OAQX;AARD,WAAY,OAAO;IACjB,qCAA0B,CAAA;IAC1B,qCAA0B,CAAA;IAC1B,yDAA8C,CAAA;IAC9C,mCAAwB,CAAA;IACxB,6CAAkC,CAAA;IAClC,gCAAqB,CAAA;IACrB,wBAAa,CAAA;AACf,CAAC,EARW,OAAO,KAAP,OAAO,QAQlB"}
1
+ {"version":3,"file":"feature.js","sourceRoot":"","sources":["../../../../src/sdk/licensing/feature.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,OAQX;AARD,WAAY,OAAO;IACjB,qCAA0B,CAAA;IAC1B,qCAA0B,CAAA;IAC1B,yDAA8C,CAAA;IAC9C,mCAAwB,CAAA;IACxB,6CAAkC,CAAA;IAClC,gCAAqB,CAAA;IACrB,wBAAa,CAAA;AACf,CAAC,EARW,OAAO,KAAP,OAAO,QAQlB"}
@@ -1,7 +1,8 @@
1
- import { AccountPlan, Quotas, Feature, Billing } from ".";
1
+ import { PurchasedPlan, Quotas, Feature, Billing } from ".";
2
2
  export interface License {
3
3
  features: Feature[];
4
4
  quotas: Quotas;
5
- plan: AccountPlan;
5
+ plan: PurchasedPlan;
6
6
  billing?: Billing;
7
+ testClockId?: string;
7
8
  }
@@ -1,11 +1,10 @@
1
- export interface AccountPlan {
2
- type: PlanType;
3
- price?: Price;
4
- }
5
1
  export declare enum PlanType {
6
2
  FREE = "free",
3
+ /** @deprecated */
7
4
  PRO = "pro",
5
+ /** @deprecated */
8
6
  TEAM = "team",
7
+ PREMIUM = "premium",
9
8
  BUSINESS = "business",
10
9
  ENTERPRISE = "enterprise"
11
10
  }
@@ -13,12 +12,32 @@ export declare enum PriceDuration {
13
12
  MONTHLY = "monthly",
14
13
  YEARLY = "yearly"
15
14
  }
16
- export interface Price {
15
+ export interface AvailablePlan {
16
+ type: PlanType;
17
+ maxUsers: number;
18
+ minUsers: number;
19
+ prices: AvailablePrice[];
20
+ }
21
+ export interface AvailablePrice {
17
22
  amount: number;
18
23
  amountMonthly: number;
19
24
  currency: string;
20
25
  duration: PriceDuration;
21
26
  priceId: string;
22
- dayPasses: number;
27
+ }
28
+ export declare enum PlanModel {
29
+ PER_USER = "perUser",
30
+ DAY_PASS = "dayPass"
31
+ }
32
+ export interface PurchasedPlan {
33
+ type: PlanType;
34
+ model: PlanModel;
35
+ usesInvoicing: boolean;
36
+ minUsers: number;
37
+ price?: PurchasedPrice;
38
+ }
39
+ export interface PurchasedPrice extends AvailablePrice {
40
+ dayPasses: number | undefined;
41
+ /** @deprecated - now at the plan level via model */
23
42
  isPerUser: boolean;
24
43
  }
@@ -1,8 +1,11 @@
1
1
  export var PlanType;
2
2
  (function (PlanType) {
3
3
  PlanType["FREE"] = "free";
4
+ /** @deprecated */
4
5
  PlanType["PRO"] = "pro";
6
+ /** @deprecated */
5
7
  PlanType["TEAM"] = "team";
8
+ PlanType["PREMIUM"] = "premium";
6
9
  PlanType["BUSINESS"] = "business";
7
10
  PlanType["ENTERPRISE"] = "enterprise";
8
11
  })(PlanType || (PlanType = {}));
@@ -11,4 +14,9 @@ export var PriceDuration;
11
14
  PriceDuration["MONTHLY"] = "monthly";
12
15
  PriceDuration["YEARLY"] = "yearly";
13
16
  })(PriceDuration || (PriceDuration = {}));
17
+ export var PlanModel;
18
+ (function (PlanModel) {
19
+ PlanModel["PER_USER"] = "perUser";
20
+ PlanModel["DAY_PASS"] = "dayPass";
21
+ })(PlanModel || (PlanModel = {}));
14
22
  //# sourceMappingURL=plan.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plan.js","sourceRoot":"","sources":["../../../../src/sdk/licensing/plan.ts"],"names":[],"mappings":"AAKA,MAAM,CAAN,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,uBAAW,CAAA;IACX,yBAAa,CAAA;IACb,iCAAqB,CAAA;IACrB,qCAAyB,CAAA;AAC3B,CAAC,EANW,QAAQ,KAAR,QAAQ,QAMnB;AAED,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,kCAAiB,CAAA;AACnB,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB"}
1
+ {"version":3,"file":"plan.js","sourceRoot":"","sources":["../../../../src/sdk/licensing/plan.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,QASX;AATD,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,kBAAkB;IAClB,uBAAW,CAAA;IACX,kBAAkB;IAClB,yBAAa,CAAA;IACb,+BAAmB,CAAA;IACnB,iCAAqB,CAAA;IACrB,qCAAyB,CAAA;AAC3B,CAAC,EATW,QAAQ,KAAR,QAAQ,QASnB;AAED,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,kCAAiB,CAAA;AACnB,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAiBD,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,iCAAoB,CAAA;IACpB,iCAAoB,CAAA;AACtB,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB"}
@@ -10,6 +10,7 @@ export declare enum QuotaType {
10
10
  export declare enum StaticQuotaName {
11
11
  ROWS = "rows",
12
12
  APPS = "apps",
13
+ USERS = "users",
13
14
  USER_GROUPS = "userGroups",
14
15
  PLUGINS = "plugins"
15
16
  }
@@ -27,12 +28,14 @@ export declare type QuotaName = StaticQuotaName | MonthlyQuotaName | ConstantQuo
27
28
  export declare const isStaticQuota: (quotaType: QuotaType, usageType: QuotaUsageType, name: QuotaName) => name is StaticQuotaName;
28
29
  export declare const isMonthlyQuota: (quotaType: QuotaType, usageType: QuotaUsageType, name: QuotaName) => name is MonthlyQuotaName;
29
30
  export declare const isConstantQuota: (quotaType: QuotaType, name: QuotaName) => name is ConstantQuotaName;
31
+ export interface Minimums {
32
+ users: number;
33
+ }
34
+ export declare type PlanMinimums = {
35
+ [key in PlanType]: Minimums;
36
+ };
30
37
  export declare type PlanQuotas = {
31
- [PlanType.FREE]: Quotas;
32
- [PlanType.PRO]: Quotas;
33
- [PlanType.TEAM]: Quotas;
34
- [PlanType.BUSINESS]: Quotas;
35
- [PlanType.ENTERPRISE]: Quotas;
38
+ [key in PlanType]: Quotas | undefined;
36
39
  };
37
40
  export declare type MonthlyQuotas = {
38
41
  [MonthlyQuotaName.QUERIES]: Quota;
@@ -42,6 +45,7 @@ export declare type MonthlyQuotas = {
42
45
  export declare type StaticQuotas = {
43
46
  [StaticQuotaName.ROWS]: Quota;
44
47
  [StaticQuotaName.APPS]: Quota;
48
+ [StaticQuotaName.USERS]: Quota;
45
49
  [StaticQuotaName.USER_GROUPS]: Quota;
46
50
  [StaticQuotaName.PLUGINS]: Quota;
47
51
  };
@@ -67,4 +71,5 @@ export interface Quota {
67
71
  * which can have subsequent effects such as sending emails to users.
68
72
  */
69
73
  triggers: number[];
74
+ startDate?: number;
70
75
  }
@@ -1,4 +1,3 @@
1
- import { PlanType } from ".";
2
1
  export var QuotaUsageType;
3
2
  (function (QuotaUsageType) {
4
3
  QuotaUsageType["STATIC"] = "static";
@@ -13,6 +12,7 @@ export var StaticQuotaName;
13
12
  (function (StaticQuotaName) {
14
13
  StaticQuotaName["ROWS"] = "rows";
15
14
  StaticQuotaName["APPS"] = "apps";
15
+ StaticQuotaName["USERS"] = "users";
16
16
  StaticQuotaName["USER_GROUPS"] = "userGroups";
17
17
  StaticQuotaName["PLUGINS"] = "plugins";
18
18
  })(StaticQuotaName || (StaticQuotaName = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"quota.js","sourceRoot":"","sources":["../../../../src/sdk/licensing/quota.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAA;AAE5B,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,qCAAmB,CAAA;AACrB,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,4BAAe,CAAA;IACf,kCAAqB,CAAA;AACvB,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAED,MAAM,CAAN,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,6CAA0B,CAAA;IAC1B,sCAAmB,CAAA;AACrB,CAAC,EALW,eAAe,KAAf,eAAe,QAK1B;AAED,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,+CAA2B,CAAA;IAC3B,4CAAwB,CAAA;AAC1B,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B;AAED,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,iFAA4D,CAAA;IAC5D,0EAAqD,CAAA;AACvD,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B;AAKD,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,SAAoB,EACpB,SAAyB,EACzB,IAAe,EACU,EAAE;IAC3B,OAAO,SAAS,KAAK,SAAS,CAAC,KAAK,IAAI,SAAS,KAAK,cAAc,CAAC,MAAM,CAAA;AAC7E,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,SAAoB,EACpB,SAAyB,EACzB,IAAe,EACW,EAAE;IAC5B,OAAO,SAAS,KAAK,SAAS,CAAC,KAAK,IAAI,SAAS,KAAK,cAAc,CAAC,OAAO,CAAA;AAC9E,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,SAAoB,EACpB,IAAe,EACY,EAAE;IAC7B,OAAO,SAAS,KAAK,SAAS,CAAC,QAAQ,CAAA;AACzC,CAAC,CAAA"}
1
+ {"version":3,"file":"quota.js","sourceRoot":"","sources":["../../../../src/sdk/licensing/quota.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,qCAAmB,CAAA;AACrB,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,4BAAe,CAAA;IACf,kCAAqB,CAAA;AACvB,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAED,MAAM,CAAN,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,kCAAe,CAAA;IACf,6CAA0B,CAAA;IAC1B,sCAAmB,CAAA;AACrB,CAAC,EANW,eAAe,KAAf,eAAe,QAM1B;AAED,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,+CAA2B,CAAA;IAC3B,4CAAwB,CAAA;AAC1B,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B;AAED,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,iFAA4D,CAAA;IAC5D,0EAAqD,CAAA;AACvD,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B;AAKD,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,SAAoB,EACpB,SAAyB,EACzB,IAAe,EACU,EAAE;IAC3B,OAAO,SAAS,KAAK,SAAS,CAAC,KAAK,IAAI,SAAS,KAAK,cAAc,CAAC,MAAM,CAAA;AAC7E,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,SAAoB,EACpB,SAAyB,EACzB,IAAe,EACW,EAAE;IAC5B,OAAO,SAAS,KAAK,SAAS,CAAC,KAAK,IAAI,SAAS,KAAK,cAAc,CAAC,OAAO,CAAA;AAC9E,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,SAAoB,EACpB,IAAe,EACY,EAAE;IAC7B,OAAO,SAAS,KAAK,SAAS,CAAC,QAAQ,CAAA;AACzC,CAAC,CAAA"}
@@ -1,3 +1,4 @@
1
+ import Redlock from "redlock";
1
2
  export declare enum LockType {
2
3
  /**
3
4
  * If this lock is already held the attempted operation will not be performed.
@@ -5,20 +6,27 @@ export declare enum LockType {
5
6
  */
6
7
  TRY_ONCE = "try_once",
7
8
  DEFAULT = "default",
8
- DELAY_500 = "delay_500"
9
+ DELAY_500 = "delay_500",
10
+ CUSTOM = "custom"
9
11
  }
10
12
  export declare enum LockName {
11
13
  MIGRATIONS = "migrations",
12
14
  TRIGGER_QUOTA = "trigger_quota",
13
15
  SYNC_ACCOUNT_LICENSE = "sync_account_license",
14
16
  UPDATE_TENANTS_DOC = "update_tenants_doc",
15
- PERSIST_WRITETHROUGH = "persist_writethrough"
17
+ PERSIST_WRITETHROUGH = "persist_writethrough",
18
+ QUOTA_USAGE_EVENT = "quota_usage_event"
16
19
  }
17
20
  export interface LockOptions {
18
21
  /**
19
22
  * The lock type determines which client to use
20
23
  */
21
24
  type: LockType;
25
+ /**
26
+ * The custom options to use when creating the redlock instance
27
+ * type must be set to custom for the options to be applied
28
+ */
29
+ customOptions?: Redlock.Options;
22
30
  /**
23
31
  * The name for the lock
24
32
  */
@@ -7,6 +7,7 @@ export var LockType;
7
7
  LockType["TRY_ONCE"] = "try_once";
8
8
  LockType["DEFAULT"] = "default";
9
9
  LockType["DELAY_500"] = "delay_500";
10
+ LockType["CUSTOM"] = "custom";
10
11
  })(LockType || (LockType = {}));
11
12
  export var LockName;
12
13
  (function (LockName) {
@@ -15,5 +16,6 @@ export var LockName;
15
16
  LockName["SYNC_ACCOUNT_LICENSE"] = "sync_account_license";
16
17
  LockName["UPDATE_TENANTS_DOC"] = "update_tenants_doc";
17
18
  LockName["PERSIST_WRITETHROUGH"] = "persist_writethrough";
19
+ LockName["QUOTA_USAGE_EVENT"] = "quota_usage_event";
18
20
  })(LockName || (LockName = {}));
19
21
  //# sourceMappingURL=locks.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"locks.js","sourceRoot":"","sources":["../../../src/sdk/locks.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,QAQX;AARD,WAAY,QAAQ;IAClB;;;OAGG;IACH,iCAAqB,CAAA;IACrB,+BAAmB,CAAA;IACnB,mCAAuB,CAAA;AACzB,CAAC,EARW,QAAQ,KAAR,QAAQ,QAQnB;AAED,MAAM,CAAN,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,qCAAyB,CAAA;IACzB,2CAA+B,CAAA;IAC/B,yDAA6C,CAAA;IAC7C,qDAAyC,CAAA;IACzC,yDAA6C,CAAA;AAC/C,CAAC,EANW,QAAQ,KAAR,QAAQ,QAMnB"}
1
+ {"version":3,"file":"locks.js","sourceRoot":"","sources":["../../../src/sdk/locks.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,QASX;AATD,WAAY,QAAQ;IAClB;;;OAGG;IACH,iCAAqB,CAAA;IACrB,+BAAmB,CAAA;IACnB,mCAAuB,CAAA;IACvB,6BAAiB,CAAA;AACnB,CAAC,EATW,QAAQ,KAAR,QAAQ,QASnB;AAED,MAAM,CAAN,IAAY,QAOX;AAPD,WAAY,QAAQ;IAClB,qCAAyB,CAAA;IACzB,2CAA+B,CAAA;IAC/B,yDAA6C,CAAA;IAC7C,qDAAyC,CAAA;IACzC,yDAA6C,CAAA;IAC7C,mDAAuC,CAAA;AACzC,CAAC,EAPW,QAAQ,KAAR,QAAQ,QAOnB"}
@@ -0,0 +1 @@
1
+ export * from "./typeUtils";
@@ -0,0 +1,2 @@
1
+ export * from "./typeUtils";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
@@ -0,0 +1,3 @@
1
+ export declare type DeepPartial<T> = {
2
+ [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
3
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=typeUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeUtils.js","sourceRoot":"","sources":["../../../src/shared/typeUtils.ts"],"names":[],"mappings":""}