@digipair/skill-s3 0.94.0-3 → 0.94.0-4

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 (47) hide show
  1. package/README.md +7 -0
  2. package/dist/index.cjs.js +22 -0
  3. package/dist/index.cjs10.js +1581 -0
  4. package/dist/index.cjs11.js +2639 -0
  5. package/dist/index.cjs2.js +25 -0
  6. package/dist/index.cjs3.js +39239 -0
  7. package/dist/index.cjs4.js +450 -0
  8. package/dist/index.cjs5.js +3698 -0
  9. package/dist/index.cjs6.js +433 -0
  10. package/dist/index.cjs7.js +706 -0
  11. package/dist/index.cjs8.js +1691 -0
  12. package/dist/index.cjs9.js +1515 -0
  13. package/dist/index.esm.js +13 -0
  14. package/dist/index.esm10.js +1577 -0
  15. package/dist/index.esm11.js +2619 -0
  16. package/dist/index.esm2.js +13 -0
  17. package/dist/index.esm3.js +39118 -0
  18. package/dist/index.esm4.js +447 -0
  19. package/dist/index.esm5.js +3676 -0
  20. package/dist/index.esm6.js +431 -0
  21. package/dist/index.esm7.js +704 -0
  22. package/dist/index.esm8.js +1689 -0
  23. package/dist/index.esm9.js +1504 -0
  24. package/dist/loadSso.cjs.js +2092 -0
  25. package/dist/loadSso.esm.js +2089 -0
  26. package/dist/noAuth.cjs.js +167 -0
  27. package/dist/noAuth.esm.js +165 -0
  28. package/dist/package.cjs.js +187 -0
  29. package/dist/package.esm.js +184 -0
  30. package/dist/parseJsonBody.cjs.js +257 -0
  31. package/dist/parseJsonBody.esm.js +252 -0
  32. package/dist/parseKnownFiles.cjs.js +250 -0
  33. package/dist/parseKnownFiles.esm.js +248 -0
  34. package/dist/src/index.d.ts +2 -0
  35. package/dist/src/index.d.ts.map +1 -0
  36. package/{libs/skill-s3 → dist}/src/lib/skill-s3.d.ts +1 -0
  37. package/dist/src/lib/skill-s3.d.ts.map +1 -0
  38. package/dist/src/lib/skill-s3.spec.d.ts +2 -0
  39. package/dist/src/lib/skill-s3.spec.d.ts.map +1 -0
  40. package/package.json +20 -6
  41. package/index.cjs.js +0 -72
  42. package/index.d.ts +0 -1
  43. package/index.esm.js +0 -65
  44. package/libs/skill-s3/src/index.d.ts +0 -1
  45. /package/{index.cjs.d.ts → dist/index.d.ts} +0 -0
  46. /package/{schema.fr.json → dist/schema.fr.json} +0 -0
  47. /package/{schema.json → dist/schema.json} +0 -0
package/index.esm.js DELETED
@@ -1,65 +0,0 @@
1
- import { S3Client, PutObjectCommand, GetObjectCommand, DeleteObjectCommand, ListObjectsV2Command } from '@aws-sdk/client-s3';
2
-
3
- let S3Service = class S3Service {
4
- getClient(config) {
5
- return new S3Client(config);
6
- }
7
- async upload(params, _pinsSettingsList, context) {
8
- const { bucket, key, content, config = context.privates.S3_CONFIG } = params;
9
- const client = this.getClient(config);
10
- const match = content.match(/^data:(.*?);base64,/);
11
- const contentType = match[1];
12
- const command = new PutObjectCommand({
13
- Bucket: bucket,
14
- Key: key,
15
- Body: Buffer.from(content.replace(/^data:.*;base64,/, ''), 'base64'),
16
- ContentType: contentType
17
- });
18
- return await client.send(command);
19
- }
20
- async download(params, _pinsSettingsList, context) {
21
- const { bucket, key, range, config = context.privates.S3_CONFIG } = params;
22
- const client = this.getClient(config);
23
- const command = new GetObjectCommand({
24
- Bucket: bucket,
25
- Key: key,
26
- Range: range
27
- });
28
- const response = await client.send(command);
29
- const stream = response.Body;
30
- const chunks = [];
31
- for await (const chunk of stream){
32
- chunks.push(chunk);
33
- }
34
- const buffer = Buffer.concat(chunks);
35
- const base64 = buffer.toString('base64');
36
- return `data:${response.ContentType};base64,${base64}`;
37
- }
38
- async delete(params, _pinsSettingsList, context) {
39
- const { bucket, key, config = context.privates.S3_CONFIG } = params;
40
- const client = this.getClient(config);
41
- const command = new DeleteObjectCommand({
42
- Bucket: bucket,
43
- Key: key
44
- });
45
- await client.send(command);
46
- return client.send(command);
47
- }
48
- async list(params, _pinsSettingsList, context) {
49
- const { bucket, prefix = '', config = context.privates.S3_CONFIG } = params;
50
- const client = this.getClient(config);
51
- const command = new ListObjectsV2Command({
52
- Bucket: bucket,
53
- Prefix: prefix
54
- });
55
- return await client.send(command);
56
- }
57
- };
58
- // Export helpers
59
- const service = new S3Service();
60
- const upload = (params, pinsSettingsList, context)=>service.upload(params, pinsSettingsList, context);
61
- const download = (params, pinsSettingsList, context)=>service.download(params, pinsSettingsList, context);
62
- const remove = (params, pinsSettingsList, context)=>service.delete(params, pinsSettingsList, context);
63
- const list = (params, pinsSettingsList, context)=>service.list(params, pinsSettingsList, context);
64
-
65
- export { download, list, remove, upload };
@@ -1 +0,0 @@
1
- export * from './lib/skill-s3';
File without changes
File without changes
File without changes