@drawbridge/drawbridge-utils 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,184 @@
1
- const { code, data } = require( 'currency-codes' );
1
+ import { data, code } from 'currency-codes';
2
+ import { customAlphabet } from 'nanoid';
2
3
 
3
- const constants = require( './lib/constants' );
4
+ const font = {
5
+ family : 'Roboto Flex',
6
+ transform : 'none',
7
+ weight : 'regular'
8
+ };
9
+
10
+ var constantsData = {
11
+ action : {
12
+ usage : {
13
+ actions : 0
14
+ }
15
+ },
16
+ brand : {
17
+ style : {
18
+ body : font,
19
+ heading : font
20
+ },
21
+ totals : {
22
+ campaigns : 0
23
+ }
24
+ },
25
+ campaign : {
26
+ agreements : {
27
+ marketing : {
28
+ enabled : false,
29
+ label : 'I agree to the marketing terms and conditions',
30
+ link : null
31
+ },
32
+ terms : {
33
+ enabled : false,
34
+ label : 'I agree to the terms and conditions',
35
+ link : null
36
+ }
37
+ },
38
+ defaults : {
39
+ active : 'Enter',
40
+ confirmation : 'Submission was successful',
41
+ inactive : 'Submissions are closed',
42
+ email : 'You were selected'
43
+ },
44
+ notifications : {
45
+ draw : {
46
+ subject : 'You have been selected',
47
+ body : 'Thanks for being part of our giveaway'
48
+ }
49
+ },
50
+ settings : {
51
+ submissionLeadPrimaryKey : 'email',
52
+ submissionEntryMaximum : 1,
53
+ submissionEntryFilter : 'campaign',
54
+ submissionEntryHighscore : false,
55
+ submissionEntryLimit : 1
56
+ },
57
+ status : 'drafted',
58
+ totals : {
59
+ advertisements : 0,
60
+ affiliates : 0,
61
+ draws : 0,
62
+ exports : 0,
63
+ entries : 0,
64
+ fields : 2,
65
+ integrations : 1,
66
+ leads : 0,
67
+ links : 0,
68
+ pages : 0,
69
+ prizes : 0,
70
+ ranges : 0,
71
+ submissions : 0
72
+ },
73
+ type : 'giveaway'
74
+ },
75
+ draw : {
76
+ status : 'qualified',
77
+ totals : {
78
+ notifications : 0
79
+ }
80
+ },
81
+ member : {
82
+ status : 'pending'
83
+ },
84
+ organization : {
85
+ errors : [],
86
+ totals : {
87
+ affiliates : 0,
88
+ brands : 0,
89
+ campaigns : 0,
90
+ leads : 0,
91
+ draws : 0,
92
+ entries : 0,
93
+ invitations : 0,
94
+ invoices : 0,
95
+ members : 0,
96
+ ranges : 0,
97
+ pages : 0,
98
+ prizes : 0,
99
+ storage : 0,
100
+ submissions : 0,
101
+ subscriptions : 0,
102
+ usage : 0
103
+ }
104
+ },
105
+ page : {
106
+ domains : [],
107
+ status : 'drafted',
108
+ totals : {
109
+ leads : 0,
110
+ entries : 0,
111
+ submissions : 0
112
+ }
113
+ },
114
+ prize : {
115
+ inventory : 0,
116
+ remaining : 0,
117
+ shipping : false,
118
+ status : 'drafted',
119
+ totals : {
120
+ draws : 0
121
+ }
122
+ },
123
+ range : {
124
+ totals : {
125
+ leads : 0,
126
+ entries : 0,
127
+ submissions : 0
128
+ }
129
+ },
130
+ referrer : {
131
+ totals : {
132
+ originizations : 0,
133
+ subscriptions : 0,
134
+ users : 0
135
+ }
136
+ },
137
+ template : {
138
+ page : {
139
+ style : {
140
+ body : font,
141
+ heading : font
142
+ }
143
+ }
144
+ },
145
+ usage : {
146
+ totals : {
147
+ actions : 0,
148
+ affiliates : 0,
149
+ brands : 0,
150
+ campaigns : 0,
151
+ connections : 0,
152
+ entries : 0,
153
+ files : 0,
154
+ members : 0,
155
+ orders : 0,
156
+ pages : 0,
157
+ revenue : 0,
158
+ storage : 0,
159
+ submissions : 0,
160
+ workflows : 0
161
+ }
162
+ },
163
+ user : {
164
+ access : {
165
+ ai : false
166
+ },
167
+ image : null,
168
+ totals : {
169
+ inbox : 0,
170
+ invitations : 0,
171
+ messages : 0,
172
+ methods : 0,
173
+ organizations : 1,
174
+ teams : 0
175
+ }
176
+ }
177
+ };
178
+
179
+ const nanoid = customAlphabet( '0123456789abcdefghijklmnopqrstuvwxyz', 8 );
180
+
181
+ const constants = constantsData;
4
182
 
5
183
  const infinite = 1e300;
6
184
 
@@ -232,25 +410,4 @@ const currencies = data.map( ( item ) => ({
232
410
 
233
411
  const currency = ( val ) => code( val );
234
412
 
235
- module.exports = {
236
- bytesToGB,
237
- bytesToMB,
238
- capitalize,
239
- constants,
240
- currencies,
241
- currency,
242
- expiredPaymentMethod,
243
- formatCurrency,
244
- formatDateString,
245
- formatNumber,
246
- getPlanFeature,
247
- gigabyte,
248
- infinite,
249
- isInfinite,
250
- megabyte,
251
- percentage,
252
- reducers,
253
- regex,
254
- shareUrls,
255
- urlRoot
256
- };
413
+ export { bytesToGB, bytesToMB, capitalize, constants, currencies, currency, expiredPaymentMethod, formatCurrency, formatDateString, formatNumber, getPlanFeature, gigabyte, infinite, isInfinite, megabyte, nanoid, percentage, reducers, regex, shareUrls, urlRoot };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,184 @@
1
- const { code, data } = require( 'currency-codes' );
1
+ import { data, code } from 'currency-codes';
2
+ import { customAlphabet } from 'nanoid';
2
3
 
3
- const constants = require( './lib/constants' );
4
+ const font = {
5
+ family : 'Roboto Flex',
6
+ transform : 'none',
7
+ weight : 'regular'
8
+ };
9
+
10
+ var constantsData = {
11
+ action : {
12
+ usage : {
13
+ actions : 0
14
+ }
15
+ },
16
+ brand : {
17
+ style : {
18
+ body : font,
19
+ heading : font
20
+ },
21
+ totals : {
22
+ campaigns : 0
23
+ }
24
+ },
25
+ campaign : {
26
+ agreements : {
27
+ marketing : {
28
+ enabled : false,
29
+ label : 'I agree to the marketing terms and conditions',
30
+ link : null
31
+ },
32
+ terms : {
33
+ enabled : false,
34
+ label : 'I agree to the terms and conditions',
35
+ link : null
36
+ }
37
+ },
38
+ defaults : {
39
+ active : 'Enter',
40
+ confirmation : 'Submission was successful',
41
+ inactive : 'Submissions are closed',
42
+ email : 'You were selected'
43
+ },
44
+ notifications : {
45
+ draw : {
46
+ subject : 'You have been selected',
47
+ body : 'Thanks for being part of our giveaway'
48
+ }
49
+ },
50
+ settings : {
51
+ submissionLeadPrimaryKey : 'email',
52
+ submissionEntryMaximum : 1,
53
+ submissionEntryFilter : 'campaign',
54
+ submissionEntryHighscore : false,
55
+ submissionEntryLimit : 1
56
+ },
57
+ status : 'drafted',
58
+ totals : {
59
+ advertisements : 0,
60
+ affiliates : 0,
61
+ draws : 0,
62
+ exports : 0,
63
+ entries : 0,
64
+ fields : 2,
65
+ integrations : 1,
66
+ leads : 0,
67
+ links : 0,
68
+ pages : 0,
69
+ prizes : 0,
70
+ ranges : 0,
71
+ submissions : 0
72
+ },
73
+ type : 'giveaway'
74
+ },
75
+ draw : {
76
+ status : 'qualified',
77
+ totals : {
78
+ notifications : 0
79
+ }
80
+ },
81
+ member : {
82
+ status : 'pending'
83
+ },
84
+ organization : {
85
+ errors : [],
86
+ totals : {
87
+ affiliates : 0,
88
+ brands : 0,
89
+ campaigns : 0,
90
+ leads : 0,
91
+ draws : 0,
92
+ entries : 0,
93
+ invitations : 0,
94
+ invoices : 0,
95
+ members : 0,
96
+ ranges : 0,
97
+ pages : 0,
98
+ prizes : 0,
99
+ storage : 0,
100
+ submissions : 0,
101
+ subscriptions : 0,
102
+ usage : 0
103
+ }
104
+ },
105
+ page : {
106
+ domains : [],
107
+ status : 'drafted',
108
+ totals : {
109
+ leads : 0,
110
+ entries : 0,
111
+ submissions : 0
112
+ }
113
+ },
114
+ prize : {
115
+ inventory : 0,
116
+ remaining : 0,
117
+ shipping : false,
118
+ status : 'drafted',
119
+ totals : {
120
+ draws : 0
121
+ }
122
+ },
123
+ range : {
124
+ totals : {
125
+ leads : 0,
126
+ entries : 0,
127
+ submissions : 0
128
+ }
129
+ },
130
+ referrer : {
131
+ totals : {
132
+ originizations : 0,
133
+ subscriptions : 0,
134
+ users : 0
135
+ }
136
+ },
137
+ template : {
138
+ page : {
139
+ style : {
140
+ body : font,
141
+ heading : font
142
+ }
143
+ }
144
+ },
145
+ usage : {
146
+ totals : {
147
+ actions : 0,
148
+ affiliates : 0,
149
+ brands : 0,
150
+ campaigns : 0,
151
+ connections : 0,
152
+ entries : 0,
153
+ files : 0,
154
+ members : 0,
155
+ orders : 0,
156
+ pages : 0,
157
+ revenue : 0,
158
+ storage : 0,
159
+ submissions : 0,
160
+ workflows : 0
161
+ }
162
+ },
163
+ user : {
164
+ access : {
165
+ ai : false
166
+ },
167
+ image : null,
168
+ totals : {
169
+ inbox : 0,
170
+ invitations : 0,
171
+ messages : 0,
172
+ methods : 0,
173
+ organizations : 1,
174
+ teams : 0
175
+ }
176
+ }
177
+ };
178
+
179
+ const nanoid = customAlphabet( '0123456789abcdefghijklmnopqrstuvwxyz', 8 );
180
+
181
+ const constants = constantsData;
4
182
 
5
183
  const infinite = 1e300;
6
184
 
@@ -232,25 +410,4 @@ const currencies = data.map( ( item ) => ({
232
410
 
233
411
  const currency = ( val ) => code( val );
234
412
 
235
- module.exports = {
236
- bytesToGB,
237
- bytesToMB,
238
- capitalize,
239
- constants,
240
- currencies,
241
- currency,
242
- expiredPaymentMethod,
243
- formatCurrency,
244
- formatDateString,
245
- formatNumber,
246
- getPlanFeature,
247
- gigabyte,
248
- infinite,
249
- isInfinite,
250
- megabyte,
251
- percentage,
252
- reducers,
253
- regex,
254
- shareUrls,
255
- urlRoot
256
- };
413
+ export { bytesToGB, bytesToMB, capitalize, constants, currencies, currency, expiredPaymentMethod, formatCurrency, formatDateString, formatNumber, getPlanFeature, gigabyte, infinite, isInfinite, megabyte, nanoid, percentage, reducers, regex, shareUrls, urlRoot };