@fairmint/canton-node-sdk 0.0.61 → 0.0.62
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/build/src/clients/ledger-json-api/operations/v2/packages/post.d.ts +4 -4
- package/build/src/clients/ledger-json-api/operations/v2/packages/post.d.ts.map +1 -1
- package/build/src/clients/ledger-json-api/operations/v2/packages/post.js +47 -8
- package/build/src/clients/ledger-json-api/operations/v2/packages/post.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const UploadDarFileParamsSchema: z.ZodObject<{
|
|
3
|
-
|
|
3
|
+
filePath: z.ZodString;
|
|
4
4
|
submissionId: z.ZodOptional<z.ZodString>;
|
|
5
5
|
}, z.core.$strip>;
|
|
6
6
|
export type UploadDarFileParams = z.infer<typeof UploadDarFileParamsSchema>;
|
|
@@ -9,17 +9,17 @@ export type UploadDarFileParams = z.infer<typeof UploadDarFileParamsSchema>;
|
|
|
9
9
|
* @example
|
|
10
10
|
* ```typescript
|
|
11
11
|
* const result = await client.uploadDarFile({
|
|
12
|
-
*
|
|
12
|
+
* filePath: 'my-package.dar',
|
|
13
13
|
* submissionId: 'unique-submission-id'
|
|
14
14
|
* });
|
|
15
15
|
* ```
|
|
16
|
-
* @param
|
|
16
|
+
* @param filePath - Path to the DAR file
|
|
17
17
|
* @param submissionId - Optional submission ID for deduplication
|
|
18
18
|
*/
|
|
19
19
|
export declare const UploadDarFile: {
|
|
20
20
|
new (client: import("../../../../../core").BaseClient): {
|
|
21
21
|
execute(params: {
|
|
22
|
-
|
|
22
|
+
filePath: string;
|
|
23
23
|
submissionId?: string | undefined;
|
|
24
24
|
}): Promise<Record<string, never>>;
|
|
25
25
|
client: import("../../../../../core").BaseClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../../../../../../src/clients/ledger-json-api/operations/v2/packages/post.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../../../../../../src/clients/ledger-json-api/operations/v2/packages/post.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,yBAAyB;;;iBAKpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;CA6BxB,CAAC"}
|
|
@@ -1,12 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.UploadDarFile = exports.UploadDarFileParamsSchema = void 0;
|
|
4
37
|
const zod_1 = require("zod");
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
5
39
|
const core_1 = require("../../../../../core");
|
|
6
40
|
// Schema for the parameters
|
|
7
41
|
exports.UploadDarFileParamsSchema = zod_1.z.object({
|
|
8
|
-
/**
|
|
9
|
-
|
|
42
|
+
/** Path to the DAR file */
|
|
43
|
+
filePath: zod_1.z.string(),
|
|
10
44
|
/** Optional submission ID for deduplication */
|
|
11
45
|
submissionId: zod_1.z.string().optional(),
|
|
12
46
|
});
|
|
@@ -15,11 +49,11 @@ exports.UploadDarFileParamsSchema = zod_1.z.object({
|
|
|
15
49
|
* @example
|
|
16
50
|
* ```typescript
|
|
17
51
|
* const result = await client.uploadDarFile({
|
|
18
|
-
*
|
|
52
|
+
* filePath: 'my-package.dar',
|
|
19
53
|
* submissionId: 'unique-submission-id'
|
|
20
54
|
* });
|
|
21
55
|
* ```
|
|
22
|
-
* @param
|
|
56
|
+
* @param filePath - Path to the DAR file
|
|
23
57
|
* @param submissionId - Optional submission ID for deduplication
|
|
24
58
|
*/
|
|
25
59
|
exports.UploadDarFile = (0, core_1.createApiOperation)({
|
|
@@ -35,11 +69,16 @@ exports.UploadDarFile = (0, core_1.createApiOperation)({
|
|
|
35
69
|
return queryString ? `${baseUrl}?${queryString}` : baseUrl;
|
|
36
70
|
},
|
|
37
71
|
buildRequestData: (params) => {
|
|
38
|
-
//
|
|
39
|
-
if (
|
|
40
|
-
|
|
72
|
+
// Check if file exists
|
|
73
|
+
if (!fs.existsSync(params.filePath)) {
|
|
74
|
+
throw new Error(`File not found: ${params.filePath}`);
|
|
41
75
|
}
|
|
42
|
-
|
|
76
|
+
// Read the file as a buffer
|
|
77
|
+
return fs.readFileSync(params.filePath);
|
|
43
78
|
},
|
|
79
|
+
requestConfig: {
|
|
80
|
+
contentType: 'application/octet-stream',
|
|
81
|
+
includeBearerToken: true
|
|
82
|
+
}
|
|
44
83
|
});
|
|
45
84
|
//# sourceMappingURL=post.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post.js","sourceRoot":"","sources":["../../../../../../../src/clients/ledger-json-api/operations/v2/packages/post.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"post.js","sourceRoot":"","sources":["../../../../../../../src/clients/ledger-json-api/operations/v2/packages/post.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAAwB;AACxB,uCAAyB;AAEzB,8CAAyD;AAEzD,8BAA8B;AACjB,QAAA,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChD,2BAA2B;IAC3B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;IACpB,+CAA+C;IAC/C,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACpC,CAAC,CAAC;AAIH;;;;;;;;;;;GAWG;AACU,QAAA,aAAa,GAAG,IAAA,yBAAkB,EAG7C;IACA,YAAY,EAAE,iCAAyB;IACvC,MAAM,EAAE,MAAM;IACd,QAAQ,EAAE,CAAC,MAA2B,EAAE,MAAc,EAAE,EAAE;QACxD,MAAM,OAAO,GAAG,GAAG,MAAM,cAAc,CAAC;QACxC,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE,CAAC;QAE1C,IAAI,MAAM,CAAC,Y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