@eluvio/elv-client-js 3.1.68 → 3.1.72

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.
@@ -610,24 +610,26 @@ function () {
610
610
  * @param {string=} idToken - OAuth ID token
611
611
  * @param {string=} authToken - Eluvio authorization token previously issued from OAuth ID token
612
612
  * @param {string=} tenantId - If specified, user will be associated with the tenant
613
+ * @param {Object=} extraData - Additional data to pass to the login API
613
614
  */
614
615
 
615
616
  }, {
616
617
  key: "SetRemoteSigner",
617
618
  value: function SetRemoteSigner(_ref9) {
618
- var idToken, authToken, tenantId, address, signer;
619
+ var idToken, authToken, tenantId, address, extraData, signer;
619
620
  return _regeneratorRuntime.async(function SetRemoteSigner$(_context6) {
620
621
  while (1) {
621
622
  switch (_context6.prev = _context6.next) {
622
623
  case 0:
623
- idToken = _ref9.idToken, authToken = _ref9.authToken, tenantId = _ref9.tenantId, address = _ref9.address;
624
+ idToken = _ref9.idToken, authToken = _ref9.authToken, tenantId = _ref9.tenantId, address = _ref9.address, extraData = _ref9.extraData;
624
625
  signer = new RemoteSigner({
625
626
  rpcUris: this.authServiceURIs,
626
627
  idToken: idToken,
627
628
  authToken: authToken,
628
629
  tenantId: tenantId,
629
630
  address: address,
630
- provider: this.ethClient.provider
631
+ provider: this.ethClient.provider,
632
+ extraData: extraData
631
633
  });
632
634
  _context6.next = 4;
633
635
  return _regeneratorRuntime.awrap(signer.Initialize());
@@ -33,7 +33,9 @@ function (_Ethers$Signer) {
33
33
  authToken = _ref.authToken,
34
34
  address = _ref.address,
35
35
  tenantId = _ref.tenantId,
36
- provider = _ref.provider;
36
+ provider = _ref.provider,
37
+ _ref$extraData = _ref.extraData,
38
+ extraData = _ref$extraData === void 0 ? {} : _ref$extraData;
37
39
 
38
40
  _classCallCheck(this, RemoteSigner);
39
41
 
@@ -47,6 +49,7 @@ function (_Ethers$Signer) {
47
49
  _this.authToken = authToken;
48
50
  _this.address = address ? Utils.FormatAddress(address) : undefined;
49
51
  _this.id = _this.address ? "ikms".concat(Utils.AddressToHash(_this.address)) : undefined;
52
+ _this.extraLoginData = extraData || {};
50
53
  _this.provider = provider;
51
54
  return _this;
52
55
  }
@@ -70,8 +73,11 @@ function (_Ethers$Signer) {
70
73
  path: UrlJoin("as", "wlt", "login", "jwt"),
71
74
  method: "POST",
72
75
  body: this.tenantId ? {
73
- tid: this.tenantId
74
- } : {},
76
+ tid: this.tenantId,
77
+ ext: this.extraLoginData || {}
78
+ } : {
79
+ ext: this.extraLoginData || {}
80
+ },
75
81
  headers: {
76
82
  Authorization: "Bearer ".concat(this.idToken)
77
83
  }
package/package-lock.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "3.1.68",
3
+ "version": "3.1.72",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "3.1.68",
3
+ "version": "3.1.72",
4
4
  "description": "Javascript client for the Eluvio Content Fabric",
5
5
  "main": "src/ElvClient.js",
6
6
  "author": "Kevin Talmadge",
@@ -74,7 +74,7 @@
74
74
  "hash.js": "^1.1.7",
75
75
  "image-type": "^4.1.0",
76
76
  "js-polyfills": "^0.1.42",
77
- "jsonpath-plus": "^4.0.0",
77
+ "jsonpath-plus": "^6.0.1",
78
78
  "kind-of": "^6.0.3",
79
79
  "lodash": "^4.17.19",
80
80
  "lodash.isequal": "^4.5.0",
package/src/ElvClient.js CHANGED
@@ -591,15 +591,17 @@ class ElvClient {
591
591
  * @param {string=} idToken - OAuth ID token
592
592
  * @param {string=} authToken - Eluvio authorization token previously issued from OAuth ID token
593
593
  * @param {string=} tenantId - If specified, user will be associated with the tenant
594
+ * @param {Object=} extraData - Additional data to pass to the login API
594
595
  */
595
- async SetRemoteSigner({idToken, authToken, tenantId, address}) {
596
+ async SetRemoteSigner({idToken, authToken, tenantId, address, extraData}) {
596
597
  const signer = new RemoteSigner({
597
598
  rpcUris: this.authServiceURIs,
598
599
  idToken,
599
600
  authToken,
600
601
  tenantId,
601
602
  address,
602
- provider: this.ethClient.provider
603
+ provider: this.ethClient.provider,
604
+ extraData
603
605
  });
604
606
 
605
607
  await signer.Initialize();
@@ -10,7 +10,8 @@ class RemoteSigner extends Ethers.Signer {
10
10
  authToken,
11
11
  address,
12
12
  tenantId,
13
- provider
13
+ provider,
14
+ extraData={}
14
15
  }) {
15
16
  super();
16
17
 
@@ -23,6 +24,7 @@ class RemoteSigner extends Ethers.Signer {
23
24
  this.authToken = authToken;
24
25
  this.address = address ? Utils.FormatAddress(address) : undefined;
25
26
  this.id = this.address ? `ikms${Utils.AddressToHash(this.address)}` : undefined;
27
+ this.extraLoginData = extraData || {};
26
28
 
27
29
  this.provider = provider;
28
30
  }
@@ -33,7 +35,7 @@ class RemoteSigner extends Ethers.Signer {
33
35
  this.HttpClient.Request({
34
36
  path: UrlJoin("as", "wlt", "login", "jwt"),
35
37
  method: "POST",
36
- body: this.tenantId ? {tid: this.tenantId} : {},
38
+ body: this.tenantId ? { tid: this.tenantId, ext: this.extraLoginData || {} } : { ext: this.extraLoginData || {} },
37
39
  headers: {
38
40
  Authorization: `Bearer ${this.idToken}`
39
41
  }
@@ -973,7 +973,7 @@ exports.DownloadEncrypted = async function({
973
973
  * @param {string} libraryId - ID of the library
974
974
  * @param {string} objectId - ID of the object
975
975
  * @param {string} writeToken - Write token of the content object draft
976
- * @param {string=} encryption=none - Desired encryption scheme. Options: 'none (default)', 'cgck'
976
+ * @param {string=} encryption=none - Desired encryption scheme. Options: 'none' (default), 'cgck'
977
977
  *
978
978
  * @returns {Promise<string>} - The part write token for the part draft
979
979
  */
@@ -1008,7 +1008,7 @@ exports.CreatePart = async function({libraryId, objectId, writeToken, encryption
1008
1008
  * @param {string} writeToken - Write token of the content object draft
1009
1009
  * @param {string} partWriteToken - Write token of the part
1010
1010
  * @param {(ArrayBuffer | Buffer)} chunk - Data to upload
1011
- * @param {string=} encryption=none - Desired encryption scheme. Options: 'none (default)', 'cgck'
1011
+ * @param {string=} encryption=none - Desired encryption scheme. Options: 'none' (default), 'cgck'
1012
1012
  *
1013
1013
  * @returns {Promise<string>} - The part write token for the part draft
1014
1014
  */
@@ -1044,7 +1044,7 @@ exports.UploadPartChunk = async function({libraryId, objectId, writeToken, partW
1044
1044
  * @param {string} objectId - ID of the object
1045
1045
  * @param {string} writeToken - Write token of the content object draft
1046
1046
  * @param {string} partWriteToken - Write token of the part
1047
- * @param {string=} encryption=none - Desired encryption scheme. Options: 'none (default)', 'cgck'
1047
+ * @param {string=} encryption=none - Desired encryption scheme. Options: 'none' (default), 'cgck'
1048
1048
  *
1049
1049
  * @returns {Promise<object>} - The finalize response for the new part
1050
1050
  */
@@ -1080,7 +1080,7 @@ exports.FinalizePart = async function({libraryId, objectId, writeToken, partWrit
1080
1080
  * @param {string} writeToken - Write token of the content object draft
1081
1081
  * @param {(File | ArrayBuffer | Buffer)} data - Data to upload
1082
1082
  * @param {number=} chunkSize=1000000 (1MB) - Chunk size, in bytes
1083
- * @param {string=} encryption=none - Desired encryption scheme. Options: 'none (default)', 'cgck'
1083
+ * @param {string=} encryption=none - Desired encryption scheme. Options: 'none' (default), 'cgck'
1084
1084
  * @param {function=} callback - If specified, will be periodically called with current upload status
1085
1085
  * - Signature: ({bytesFinished, bytesTotal}) => {}
1086
1086
  *
@@ -60,6 +60,7 @@ class OfferingAddCaptionStream extends ScriptOffering {
60
60
  async body() {
61
61
  const client = await this.client();
62
62
 
63
+ const encrypt = this.args.encrypt;
63
64
  const libraryId = this.args.libraryId;
64
65
  const objectId = this.args.objectId;
65
66
  const offeringKey = this.args.offeringKey;
@@ -107,7 +108,7 @@ class OfferingAddCaptionStream extends ScriptOffering {
107
108
  objectId,
108
109
  writeToken,
109
110
  data: finalData,
110
- encryption: "cgck"
111
+ encryption: encrypt ? "cgck" : "none"
111
112
  });
112
113
  const partHash = uploadPartResponse.part.hash;
113
114
  let finalizeResponse = await client.FinalizeContentObject({
@@ -238,6 +239,10 @@ class OfferingAddCaptionStream extends ScriptOffering {
238
239
 
239
240
  options() {
240
241
  return super.options()
242
+ .option("encrypt", {
243
+ describe: "Store caption file encrypted",
244
+ type: "boolean"
245
+ })
241
246
  .option("file", {
242
247
  alias: "f",
243
248
  demandOption: true,
@@ -1860,6 +1860,52 @@
1860
1860
  "width": 640
1861
1861
  }
1862
1862
  ]
1863
+ },
1864
+ "{\"media_type\":\"video\",\"aspect_ratio_height\":1,\"aspect_ratio_width\":1}": {
1865
+ "rung_specs": [
1866
+ {
1867
+ "bit_rate": 9500000,
1868
+ "height": 1080,
1869
+ "media_type": "video",
1870
+ "pregenerate": true,
1871
+ "width": 1080
1872
+ },
1873
+ {
1874
+ "bit_rate": 4500000,
1875
+ "height": 720,
1876
+ "media_type": "video",
1877
+ "pregenerate": false,
1878
+ "width": 720
1879
+ },
1880
+ {
1881
+ "bit_rate": 2000000,
1882
+ "height": 540,
1883
+ "media_type": "video",
1884
+ "pregenerate": false,
1885
+ "width": 540
1886
+ },
1887
+ {
1888
+ "bit_rate": 1100000,
1889
+ "height": 432,
1890
+ "media_type": "video",
1891
+ "pregenerate": false,
1892
+ "width": 432
1893
+ },
1894
+ {
1895
+ "bit_rate": 810000,
1896
+ "height": 360,
1897
+ "media_type": "video",
1898
+ "pregenerate": false,
1899
+ "width": 360
1900
+ },
1901
+ {
1902
+ "bit_rate": 520000,
1903
+ "height": 360,
1904
+ "media_type": "video",
1905
+ "pregenerate": false,
1906
+ "width": 360
1907
+ }
1908
+ ]
1863
1909
  }
1864
1910
  },
1865
1911
  "playout_formats": {
@@ -1860,6 +1860,52 @@
1860
1860
  "width": 640
1861
1861
  }
1862
1862
  ]
1863
+ },
1864
+ "{\"media_type\":\"video\",\"aspect_ratio_height\":1,\"aspect_ratio_width\":1}": {
1865
+ "rung_specs": [
1866
+ {
1867
+ "bit_rate": 9500000,
1868
+ "height": 1080,
1869
+ "media_type": "video",
1870
+ "pregenerate": true,
1871
+ "width": 1080
1872
+ },
1873
+ {
1874
+ "bit_rate": 4500000,
1875
+ "height": 720,
1876
+ "media_type": "video",
1877
+ "pregenerate": false,
1878
+ "width": 720
1879
+ },
1880
+ {
1881
+ "bit_rate": 2000000,
1882
+ "height": 540,
1883
+ "media_type": "video",
1884
+ "pregenerate": false,
1885
+ "width": 540
1886
+ },
1887
+ {
1888
+ "bit_rate": 1100000,
1889
+ "height": 432,
1890
+ "media_type": "video",
1891
+ "pregenerate": false,
1892
+ "width": 432
1893
+ },
1894
+ {
1895
+ "bit_rate": 810000,
1896
+ "height": 360,
1897
+ "media_type": "video",
1898
+ "pregenerate": false,
1899
+ "width": 360
1900
+ },
1901
+ {
1902
+ "bit_rate": 520000,
1903
+ "height": 360,
1904
+ "media_type": "video",
1905
+ "pregenerate": false,
1906
+ "width": 360
1907
+ }
1908
+ ]
1863
1909
  }
1864
1910
  },
1865
1911
  "playout_formats": {
@@ -1860,6 +1860,52 @@
1860
1860
  "width": 640
1861
1861
  }
1862
1862
  ]
1863
+ },
1864
+ "{\"media_type\":\"video\",\"aspect_ratio_height\":1,\"aspect_ratio_width\":1}": {
1865
+ "rung_specs": [
1866
+ {
1867
+ "bit_rate": 9500000,
1868
+ "height": 1080,
1869
+ "media_type": "video",
1870
+ "pregenerate": true,
1871
+ "width": 1080
1872
+ },
1873
+ {
1874
+ "bit_rate": 4500000,
1875
+ "height": 720,
1876
+ "media_type": "video",
1877
+ "pregenerate": false,
1878
+ "width": 720
1879
+ },
1880
+ {
1881
+ "bit_rate": 2000000,
1882
+ "height": 540,
1883
+ "media_type": "video",
1884
+ "pregenerate": false,
1885
+ "width": 540
1886
+ },
1887
+ {
1888
+ "bit_rate": 1100000,
1889
+ "height": 432,
1890
+ "media_type": "video",
1891
+ "pregenerate": false,
1892
+ "width": 432
1893
+ },
1894
+ {
1895
+ "bit_rate": 810000,
1896
+ "height": 360,
1897
+ "media_type": "video",
1898
+ "pregenerate": false,
1899
+ "width": 360
1900
+ },
1901
+ {
1902
+ "bit_rate": 520000,
1903
+ "height": 360,
1904
+ "media_type": "video",
1905
+ "pregenerate": false,
1906
+ "width": 360
1907
+ }
1908
+ ]
1863
1909
  }
1864
1910
  },
1865
1911
  "playout_formats": {
@@ -93,6 +93,33 @@ const eventSiteSpec = {
93
93
  "type": "text",
94
94
  "hint": "Displayed when the event is featured on the main page"
95
95
  },
96
+ {
97
+ "name": "feature_button",
98
+ "type": "subsection",
99
+ "fields": [
100
+ {
101
+ "name": "text",
102
+ "type": "text",
103
+ "default_value": "Join the Drop"
104
+ },
105
+ {
106
+ "name": "text_color",
107
+ "type": "color",
108
+ "no_label": true,
109
+ "default_value": {
110
+ "color": "#000000"
111
+ }
112
+ },
113
+ {
114
+ "name": "background_color",
115
+ "type": "color",
116
+ "no_label": true,
117
+ "default_value": {
118
+ "color": "#d7bb73"
119
+ }
120
+ }
121
+ ]
122
+ },
96
123
  {
97
124
  "name": "event_header",
98
125
  "type": "text",
@@ -120,7 +147,12 @@ const eventSiteSpec = {
120
147
  },
121
148
  {
122
149
  "name": "copyright",
123
- "type": "textarea"
150
+ "type": "rich_text"
151
+ },
152
+ {
153
+ "name": "show_cookie_banner",
154
+ "type": "checkbox",
155
+ "default_value": false
124
156
  },
125
157
  {
126
158
  "name": "modal_message_get_started",
@@ -141,6 +173,53 @@ const eventSiteSpec = {
141
173
  {
142
174
  "name": "message",
143
175
  "type": "rich_text"
176
+ },
177
+ {
178
+ "name": "button_text",
179
+ "type": "text",
180
+ "hint": "Text for the button at the bottom of the modal. By default, it will be 'Create Wallet' if login is required for the next drop, otherwise it will be 'Join the Drop'"
181
+ },
182
+ {
183
+ "name": "post_login",
184
+ "label": "Post Login Modal",
185
+ "type": "subsection",
186
+ "hint": "If specified, modal will be shown after a user goes through the login process from the 'Get Started' modal",
187
+ "fields": [
188
+ {
189
+ "name": "show",
190
+ "type": "checkbox",
191
+ },
192
+ {
193
+ "name": "image",
194
+ "type": "file",
195
+ "extensions": imageTypes
196
+ },
197
+ {
198
+ "name": "message",
199
+ "type": "rich_text"
200
+ },
201
+ {
202
+ "name": "button_text",
203
+ "type": "text",
204
+ "hint": "Text for the button at the bottom of the modal. By default, it will be 'Go to the Marketplace' if 'Show Marketplace' is checked, otherwise it will be 'Close'"
205
+ },
206
+ {
207
+ "name": "show_marketplace",
208
+ "type": "checkbox",
209
+ "hint": "Show the marketplace after the post login modal"
210
+ },
211
+ {
212
+ "name": "marketplace_filters",
213
+ "type": "list",
214
+ "hint": "Use this fields to filter the items shown"
215
+ },
216
+ {
217
+ "name": "hide_navigation",
218
+ "label": "Hide Marketplace Navigation",
219
+ "type": "checkbox",
220
+ "hint": "If checked, the back button will not be shown in the marketplace."
221
+ }
222
+ ]
144
223
  }
145
224
  ]
146
225
  }
@@ -155,6 +234,11 @@ const eventSiteSpec = {
155
234
  "type": "file",
156
235
  "extensions": imageTypes
157
236
  },
237
+ {
238
+ "name": "logo_link",
239
+ "type": "text",
240
+ "hint": "If a custom logo is set, this field will specify a custom URL for the logo to link to."
241
+ },
158
242
  {
159
243
  "extensions": imageTypes,
160
244
  "name": "hero_background",
@@ -210,6 +294,12 @@ const eventSiteSpec = {
210
294
  }
211
295
  ]
212
296
  },
297
+ {
298
+ "name": "sponsor_tagline",
299
+ "type": "text",
300
+ "hint": "Customize what shows above the sponsor list",
301
+ "default_value": "Sponsored by"
302
+ },
213
303
  {
214
304
  "fields": [
215
305
  {
@@ -277,6 +367,33 @@ const eventSiteSpec = {
277
367
  "name": "event_landing_page",
278
368
  "type": "subsection"
279
369
  },
370
+ {
371
+ "name": "footer_links",
372
+ "type": "list",
373
+ "hint": "Specify links to include in the footer of the event, such as privacy or terms policies. Each item can either be specified as a URL, rich text, or an HTML document. The two latter options will be shown in a modal when clicked.",
374
+ "fields": [
375
+ {
376
+ "name": "text",
377
+ "type": "text"
378
+ },
379
+ {
380
+ "name": "url",
381
+ "label": "URL Link",
382
+ "type": "text"
383
+ },
384
+ {
385
+ "label": "Content (Rich Text)",
386
+ "name": "content_rich_text",
387
+ "type": "rich_text"
388
+ },
389
+ {
390
+ "label": "Content (HTML)",
391
+ "name": "content_html",
392
+ "type": "file",
393
+ "extensions": ["html"]
394
+ }
395
+ ]
396
+ },
280
397
  {
281
398
  "name": "drops",
282
399
  "type": "list",
@@ -287,6 +404,11 @@ const eventSiteSpec = {
287
404
  "type": "uuid",
288
405
  "no_localize": true
289
406
  },
407
+ {
408
+ "name": "requires_login",
409
+ "type": "checkbox",
410
+ "default_value": true
411
+ },
290
412
  {
291
413
  "name": "event_header",
292
414
  "type": "text",
@@ -320,7 +442,12 @@ const eventSiteSpec = {
320
442
  "hint": "After the drop, the wallet panel will be redirected to the store. Use these fields to filter the items shown"
321
443
  },
322
444
  {
323
- "name": "voting_header",
445
+ "name": "drop_header",
446
+ "type": "text",
447
+ "hint": "Text to show during the voting stage above the list of NFTs"
448
+ },
449
+ {
450
+ "name": "drop_subheader",
324
451
  "type": "text",
325
452
  "hint": "Text to show during the voting stage above the list of NFTs"
326
453
  },
@@ -347,6 +474,25 @@ const eventSiteSpec = {
347
474
  }
348
475
  ]
349
476
  },
477
+ {
478
+ "fields": [
479
+ {
480
+ "name": "title",
481
+ "type": "text"
482
+ },
483
+ {
484
+ "name": "description",
485
+ "type": "textarea"
486
+ },
487
+ {
488
+ "name": "location",
489
+ "type": "text"
490
+ }
491
+ ],
492
+ "label": "Calendar Event Info",
493
+ "name": "calendar",
494
+ "type": "subsection"
495
+ },
350
496
  {
351
497
  "name": "event_state_preroll",
352
498
  "label": "Event State: Preroll",
@@ -666,6 +812,113 @@ const eventSiteSpec = {
666
812
  }
667
813
  ]
668
814
  },
815
+ {
816
+ "name": "branding",
817
+ "label": "Custom Branding",
818
+ "type": "subsection",
819
+ "fields": [
820
+ {
821
+ "name": "get_started",
822
+ "label": "'Get Started' Button",
823
+ "type": "subsection",
824
+ "fields": [
825
+ {
826
+ "name": "text",
827
+ "type": "text",
828
+ "default_value": "Get Started"
829
+ },
830
+ {
831
+ "name": "text_color",
832
+ "type": "color",
833
+ "no_label": true,
834
+ "default_value": {
835
+ "color": "#000000"
836
+ }
837
+ },
838
+ {
839
+ "name": "background_color",
840
+ "type": "color",
841
+ "no_label": true,
842
+ "default_value": {
843
+ "color": "#d7bb73"
844
+ }
845
+ }
846
+ ]
847
+ },
848
+ {
849
+ "name": "join_drop",
850
+ "label": "'Join the Drop' Button",
851
+ "type": "subsection",
852
+ "fields": [
853
+ {
854
+ "name": "text",
855
+ "type": "text",
856
+ "default_value": "Join the Drop"
857
+ },
858
+ {
859
+ "name": "text_color",
860
+ "type": "color",
861
+ "no_label": true,
862
+ "default_value": {
863
+ "color": "#000000"
864
+ }
865
+ },
866
+ {
867
+ "name": "background_color",
868
+ "type": "color",
869
+ "no_label": true,
870
+ "default_value": {
871
+ "color": "#d7bb73"
872
+ }
873
+ }
874
+ ]
875
+ },
876
+ {
877
+ "name": "watch_promo",
878
+ "label": "'Watch Promo' Button",
879
+ "type": "subsection",
880
+ "fields": [
881
+ {
882
+ "name": "text",
883
+ "type": "text",
884
+ "default_value": "Watch Promo"
885
+ },
886
+ {
887
+ "name": "text_color",
888
+ "type": "color",
889
+ "no_label": true,
890
+ "default_value": {
891
+ "color": "#FFFFFF"
892
+ }
893
+ },
894
+ {
895
+ "name": "background_color",
896
+ "type": "color",
897
+ "no_label": true,
898
+ "default_value": {
899
+ "color": "#000000"
900
+ }
901
+ }
902
+ ]
903
+ }
904
+ ]
905
+ },
906
+ {
907
+ "name": "faq",
908
+ "label": "FAQ",
909
+ "hint": "Specify a custom FAQ. If blank, the default FAQ will be displayed",
910
+ "type": "list",
911
+ "fields": [
912
+ {
913
+ "name": "question",
914
+ "type": "text"
915
+ },
916
+ {
917
+ "name": "answer",
918
+ "type": "textarea"
919
+ }
920
+ ]
921
+ },
669
922
  {
670
923
  "name": "analytics_ids",
671
924
  "label": "Analytics IDs",