@azure/ai-projects 2.7.0 → 2.7.1

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 (122) hide show
  1. package/README.md +5 -0
  2. package/dist/browser/api/beta/models/operations.d.ts +1 -2
  3. package/dist/browser/api/beta/models/operations.d.ts.map +1 -1
  4. package/dist/browser/api/beta/models/operations.js +0 -59
  5. package/dist/browser/api/beta/models/operations.js.map +1 -1
  6. package/dist/browser/api/beta/models/uploads.d.ts +5 -0
  7. package/dist/browser/api/beta/models/uploads.d.ts.map +1 -0
  8. package/dist/browser/api/beta/models/uploads.js +6 -0
  9. package/dist/browser/api/beta/models/uploads.js.map +1 -0
  10. package/dist/browser/api/datasets/operations.d.ts +1 -3
  11. package/dist/browser/api/datasets/operations.d.ts.map +1 -1
  12. package/dist/browser/api/datasets/operations.js +0 -129
  13. package/dist/browser/api/datasets/operations.js.map +1 -1
  14. package/dist/browser/api/datasets/uploads.d.ts +5 -0
  15. package/dist/browser/api/datasets/uploads.d.ts.map +1 -0
  16. package/dist/browser/api/datasets/uploads.js +9 -0
  17. package/dist/browser/api/datasets/uploads.js.map +1 -0
  18. package/dist/browser/classic/beta/models/index.d.ts +1 -1
  19. package/dist/browser/classic/beta/models/index.d.ts.map +1 -1
  20. package/dist/browser/classic/beta/models/index.js +2 -1
  21. package/dist/browser/classic/beta/models/index.js.map +1 -1
  22. package/dist/browser/classic/datasets/index.d.ts +2 -2
  23. package/dist/browser/classic/datasets/index.d.ts.map +1 -1
  24. package/dist/browser/classic/datasets/index.js +2 -1
  25. package/dist/browser/classic/datasets/index.js.map +1 -1
  26. package/dist/browser/constants.d.ts +1 -1
  27. package/dist/browser/constants.js +1 -1
  28. package/dist/browser/constants.js.map +1 -1
  29. package/dist/browser/package.json +1 -1
  30. package/dist/commonjs/api/beta/models/operations.d.ts +1 -2
  31. package/dist/commonjs/api/beta/models/operations.d.ts.map +1 -1
  32. package/dist/commonjs/api/beta/models/operations.js +0 -68
  33. package/dist/commonjs/api/beta/models/operations.js.map +3 -3
  34. package/dist/commonjs/api/beta/models/uploads.d.ts +5 -0
  35. package/dist/commonjs/api/beta/models/uploads.d.ts.map +1 -0
  36. package/dist/commonjs/api/beta/models/uploads.js +94 -0
  37. package/dist/commonjs/api/beta/models/uploads.js.map +7 -0
  38. package/dist/commonjs/api/datasets/operations.d.ts +1 -3
  39. package/dist/commonjs/api/datasets/operations.d.ts.map +1 -1
  40. package/dist/commonjs/api/datasets/operations.js +2 -147
  41. package/dist/commonjs/api/datasets/operations.js.map +3 -3
  42. package/dist/commonjs/api/datasets/uploads.d.ts +5 -0
  43. package/dist/commonjs/api/datasets/uploads.d.ts.map +1 -0
  44. package/dist/commonjs/api/datasets/uploads.js +171 -0
  45. package/dist/commonjs/api/datasets/uploads.js.map +7 -0
  46. package/dist/commonjs/classic/beta/models/index.d.ts +1 -1
  47. package/dist/commonjs/classic/beta/models/index.d.ts.map +1 -1
  48. package/dist/commonjs/classic/beta/models/index.js +2 -1
  49. package/dist/commonjs/classic/beta/models/index.js.map +2 -2
  50. package/dist/commonjs/classic/datasets/index.d.ts +2 -2
  51. package/dist/commonjs/classic/datasets/index.d.ts.map +1 -1
  52. package/dist/commonjs/classic/datasets/index.js +3 -2
  53. package/dist/commonjs/classic/datasets/index.js.map +2 -2
  54. package/dist/commonjs/constants.d.ts +1 -1
  55. package/dist/commonjs/constants.js +1 -1
  56. package/dist/commonjs/constants.js.map +1 -1
  57. package/dist/commonjs/package.json +1 -1
  58. package/dist/esm/api/beta/models/operations.d.ts +1 -2
  59. package/dist/esm/api/beta/models/operations.d.ts.map +1 -1
  60. package/dist/esm/api/beta/models/operations.js +0 -59
  61. package/dist/esm/api/beta/models/operations.js.map +1 -1
  62. package/dist/esm/api/beta/models/uploads.d.ts +5 -0
  63. package/dist/esm/api/beta/models/uploads.d.ts.map +1 -0
  64. package/dist/esm/api/beta/models/uploads.js +63 -0
  65. package/dist/esm/api/beta/models/uploads.js.map +1 -0
  66. package/dist/esm/api/datasets/operations.d.ts +1 -3
  67. package/dist/esm/api/datasets/operations.d.ts.map +1 -1
  68. package/dist/esm/api/datasets/operations.js +0 -129
  69. package/dist/esm/api/datasets/operations.js.map +1 -1
  70. package/dist/esm/api/datasets/uploads.d.ts +5 -0
  71. package/dist/esm/api/datasets/uploads.d.ts.map +1 -0
  72. package/dist/esm/api/datasets/uploads.js +133 -0
  73. package/dist/esm/api/datasets/uploads.js.map +1 -0
  74. package/dist/esm/classic/beta/models/index.d.ts +1 -1
  75. package/dist/esm/classic/beta/models/index.d.ts.map +1 -1
  76. package/dist/esm/classic/beta/models/index.js +2 -1
  77. package/dist/esm/classic/beta/models/index.js.map +1 -1
  78. package/dist/esm/classic/datasets/index.d.ts +2 -2
  79. package/dist/esm/classic/datasets/index.d.ts.map +1 -1
  80. package/dist/esm/classic/datasets/index.js +2 -1
  81. package/dist/esm/classic/datasets/index.js.map +1 -1
  82. package/dist/esm/constants.d.ts +1 -1
  83. package/dist/esm/constants.js +1 -1
  84. package/dist/esm/constants.js.map +1 -1
  85. package/dist/esm/package.json +1 -1
  86. package/dist/react-native/api/beta/models/operations.d.ts +1 -2
  87. package/dist/react-native/api/beta/models/operations.d.ts.map +1 -1
  88. package/dist/react-native/api/beta/models/operations.js +0 -59
  89. package/dist/react-native/api/beta/models/operations.js.map +1 -1
  90. package/dist/react-native/api/beta/models/uploads-browser.d.mts +5 -0
  91. package/dist/react-native/api/beta/models/uploads-browser.d.mts.map +1 -0
  92. package/dist/react-native/api/beta/models/uploads-browser.mjs +6 -0
  93. package/dist/react-native/api/beta/models/uploads-browser.mjs.map +1 -0
  94. package/dist/react-native/api/beta/models/uploads.d.ts +2 -0
  95. package/dist/react-native/api/beta/models/uploads.d.ts.map +1 -0
  96. package/dist/react-native/api/beta/models/uploads.js +4 -0
  97. package/dist/react-native/api/beta/models/uploads.js.map +1 -0
  98. package/dist/react-native/api/datasets/operations.d.ts +1 -3
  99. package/dist/react-native/api/datasets/operations.d.ts.map +1 -1
  100. package/dist/react-native/api/datasets/operations.js +0 -129
  101. package/dist/react-native/api/datasets/operations.js.map +1 -1
  102. package/dist/react-native/api/datasets/uploads-browser.d.mts +5 -0
  103. package/dist/react-native/api/datasets/uploads-browser.d.mts.map +1 -0
  104. package/dist/react-native/api/datasets/uploads-browser.mjs +9 -0
  105. package/dist/react-native/api/datasets/uploads-browser.mjs.map +1 -0
  106. package/dist/react-native/api/datasets/uploads.d.ts +2 -0
  107. package/dist/react-native/api/datasets/uploads.d.ts.map +1 -0
  108. package/dist/react-native/api/datasets/uploads.js +4 -0
  109. package/dist/react-native/api/datasets/uploads.js.map +1 -0
  110. package/dist/react-native/classic/beta/models/index.d.ts +1 -1
  111. package/dist/react-native/classic/beta/models/index.d.ts.map +1 -1
  112. package/dist/react-native/classic/beta/models/index.js +2 -1
  113. package/dist/react-native/classic/beta/models/index.js.map +1 -1
  114. package/dist/react-native/classic/datasets/index.d.ts +2 -2
  115. package/dist/react-native/classic/datasets/index.d.ts.map +1 -1
  116. package/dist/react-native/classic/datasets/index.js +2 -1
  117. package/dist/react-native/classic/datasets/index.js.map +1 -1
  118. package/dist/react-native/constants.d.ts +1 -1
  119. package/dist/react-native/constants.js +1 -1
  120. package/dist/react-native/constants.js.map +1 -1
  121. package/dist/react-native/package.json +1 -1
  122. package/package.json +5 -2
@@ -1,8 +1,6 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __export = (target, all) => {
8
6
  for (var name in all)
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
16
14
  }
17
15
  return to;
18
16
  };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
18
  var operations_exports = {};
29
19
  __export(operations_exports, {
@@ -47,19 +37,13 @@ __export(operations_exports, {
47
37
  getCredentials: () => getCredentials,
48
38
  list: () => list,
49
39
  listVersions: () => listVersions,
50
- pendingUpload: () => pendingUpload,
51
- uploadFile: () => uploadFile,
52
- uploadFolder: () => uploadFolder
40
+ pendingUpload: () => pendingUpload
53
41
  });
54
42
  module.exports = __toCommonJS(operations_exports);
55
- var import_node_fs = __toESM(require("node:fs"));
56
- var import_node_path = __toESM(require("node:path"));
57
43
  var import_models = require("../../models/models.js");
58
44
  var import_pagingHelpers = require("../../static-helpers/pagingHelpers.js");
59
45
  var import_urlTemplate = require("../../static-helpers/urlTemplate.js");
60
46
  var import_core_client = require("@azure-rest/core-client");
61
- var import_storage_blob = require("@azure/storage-blob");
62
- var import_logger = require("../../logger.js");
63
47
  function _getCredentialsSend(context, name, version, options = { requestOptions: {} }) {
64
48
  const path = (0, import_urlTemplate.expandUrlTemplate)(
65
49
  "/datasets/{name}/versions/{version}/credentials{?api-version}",
@@ -282,133 +266,6 @@ function listVersions(context, name, options = { requestOptions: {} }) {
282
266
  { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion }
283
267
  );
284
268
  }
285
- async function createDatasetAndGetItsContainer(context, name, version, options) {
286
- const { connectionName, projectOptions = {} } = options || {};
287
- const pendingUploadResponse = await pendingUpload(context, name, version, {
288
- pendingUploadType: "BlobReference",
289
- connectionName
290
- });
291
- const blobReference = pendingUploadResponse.blobReference;
292
- if (!blobReference) {
293
- throw new Error("Blob reference for consumption is not present");
294
- }
295
- if (!blobReference.credential?.type) {
296
- throw new Error("Credential type is not present");
297
- }
298
- if (blobReference.credential.type !== "SAS") {
299
- throw new Error("Credential type is not SAS");
300
- }
301
- if (!blobReference.blobUri) {
302
- throw new Error("Blob URI is not present or empty");
303
- }
304
- import_logger.logger.verbose(
305
- `[createDatasetAndGetItsContainer] pendingUploadResponse.pendingUploadId = ${pendingUploadResponse.pendingUploadId}`
306
- );
307
- import_logger.logger.verbose(
308
- `[createDatasetAndGetItsContainer] pendingUploadResponse.pendingUploadType = ${pendingUploadResponse.pendingUploadType}`
309
- );
310
- import_logger.logger.verbose(
311
- `[createDatasetAndGetItsContainer] blobReference.storageAccountArmId = ${blobReference.storageAccountArmId}`
312
- );
313
- import_logger.logger.verbose(
314
- `[createDatasetAndGetItsContainer] blobReference.credential.type = ${blobReference.credential.type}`
315
- );
316
- const containerClient = new import_storage_blob.ContainerClient(blobReference.credential.sasUri);
317
- const pipeline = containerClient["storageClientContext"].pipeline;
318
- for (const { policy } of projectOptions.additionalPolicies ?? []) {
319
- pipeline.addPolicy(policy, { afterPhase: "Sign" });
320
- }
321
- return {
322
- containerClient,
323
- version
324
- };
325
- }
326
- async function uploadFile(context, name, version, filePath, options) {
327
- const fileExists = import_node_fs.default.existsSync(filePath);
328
- if (!fileExists) {
329
- throw new Error(`File does not exist at path: ${filePath}`);
330
- }
331
- const isDirectory = import_node_fs.default.lstatSync(filePath).isDirectory();
332
- if (isDirectory) {
333
- throw new Error(`The provided file is actually a folder. Use method uploadFolder instead`);
334
- }
335
- const { containerClient, version: outputVersion } = await createDatasetAndGetItsContainer(
336
- context,
337
- name,
338
- version,
339
- options
340
- );
341
- const blobName = import_node_path.default.basename(filePath);
342
- const blockBlobClient = containerClient.getBlockBlobClient(blobName);
343
- await blockBlobClient.uploadStream(import_node_fs.default.createReadStream(filePath));
344
- const datasetVersion = await createOrUpdate(context, name, outputVersion, {
345
- name,
346
- version: outputVersion,
347
- type: "uri_file",
348
- dataUri: blockBlobClient.url
349
- });
350
- return datasetVersion;
351
- }
352
- async function uploadFolder(context, name, version, folderPath, options) {
353
- const folderExists = import_node_fs.default.existsSync(folderPath);
354
- if (!folderExists) {
355
- throw new Error(`Folder does not exist at path: ${folderPath}`);
356
- }
357
- const isFile = import_node_fs.default.lstatSync(folderPath).isFile();
358
- if (isFile) {
359
- throw new Error(`The provided path is actually a file. Use method uploadFile instead`);
360
- }
361
- const { containerClient, version: outputVersion } = await createDatasetAndGetItsContainer(
362
- context,
363
- name,
364
- version,
365
- options
366
- );
367
- async function getAllFiles(dir, fileList = []) {
368
- const files = await import_node_fs.default.promises.readdir(dir);
369
- for (const file of files) {
370
- const filePath = `${dir}/${file}`;
371
- const stat = await import_node_fs.default.promises.lstat(filePath);
372
- if (stat.isDirectory()) {
373
- await getAllFiles(filePath, fileList);
374
- } else {
375
- fileList.push(filePath);
376
- }
377
- }
378
- return fileList;
379
- }
380
- const allFiles = await getAllFiles(folderPath);
381
- let filteredFiles = allFiles;
382
- if (options?.filePattern) {
383
- try {
384
- const filePattern = new RegExp(options.filePattern);
385
- filteredFiles = allFiles.filter((file) => filePattern.test(file));
386
- } catch {
387
- }
388
- }
389
- if (filteredFiles.length === 0) {
390
- throw new Error("The provided folder is empty.");
391
- }
392
- for (const filePath of filteredFiles) {
393
- const relativePath = import_node_path.default.relative(folderPath, filePath).split(import_node_path.default.sep).join("/");
394
- import_logger.logger.verbose(
395
- `[uploadFolderAndCreate] Start uploading file '${filePath}' as blob '${relativePath}'`
396
- );
397
- const blobClient = containerClient.getBlockBlobClient(relativePath);
398
- const fileStream = import_node_fs.default.createReadStream(filePath);
399
- await blobClient.uploadStream(fileStream);
400
- import_logger.logger.verbose(
401
- `[uploadFolderAndCreate] Done uploading file '${filePath}' as blob '${relativePath}'`
402
- );
403
- }
404
- const datasetVersion = await createOrUpdate(context, name, outputVersion, {
405
- name,
406
- version: outputVersion,
407
- type: "uri_folder",
408
- dataUri: containerClient.url
409
- });
410
- return datasetVersion;
411
- }
412
269
  // Annotate the CommonJS export names for ESM import in node:
413
270
  0 && (module.exports = {
414
271
  $delete,
@@ -431,8 +288,6 @@ async function uploadFolder(context, name, version, folderPath, options) {
431
288
  getCredentials,
432
289
  list,
433
290
  listVersions,
434
- pendingUpload,
435
- uploadFile,
436
- uploadFolder
291
+ pendingUpload
437
292
  });
438
293
  //# sourceMappingURL=operations.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/api/datasets/operations.ts"],
4
- "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport fs from \"node:fs\";\nimport nodePath from \"node:path\";\nimport type { DatasetUploadInternalOptions, AIProjectContext as Client } from \"../index.js\";\nimport type {\n _PagedDatasetVersion,\n DatasetVersionUnion,\n PendingUploadRequest,\n PendingUploadResponse,\n DatasetCredential,\n} from \"../../models/models.js\";\nimport {\n _pagedDatasetVersionDeserializer,\n datasetVersionUnionSerializer,\n datasetVersionUnionDeserializer,\n pendingUploadRequestSerializer,\n pendingUploadResponseDeserializer,\n datasetCredentialDeserializer,\n} from \"../../models/models.js\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { buildPagedAsyncIterator } from \"../../static-helpers/pagingHelpers.js\";\nimport { expandUrlTemplate } from \"../../static-helpers/urlTemplate.js\";\nimport type {\n DatasetsGetCredentialsOptionalParams,\n DatasetsPendingUploadOptionalParams,\n DatasetsCreateOrUpdateOptionalParams,\n DatasetsDeleteOptionalParams,\n DatasetsGetOptionalParams,\n DatasetsListOptionalParams,\n DatasetsListVersionsOptionalParams,\n} from \"./options.js\";\nimport type { StreamableMethod, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { createRestError, operationOptionsToRequestParameters } from \"@azure-rest/core-client\";\nimport { ContainerClient } from \"@azure/storage-blob\";\nimport { logger } from \"../../logger.js\";\nexport function _getCredentialsSend(\n context: Client,\n name: string,\n version: string,\n options: DatasetsGetCredentialsOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets/{name}/versions/{version}/credentials{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getCredentialsDeserialize(\n result: PathUncheckedResponse,\n): Promise<DatasetCredential> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return datasetCredentialDeserializer(result.body);\n}\n\n/** Get the SAS credential to access the storage account associated with a Dataset version. */\nexport async function getCredentials(\n context: Client,\n name: string,\n version: string,\n options: DatasetsGetCredentialsOptionalParams = { requestOptions: {} },\n): Promise<DatasetCredential> {\n const result = await _getCredentialsSend(context, name, version, options);\n return _getCredentialsDeserialize(result);\n}\n\nexport function _pendingUploadSend(\n context: Client,\n name: string,\n version: string,\n pendingUploadRequest: PendingUploadRequest,\n options: DatasetsPendingUploadOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets/{name}/versions/{version}/startPendingUpload{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: pendingUploadRequestSerializer(pendingUploadRequest),\n });\n}\n\nexport async function _pendingUploadDeserialize(\n result: PathUncheckedResponse,\n): Promise<PendingUploadResponse> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return pendingUploadResponseDeserializer(result.body);\n}\n\n/** Start a new or get an existing pending upload of a dataset for a specific version. */\nexport async function pendingUpload(\n context: Client,\n name: string,\n version: string,\n pendingUploadRequest: PendingUploadRequest,\n options: DatasetsPendingUploadOptionalParams = { requestOptions: {} },\n): Promise<PendingUploadResponse> {\n const result = await _pendingUploadSend(context, name, version, pendingUploadRequest, options);\n return _pendingUploadDeserialize(result);\n}\n\nexport function _createOrUpdateSend(\n context: Client,\n name: string,\n version: string,\n datasetVersion: DatasetVersionUnion,\n options: DatasetsCreateOrUpdateOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets/{name}/versions/{version}{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).patch({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/merge-patch+json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: datasetVersionUnionSerializer(datasetVersion),\n });\n}\n\nexport async function _createOrUpdateDeserialize(\n result: PathUncheckedResponse,\n): Promise<DatasetVersionUnion> {\n const expectedStatuses = [\"201\", \"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return datasetVersionUnionDeserializer(result.body);\n}\n\n/** Create a new or update an existing DatasetVersion with the given version id */\nexport async function createOrUpdate(\n context: Client,\n name: string,\n version: string,\n datasetVersion: DatasetVersionUnion,\n options: DatasetsCreateOrUpdateOptionalParams = { requestOptions: {} },\n): Promise<DatasetVersionUnion> {\n const result = await _createOrUpdateSend(context, name, version, datasetVersion, options);\n return _createOrUpdateDeserialize(result);\n}\n\nexport function _$deleteSend(\n context: Client,\n name: string,\n version: string,\n options: DatasetsDeleteOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets/{name}/versions/{version}{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).delete({ ...operationOptionsToRequestParameters(options) });\n}\n\nexport async function _$deleteDeserialize(result: PathUncheckedResponse): Promise<void> {\n const expectedStatuses = [\"204\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return;\n}\n\n/** Delete the specific version of the DatasetVersion. The service returns 204 No Content if the DatasetVersion was deleted successfully or if the DatasetVersion does not exist. */\nexport async function $delete(\n context: Client,\n name: string,\n version: string,\n options: DatasetsDeleteOptionalParams = { requestOptions: {} },\n): Promise<void> {\n const result = await _$deleteSend(context, name, version, options);\n return _$deleteDeserialize(result);\n}\n\nexport function _getSend(\n context: Client,\n name: string,\n version: string,\n options: DatasetsGetOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets/{name}/versions/{version}{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getDeserialize(result: PathUncheckedResponse): Promise<DatasetVersionUnion> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return datasetVersionUnionDeserializer(result.body);\n}\n\n/** Get the specific version of the DatasetVersion. The service returns 404 Not Found error if the DatasetVersion does not exist. */\nexport async function get(\n context: Client,\n name: string,\n version: string,\n options: DatasetsGetOptionalParams = { requestOptions: {} },\n): Promise<DatasetVersionUnion> {\n const result = await _getSend(context, name, version, options);\n return _getDeserialize(result);\n}\n\nexport function _listSend(\n context: Client,\n options: DatasetsListOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets{?api-version}\",\n {\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listDeserialize(\n result: PathUncheckedResponse,\n): Promise<_PagedDatasetVersion> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _pagedDatasetVersionDeserializer(result.body);\n}\n\n/** List the latest version of each DatasetVersion */\nexport function list(\n context: Client,\n options: DatasetsListOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<DatasetVersionUnion> {\n return buildPagedAsyncIterator(\n context,\n () => _listSend(context, options),\n _listDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\", apiVersion: context.apiVersion },\n );\n}\n\nexport function _listVersionsSend(\n context: Client,\n name: string,\n options: DatasetsListVersionsOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets/{name}/versions{?api-version}\",\n {\n name: name,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listVersionsDeserialize(\n result: PathUncheckedResponse,\n): Promise<_PagedDatasetVersion> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _pagedDatasetVersionDeserializer(result.body);\n}\n\n/** List all versions of the given DatasetVersion */\nexport function listVersions(\n context: Client,\n name: string,\n options: DatasetsListVersionsOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<DatasetVersionUnion> {\n return buildPagedAsyncIterator(\n context,\n () => _listVersionsSend(context, name, options),\n _listVersionsDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\", apiVersion: context.apiVersion },\n );\n}\n\n// Internal helper method to create a new dataset and return a ContainerClient from azure-storage-blob package, to the dataset's blob storage.\nasync function createDatasetAndGetItsContainer(\n context: Client,\n name: string,\n version: string,\n options?: DatasetUploadInternalOptions,\n): Promise<{ containerClient: ContainerClient; version: string }> {\n const { connectionName, projectOptions = {} } = options || {};\n // Start a pending upload to get the container URL with SAS token\n const pendingUploadResponse = await pendingUpload(context, name, version, {\n pendingUploadType: \"BlobReference\",\n connectionName,\n } as PendingUploadRequest);\n\n const blobReference = pendingUploadResponse.blobReference;\n // Validate the response\n if (!blobReference) {\n throw new Error(\"Blob reference for consumption is not present\");\n }\n\n if (!blobReference.credential?.type) {\n throw new Error(\"Credential type is not present\");\n }\n\n if (blobReference.credential.type !== \"SAS\") {\n throw new Error(\"Credential type is not SAS\");\n }\n\n if (!blobReference.blobUri) {\n throw new Error(\"Blob URI is not present or empty\");\n }\n\n // Log metadata only; upload URLs can contain credentials.\n logger.verbose(\n `[createDatasetAndGetItsContainer] pendingUploadResponse.pendingUploadId = ${pendingUploadResponse.pendingUploadId}`,\n );\n logger.verbose(\n `[createDatasetAndGetItsContainer] pendingUploadResponse.pendingUploadType = ${pendingUploadResponse.pendingUploadType}`,\n );\n logger.verbose(\n `[createDatasetAndGetItsContainer] blobReference.storageAccountArmId = ${blobReference.storageAccountArmId}`,\n );\n logger.verbose(\n `[createDatasetAndGetItsContainer] blobReference.credential.type = ${blobReference.credential.type}`,\n );\n\n // Create container client from the blob URI (which includes the SAS token)\n const containerClient = new ContainerClient(blobReference.credential.sasUri);\n\n const pipeline = containerClient[\"storageClientContext\"].pipeline;\n for (const { policy } of projectOptions.additionalPolicies ?? []) {\n pipeline.addPolicy(policy, { afterPhase: \"Sign\" });\n }\n\n return {\n containerClient,\n version,\n };\n}\n\nexport async function uploadFile(\n context: Client,\n name: string,\n version: string,\n filePath: string,\n options?: DatasetUploadInternalOptions,\n): Promise<DatasetVersionUnion> {\n // if file does not exist\n\n const fileExists = fs.existsSync(filePath);\n if (!fileExists) {\n throw new Error(`File does not exist at path: ${filePath}`);\n }\n // Check if the file is a directory\n const isDirectory = fs.lstatSync(filePath).isDirectory();\n if (isDirectory) {\n throw new Error(`The provided file is actually a folder. Use method uploadFolder instead`);\n }\n\n const { containerClient, version: outputVersion } = await createDatasetAndGetItsContainer(\n context,\n name,\n version,\n options,\n );\n // file name as blob name\n const blobName = nodePath.basename(filePath);\n const blockBlobClient = containerClient.getBlockBlobClient(blobName);\n await blockBlobClient.uploadStream(fs.createReadStream(filePath));\n\n const datasetVersion = await createOrUpdate(context, name, outputVersion, {\n name: name,\n version: outputVersion,\n type: \"uri_file\",\n dataUri: blockBlobClient.url,\n });\n return datasetVersion;\n}\n\nexport async function uploadFolder(\n context: Client,\n name: string,\n version: string,\n folderPath: string,\n options?: DatasetUploadInternalOptions,\n): Promise<DatasetVersionUnion> {\n // Check if the folder exists\n const folderExists = fs.existsSync(folderPath);\n if (!folderExists) {\n throw new Error(`Folder does not exist at path: ${folderPath}`);\n }\n // Check if the folder is a file\n const isFile = fs.lstatSync(folderPath).isFile();\n if (isFile) {\n throw new Error(`The provided path is actually a file. Use method uploadFile instead`);\n }\n\n const { containerClient, version: outputVersion } = await createDatasetAndGetItsContainer(\n context,\n name,\n version,\n options,\n );\n\n // Helper function to recursively get all files in a directory\n async function getAllFiles(dir: string, fileList: string[] = []): Promise<string[]> {\n const files = await fs.promises.readdir(dir);\n\n for (const file of files) {\n const filePath = `${dir}/${file}`;\n const stat = await fs.promises.lstat(filePath);\n\n if (stat.isDirectory()) {\n await getAllFiles(filePath, fileList);\n } else {\n fileList.push(filePath);\n }\n }\n\n return fileList;\n }\n\n // Get all files in the folder\n const allFiles = await getAllFiles(folderPath);\n let filteredFiles = allFiles;\n if (options?.filePattern) {\n try {\n const filePattern = new RegExp(options.filePattern);\n filteredFiles = allFiles.filter((file) => filePattern.test(file));\n } catch {\n // If regex pattern is invalid, ignore the pattern and upload all files\n }\n }\n\n if (filteredFiles.length === 0) {\n throw new Error(\"The provided folder is empty.\");\n }\n\n // Upload each file to blob storage while maintaining relative paths\n for (const filePath of filteredFiles) {\n // Create blob name as relative path from the base folder\n const relativePath = nodePath.relative(folderPath, filePath).split(nodePath.sep).join(\"/\");\n\n logger.verbose(\n `[uploadFolderAndCreate] Start uploading file '${filePath}' as blob '${relativePath}'`,\n );\n\n // Get a block blob client for the relative path\n const blobClient = containerClient.getBlockBlobClient(relativePath);\n\n // Upload the file using a readable stream for better performance\n const fileStream = fs.createReadStream(filePath);\n await blobClient.uploadStream(fileStream);\n logger.verbose(\n `[uploadFolderAndCreate] Done uploading file '${filePath}' as blob '${relativePath}'`,\n );\n }\n\n // Create dataset version that references this folder\n const datasetVersion = await createOrUpdate(context, name, outputVersion, {\n name: name,\n version: outputVersion,\n type: \"uri_folder\",\n dataUri: containerClient.url,\n });\n\n return datasetVersion;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAe;AACf,uBAAqB;AASrB,oBAOO;AAEP,2BAAwC;AACxC,yBAAkC;AAWlC,yBAAqE;AACrE,0BAAgC;AAChC,oBAAuB;AAChB,SAAS,oBACd,SACA,MACA,SACA,UAAgD,EAAE,gBAAgB,CAAC,EAAE,GACnD;AAClB,QAAM,WAAO;AAAA,IACX;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA,eAAe,QAAQ;AAAA,IACzB;AAAA,IACA;AAAA,MACE,eAAe,SAAS,gBAAgB;AAAA,IAC1C;AAAA,EACF;AACA,SAAO,QAAQ,KAAK,IAAI,EAAE,KAAK;AAAA,IAC7B,OAAG,wDAAoC,OAAO;AAAA,IAC9C,SAAS;AAAA,MACP,QAAQ;AAAA,MACR,GAAG,QAAQ,gBAAgB;AAAA,IAC7B;AAAA,EACF,CAAC;AACH;AAEA,eAAsB,2BACpB,QAC4B;AAC5B,QAAM,mBAAmB,CAAC,KAAK;AAC/B,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M,eAAAA,QAAG,SAAS,MAAM,QAAQ;AAE7C,UAAI,KAAK,YAAY,GAAG;AACtB,cAAM,YAAY,UAAU,QAAQ;AAAA,MACtC,OAAO;AACL,iBAAS,KAAK,QAAQ;AAAA,MACxB;AAAA,IACF;AAEA,WAAO;AAAA,EACT;AAGA,QAAM,WAAW,MAAM,YAAY,UAAU;AAC7C,MAAI,gBAAgB;AACpB,MAAI,SAAS,aAAa;AACxB,QAAI;AACF,YAAM,cAAc,IAAI,OAAO,QAAQ,WAAW;AAClD,sBAAgB,SAAS,OAAO,CAAC,SAAS,YAAY,KAAK,IAAI,CAAC;AAAA,IAClE,QAAQ;AAAA,IAER;AAAA,EACF;AAEA,MAAI,cAAc,WAAW,GAAG;AAC9B,UAAM,IAAI,MAAM,+BAA+B;AAAA,EACjD;AAGA,aAAW,YAAY,eAAe;AAEpC,UAAM,eAAe,iBAAAC,QAAS,SAAS,YAAY,QAAQ,EAAE,MAAM,iBAAAA,QAAS,GAAG,EAAE,KAAK,GAAG;AAEzF,yBAAO;AAAA,MACL,iDAAiD,QAAQ,cAAc,YAAY;AAAA,IACrF;AAGA,UAAM,aAAa,gBAAgB,mBAAmB,YAAY;AAGlE,UAAM,aAAa,eAAAD,QAAG,iBAAiB,QAAQ;AAC/C,UAAM,WAAW,aAAa,UAAU;AACxC,yBAAO;AAAA,MACL,gDAAgD,QAAQ,cAAc,YAAY;AAAA,IACpF;AAAA,EACF;AAGA,QAAM,iBAAiB,MAAM,eAAe,SAAS,MAAM,eAAe;AAAA,IACxE;AAAA,IACA,SAAS;AAAA,IACT,MAAM;AAAA,IACN,SAAS,gBAAgB;AAAA,EAC3B,CAAC;AAED,SAAO;AACT;",
6
- "names": ["fs", "nodePath"]
4
+ "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AIProjectContext as Client } from \"../index.js\";\nimport type {\n _PagedDatasetVersion,\n DatasetVersionUnion,\n PendingUploadRequest,\n PendingUploadResponse,\n DatasetCredential,\n} from \"../../models/models.js\";\nimport {\n _pagedDatasetVersionDeserializer,\n datasetVersionUnionSerializer,\n datasetVersionUnionDeserializer,\n pendingUploadRequestSerializer,\n pendingUploadResponseDeserializer,\n datasetCredentialDeserializer,\n} from \"../../models/models.js\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { buildPagedAsyncIterator } from \"../../static-helpers/pagingHelpers.js\";\nimport { expandUrlTemplate } from \"../../static-helpers/urlTemplate.js\";\nimport type {\n DatasetsGetCredentialsOptionalParams,\n DatasetsPendingUploadOptionalParams,\n DatasetsCreateOrUpdateOptionalParams,\n DatasetsDeleteOptionalParams,\n DatasetsGetOptionalParams,\n DatasetsListOptionalParams,\n DatasetsListVersionsOptionalParams,\n} from \"./options.js\";\nimport type { StreamableMethod, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { createRestError, operationOptionsToRequestParameters } from \"@azure-rest/core-client\";\nexport function _getCredentialsSend(\n context: Client,\n name: string,\n version: string,\n options: DatasetsGetCredentialsOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets/{name}/versions/{version}/credentials{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getCredentialsDeserialize(\n result: PathUncheckedResponse,\n): Promise<DatasetCredential> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return datasetCredentialDeserializer(result.body);\n}\n\n/** Get the SAS credential to access the storage account associated with a Dataset version. */\nexport async function getCredentials(\n context: Client,\n name: string,\n version: string,\n options: DatasetsGetCredentialsOptionalParams = { requestOptions: {} },\n): Promise<DatasetCredential> {\n const result = await _getCredentialsSend(context, name, version, options);\n return _getCredentialsDeserialize(result);\n}\n\nexport function _pendingUploadSend(\n context: Client,\n name: string,\n version: string,\n pendingUploadRequest: PendingUploadRequest,\n options: DatasetsPendingUploadOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets/{name}/versions/{version}/startPendingUpload{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: pendingUploadRequestSerializer(pendingUploadRequest),\n });\n}\n\nexport async function _pendingUploadDeserialize(\n result: PathUncheckedResponse,\n): Promise<PendingUploadResponse> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return pendingUploadResponseDeserializer(result.body);\n}\n\n/** Start a new or get an existing pending upload of a dataset for a specific version. */\nexport async function pendingUpload(\n context: Client,\n name: string,\n version: string,\n pendingUploadRequest: PendingUploadRequest,\n options: DatasetsPendingUploadOptionalParams = { requestOptions: {} },\n): Promise<PendingUploadResponse> {\n const result = await _pendingUploadSend(context, name, version, pendingUploadRequest, options);\n return _pendingUploadDeserialize(result);\n}\n\nexport function _createOrUpdateSend(\n context: Client,\n name: string,\n version: string,\n datasetVersion: DatasetVersionUnion,\n options: DatasetsCreateOrUpdateOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets/{name}/versions/{version}{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).patch({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/merge-patch+json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: datasetVersionUnionSerializer(datasetVersion),\n });\n}\n\nexport async function _createOrUpdateDeserialize(\n result: PathUncheckedResponse,\n): Promise<DatasetVersionUnion> {\n const expectedStatuses = [\"201\", \"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return datasetVersionUnionDeserializer(result.body);\n}\n\n/** Create a new or update an existing DatasetVersion with the given version id */\nexport async function createOrUpdate(\n context: Client,\n name: string,\n version: string,\n datasetVersion: DatasetVersionUnion,\n options: DatasetsCreateOrUpdateOptionalParams = { requestOptions: {} },\n): Promise<DatasetVersionUnion> {\n const result = await _createOrUpdateSend(context, name, version, datasetVersion, options);\n return _createOrUpdateDeserialize(result);\n}\n\nexport function _$deleteSend(\n context: Client,\n name: string,\n version: string,\n options: DatasetsDeleteOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets/{name}/versions/{version}{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).delete({ ...operationOptionsToRequestParameters(options) });\n}\n\nexport async function _$deleteDeserialize(result: PathUncheckedResponse): Promise<void> {\n const expectedStatuses = [\"204\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return;\n}\n\n/** Delete the specific version of the DatasetVersion. The service returns 204 No Content if the DatasetVersion was deleted successfully or if the DatasetVersion does not exist. */\nexport async function $delete(\n context: Client,\n name: string,\n version: string,\n options: DatasetsDeleteOptionalParams = { requestOptions: {} },\n): Promise<void> {\n const result = await _$deleteSend(context, name, version, options);\n return _$deleteDeserialize(result);\n}\n\nexport function _getSend(\n context: Client,\n name: string,\n version: string,\n options: DatasetsGetOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets/{name}/versions/{version}{?api-version}\",\n {\n name: name,\n version: version,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getDeserialize(result: PathUncheckedResponse): Promise<DatasetVersionUnion> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return datasetVersionUnionDeserializer(result.body);\n}\n\n/** Get the specific version of the DatasetVersion. The service returns 404 Not Found error if the DatasetVersion does not exist. */\nexport async function get(\n context: Client,\n name: string,\n version: string,\n options: DatasetsGetOptionalParams = { requestOptions: {} },\n): Promise<DatasetVersionUnion> {\n const result = await _getSend(context, name, version, options);\n return _getDeserialize(result);\n}\n\nexport function _listSend(\n context: Client,\n options: DatasetsListOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets{?api-version}\",\n {\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listDeserialize(\n result: PathUncheckedResponse,\n): Promise<_PagedDatasetVersion> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _pagedDatasetVersionDeserializer(result.body);\n}\n\n/** List the latest version of each DatasetVersion */\nexport function list(\n context: Client,\n options: DatasetsListOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<DatasetVersionUnion> {\n return buildPagedAsyncIterator(\n context,\n () => _listSend(context, options),\n _listDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\", apiVersion: context.apiVersion },\n );\n}\n\nexport function _listVersionsSend(\n context: Client,\n name: string,\n options: DatasetsListVersionsOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/datasets/{name}/versions{?api-version}\",\n {\n name: name,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listVersionsDeserialize(\n result: PathUncheckedResponse,\n): Promise<_PagedDatasetVersion> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _pagedDatasetVersionDeserializer(result.body);\n}\n\n/** List all versions of the given DatasetVersion */\nexport function listVersions(\n context: Client,\n name: string,\n options: DatasetsListVersionsOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<DatasetVersionUnion> {\n return buildPagedAsyncIterator(\n context,\n () => _listVersionsSend(context, name, options),\n _listVersionsDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\", apiVersion: context.apiVersion },\n );\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,oBAOO;AAEP,2BAAwC;AACxC,yBAAkC;AAWlC,yBAAqE;AAC9D,SAAS,oBACd,SACA,MACA,SACA,UAAgD,EAAE,gBAAgB,CAAC,EAAE,GACnD;AAClB,QAAM,WAAO;AAAA,IACX;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA,eAAe,QAAQ;AAAA,IACzB;AAAA,IACA;AAAA,MACE,eAAe,SAAS,gBAAgB;AAAA,IAC1C;AAAA,EACF;AACA,SAAO,QAAQ,KAAK,IAAI,EAAE,KAAK;AAAA,IAC7B,OAAG,wDAAoC,OAAO;AAAA,IAC9C,SAAS;AAAA,MACP,QAAQ;AAAA,MACR,GAAG,QAAQ,gBAAgB;AAAA,IAC7B;AAAA,EACF,CAAC;AACH;AAEA,eAAsB,2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AO;AAAA,IACL;AAAA,IACA,MAAM,kBAAkB,SAAS,MAAM,OAAO;AAAA,IAC9C;AAAA,IACA,CAAC,KAAK;AAAA,IACN,EAAE,UAAU,SAAS,cAAc,YAAY,YAAY,QAAQ,WAAW;AAAA,EAChF;AACF;",
6
+ "names": []
7
7
  }
@@ -0,0 +1,5 @@
1
+ import type { DatasetUploadInternalOptions, AIProjectContext as Client } from "../index.js";
2
+ import type { DatasetVersionUnion } from "../../models/models.js";
3
+ export declare function uploadFile(context: Client, name: string, version: string, filePath: string, options?: DatasetUploadInternalOptions): Promise<DatasetVersionUnion>;
4
+ export declare function uploadFolder(context: Client, name: string, version: string, folderPath: string, options?: DatasetUploadInternalOptions): Promise<DatasetVersionUnion>;
5
+ //# sourceMappingURL=uploads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uploads.d.ts","sourceRoot":"","sources":["../../../../src/api/datasets/uploads.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,4BAA4B,EAAE,gBAAgB,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAC5F,OAAO,KAAK,EAAE,mBAAmB,EAAwB,MAAM,wBAAwB,CAAC;AAgExF,wBAAsB,UAAU,CAC9B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,4BAA4B,GACrC,OAAO,CAAC,mBAAmB,CAAC,CA+B9B;AAED,wBAAsB,YAAY,CAChC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,4BAA4B,GACrC,OAAO,CAAC,mBAAmB,CAAC,CAkF9B"}
@@ -0,0 +1,171 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var uploads_exports = {};
29
+ __export(uploads_exports, {
30
+ uploadFile: () => uploadFile,
31
+ uploadFolder: () => uploadFolder
32
+ });
33
+ module.exports = __toCommonJS(uploads_exports);
34
+ var import_node_fs = __toESM(require("node:fs"));
35
+ var import_node_path = __toESM(require("node:path"));
36
+ var import_storage_blob = require("@azure/storage-blob");
37
+ var import_logger = require("../../logger.js");
38
+ var import_operations = require("./operations.js");
39
+ async function createDatasetAndGetItsContainer(context, name, version, options) {
40
+ const { connectionName, projectOptions = {} } = options || {};
41
+ const pendingUploadResponse = await (0, import_operations.pendingUpload)(context, name, version, {
42
+ pendingUploadType: "BlobReference",
43
+ connectionName
44
+ });
45
+ const blobReference = pendingUploadResponse.blobReference;
46
+ if (!blobReference) {
47
+ throw new Error("Blob reference for consumption is not present");
48
+ }
49
+ if (!blobReference.credential?.type) {
50
+ throw new Error("Credential type is not present");
51
+ }
52
+ if (blobReference.credential.type !== "SAS") {
53
+ throw new Error("Credential type is not SAS");
54
+ }
55
+ if (!blobReference.blobUri) {
56
+ throw new Error("Blob URI is not present or empty");
57
+ }
58
+ import_logger.logger.verbose(
59
+ `[createDatasetAndGetItsContainer] pendingUploadResponse.pendingUploadId = ${pendingUploadResponse.pendingUploadId}`
60
+ );
61
+ import_logger.logger.verbose(
62
+ `[createDatasetAndGetItsContainer] pendingUploadResponse.pendingUploadType = ${pendingUploadResponse.pendingUploadType}`
63
+ );
64
+ import_logger.logger.verbose(
65
+ `[createDatasetAndGetItsContainer] blobReference.storageAccountArmId = ${blobReference.storageAccountArmId}`
66
+ );
67
+ import_logger.logger.verbose(
68
+ `[createDatasetAndGetItsContainer] blobReference.credential.type = ${blobReference.credential.type}`
69
+ );
70
+ const containerClient = new import_storage_blob.ContainerClient(blobReference.credential.sasUri);
71
+ const pipeline = containerClient["storageClientContext"].pipeline;
72
+ for (const { policy } of projectOptions.additionalPolicies ?? []) {
73
+ pipeline.addPolicy(policy, { afterPhase: "Sign" });
74
+ }
75
+ return {
76
+ containerClient,
77
+ version
78
+ };
79
+ }
80
+ async function uploadFile(context, name, version, filePath, options) {
81
+ const fileExists = import_node_fs.default.existsSync(filePath);
82
+ if (!fileExists) {
83
+ throw new Error(`File does not exist at path: ${filePath}`);
84
+ }
85
+ const isDirectory = import_node_fs.default.lstatSync(filePath).isDirectory();
86
+ if (isDirectory) {
87
+ throw new Error(`The provided file is actually a folder. Use method uploadFolder instead`);
88
+ }
89
+ const { containerClient, version: outputVersion } = await createDatasetAndGetItsContainer(
90
+ context,
91
+ name,
92
+ version,
93
+ options
94
+ );
95
+ const blobName = import_node_path.default.basename(filePath);
96
+ const blockBlobClient = containerClient.getBlockBlobClient(blobName);
97
+ await blockBlobClient.uploadStream(import_node_fs.default.createReadStream(filePath));
98
+ const datasetVersion = await (0, import_operations.createOrUpdate)(context, name, outputVersion, {
99
+ name,
100
+ version: outputVersion,
101
+ type: "uri_file",
102
+ dataUri: blockBlobClient.url
103
+ });
104
+ return datasetVersion;
105
+ }
106
+ async function uploadFolder(context, name, version, folderPath, options) {
107
+ const folderExists = import_node_fs.default.existsSync(folderPath);
108
+ if (!folderExists) {
109
+ throw new Error(`Folder does not exist at path: ${folderPath}`);
110
+ }
111
+ const isFile = import_node_fs.default.lstatSync(folderPath).isFile();
112
+ if (isFile) {
113
+ throw new Error(`The provided path is actually a file. Use method uploadFile instead`);
114
+ }
115
+ const { containerClient, version: outputVersion } = await createDatasetAndGetItsContainer(
116
+ context,
117
+ name,
118
+ version,
119
+ options
120
+ );
121
+ async function getAllFiles(dir, fileList = []) {
122
+ const files = await import_node_fs.default.promises.readdir(dir);
123
+ for (const file of files) {
124
+ const filePath = `${dir}/${file}`;
125
+ const stat = await import_node_fs.default.promises.lstat(filePath);
126
+ if (stat.isDirectory()) {
127
+ await getAllFiles(filePath, fileList);
128
+ } else {
129
+ fileList.push(filePath);
130
+ }
131
+ }
132
+ return fileList;
133
+ }
134
+ const allFiles = await getAllFiles(folderPath);
135
+ let filteredFiles = allFiles;
136
+ if (options?.filePattern) {
137
+ try {
138
+ const filePattern = new RegExp(options.filePattern);
139
+ filteredFiles = allFiles.filter((file) => filePattern.test(file));
140
+ } catch {
141
+ }
142
+ }
143
+ if (filteredFiles.length === 0) {
144
+ throw new Error("The provided folder is empty.");
145
+ }
146
+ for (const filePath of filteredFiles) {
147
+ const relativePath = import_node_path.default.relative(folderPath, filePath).split(import_node_path.default.sep).join("/");
148
+ import_logger.logger.verbose(
149
+ `[uploadFolderAndCreate] Start uploading file '${filePath}' as blob '${relativePath}'`
150
+ );
151
+ const blobClient = containerClient.getBlockBlobClient(relativePath);
152
+ const fileStream = import_node_fs.default.createReadStream(filePath);
153
+ await blobClient.uploadStream(fileStream);
154
+ import_logger.logger.verbose(
155
+ `[uploadFolderAndCreate] Done uploading file '${filePath}' as blob '${relativePath}'`
156
+ );
157
+ }
158
+ const datasetVersion = await (0, import_operations.createOrUpdate)(context, name, outputVersion, {
159
+ name,
160
+ version: outputVersion,
161
+ type: "uri_folder",
162
+ dataUri: containerClient.url
163
+ });
164
+ return datasetVersion;
165
+ }
166
+ // Annotate the CommonJS export names for ESM import in node:
167
+ 0 && (module.exports = {
168
+ uploadFile,
169
+ uploadFolder
170
+ });
171
+ //# sourceMappingURL=uploads.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/api/datasets/uploads.ts"],
4
+ "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport fs from \"node:fs\";\nimport nodePath from \"node:path\";\nimport { ContainerClient } from \"@azure/storage-blob\";\nimport type { DatasetUploadInternalOptions, AIProjectContext as Client } from \"../index.js\";\nimport type { DatasetVersionUnion, PendingUploadRequest } from \"../../models/models.js\";\nimport { logger } from \"../../logger.js\";\nimport { createOrUpdate, pendingUpload } from \"./operations.js\";\n\n// Internal helper method to create a new dataset and return a ContainerClient from azure-storage-blob package, to the dataset's blob storage.\nasync function createDatasetAndGetItsContainer(\n context: Client,\n name: string,\n version: string,\n options?: DatasetUploadInternalOptions,\n): Promise<{ containerClient: ContainerClient; version: string }> {\n const { connectionName, projectOptions = {} } = options || {};\n // Start a pending upload to get the container URL with SAS token\n const pendingUploadResponse = await pendingUpload(context, name, version, {\n pendingUploadType: \"BlobReference\",\n connectionName,\n } as PendingUploadRequest);\n\n const blobReference = pendingUploadResponse.blobReference;\n // Validate the response\n if (!blobReference) {\n throw new Error(\"Blob reference for consumption is not present\");\n }\n\n if (!blobReference.credential?.type) {\n throw new Error(\"Credential type is not present\");\n }\n\n if (blobReference.credential.type !== \"SAS\") {\n throw new Error(\"Credential type is not SAS\");\n }\n\n if (!blobReference.blobUri) {\n throw new Error(\"Blob URI is not present or empty\");\n }\n\n // Log metadata only; upload URLs can contain credentials.\n logger.verbose(\n `[createDatasetAndGetItsContainer] pendingUploadResponse.pendingUploadId = ${pendingUploadResponse.pendingUploadId}`,\n );\n logger.verbose(\n `[createDatasetAndGetItsContainer] pendingUploadResponse.pendingUploadType = ${pendingUploadResponse.pendingUploadType}`,\n );\n logger.verbose(\n `[createDatasetAndGetItsContainer] blobReference.storageAccountArmId = ${blobReference.storageAccountArmId}`,\n );\n logger.verbose(\n `[createDatasetAndGetItsContainer] blobReference.credential.type = ${blobReference.credential.type}`,\n );\n\n // Create container client from the blob URI (which includes the SAS token)\n const containerClient = new ContainerClient(blobReference.credential.sasUri);\n\n const pipeline = containerClient[\"storageClientContext\"].pipeline;\n for (const { policy } of projectOptions.additionalPolicies ?? []) {\n pipeline.addPolicy(policy, { afterPhase: \"Sign\" });\n }\n\n return {\n containerClient,\n version,\n };\n}\n\nexport async function uploadFile(\n context: Client,\n name: string,\n version: string,\n filePath: string,\n options?: DatasetUploadInternalOptions,\n): Promise<DatasetVersionUnion> {\n // if file does not exist\n\n const fileExists = fs.existsSync(filePath);\n if (!fileExists) {\n throw new Error(`File does not exist at path: ${filePath}`);\n }\n // Check if the file is a directory\n const isDirectory = fs.lstatSync(filePath).isDirectory();\n if (isDirectory) {\n throw new Error(`The provided file is actually a folder. Use method uploadFolder instead`);\n }\n\n const { containerClient, version: outputVersion } = await createDatasetAndGetItsContainer(\n context,\n name,\n version,\n options,\n );\n // file name as blob name\n const blobName = nodePath.basename(filePath);\n const blockBlobClient = containerClient.getBlockBlobClient(blobName);\n await blockBlobClient.uploadStream(fs.createReadStream(filePath));\n\n const datasetVersion = await createOrUpdate(context, name, outputVersion, {\n name: name,\n version: outputVersion,\n type: \"uri_file\",\n dataUri: blockBlobClient.url,\n });\n return datasetVersion;\n}\n\nexport async function uploadFolder(\n context: Client,\n name: string,\n version: string,\n folderPath: string,\n options?: DatasetUploadInternalOptions,\n): Promise<DatasetVersionUnion> {\n // Check if the folder exists\n const folderExists = fs.existsSync(folderPath);\n if (!folderExists) {\n throw new Error(`Folder does not exist at path: ${folderPath}`);\n }\n // Check if the folder is a file\n const isFile = fs.lstatSync(folderPath).isFile();\n if (isFile) {\n throw new Error(`The provided path is actually a file. Use method uploadFile instead`);\n }\n\n const { containerClient, version: outputVersion } = await createDatasetAndGetItsContainer(\n context,\n name,\n version,\n options,\n );\n\n // Helper function to recursively get all files in a directory\n async function getAllFiles(dir: string, fileList: string[] = []): Promise<string[]> {\n const files = await fs.promises.readdir(dir);\n\n for (const file of files) {\n const filePath = `${dir}/${file}`;\n const stat = await fs.promises.lstat(filePath);\n\n if (stat.isDirectory()) {\n await getAllFiles(filePath, fileList);\n } else {\n fileList.push(filePath);\n }\n }\n\n return fileList;\n }\n\n // Get all files in the folder\n const allFiles = await getAllFiles(folderPath);\n let filteredFiles = allFiles;\n if (options?.filePattern) {\n try {\n const filePattern = new RegExp(options.filePattern);\n filteredFiles = allFiles.filter((file) => filePattern.test(file));\n } catch {\n // If regex pattern is invalid, ignore the pattern and upload all files\n }\n }\n\n if (filteredFiles.length === 0) {\n throw new Error(\"The provided folder is empty.\");\n }\n\n // Upload each file to blob storage while maintaining relative paths\n for (const filePath of filteredFiles) {\n // Create blob name as relative path from the base folder\n const relativePath = nodePath.relative(folderPath, filePath).split(nodePath.sep).join(\"/\");\n\n logger.verbose(\n `[uploadFolderAndCreate] Start uploading file '${filePath}' as blob '${relativePath}'`,\n );\n\n // Get a block blob client for the relative path\n const blobClient = containerClient.getBlockBlobClient(relativePath);\n\n // Upload the file using a readable stream for better performance\n const fileStream = fs.createReadStream(filePath);\n await blobClient.uploadStream(fileStream);\n logger.verbose(\n `[uploadFolderAndCreate] Done uploading file '${filePath}' as blob '${relativePath}'`,\n );\n }\n\n // Create dataset version that references this folder\n const datasetVersion = await createOrUpdate(context, name, outputVersion, {\n name: name,\n version: outputVersion,\n type: \"uri_folder\",\n dataUri: containerClient.url,\n });\n\n return datasetVersion;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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AI,KAAK,YAAY,GAAG;AACtB,cAAM,YAAY,UAAU,QAAQ;AAAA,MACtC,OAAO;AACL,iBAAS,KAAK,QAAQ;AAAA,MACxB;AAAA,IACF;AAEA,WAAO;AAAA,EACT;AAGA,QAAM,WAAW,MAAM,YAAY,UAAU;AAC7C,MAAI,gBAAgB;AACpB,MAAI,SAAS,aAAa;AACxB,QAAI;AACF,YAAM,cAAc,IAAI,OAAO,QAAQ,WAAW;AAClD,sBAAgB,SAAS,OAAO,CAAC,SAAS,YAAY,KAAK,IAAI,CAAC;AAAA,IAClE,QAAQ;AAAA,IAER;AAAA,EACF;AAEA,MAAI,cAAc,WAAW,GAAG;AAC9B,UAAM,IAAI,MAAM,+BAA+B;AAAA,EACjD;AAGA,aAAW,YAAY,eAAe;AAEpC,UAAM,eAAe,iBAAAC,QAAS,SAAS,YAAY,QAAQ,EAAE,MAAM,iBAAAA,QAAS,GAAG,EAAE,KAAK,GAAG;AAEzF,yBAAO;AAAA,MACL,iDAAiD,QAAQ,cAAc,YAAY;AAAA,IACrF;AAGA,UAAM,aAAa,gBAAgB,mBAAmB,YAAY;AAGlE,UAAM,aAAa,eAAAD,QAAG,iBAAiB,QAAQ;AAC/C,UAAM,WAAW,aAAa,UAAU;AACxC,yBAAO;AAAA,MACL,gDAAgD,QAAQ,cAAc,YAAY;AAAA,IACpF;AAAA,EACF;AAGA,QAAM,iBAAiB,UAAM,kCAAe,SAAS,MAAM,eAAe;AAAA,IACxE;AAAA,IACA,SAAS;AAAA,IACT,MAAM;AAAA,IACN,SAAS,gBAAgB;AAAA,EAC3B,CAAC;AAED,SAAO;AACT;",
6
+ "names": ["fs", "nodePath"]
7
+ }
@@ -10,7 +10,7 @@ export interface BetaModelsOperations {
10
10
  getCredentials: (name: string, version: string, credentialRequest: ModelCredentialRequest, options?: BetaModelsGetCredentialsOptionalParams) => Promise<DatasetCredential>;
11
11
  /** Initiates a new pending upload or retrieves an existing one for the specified model version. */
12
12
  pendingUpload: (name: string, version: string, pendingUploadRequest: ModelPendingUploadRequest, options?: BetaModelsPendingUploadOptionalParams) => Promise<ModelPendingUploadResponse>;
13
- /** Upload local model files and register a model version. Wraps pendingUpload, file upload, async creation, and polling into a single call. */
13
+ /** Upload local model files and register a model version. Only supported in Node.js. Wraps pendingUpload, file upload, async creation, and polling into a single call. */
14
14
  create: (name: string, version: string, source: string, options?: BetaModelsCreateFromSourceOptions) => Promise<ModelVersion>;
15
15
  /** Update an existing ModelVersion with the given version id */
16
16
  update: (name: string, modelVersionUpdate: UpdateModelVersionRequest, version: string, options?: BetaModelsUpdateOptionalParams) => Promise<ModelVersion>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/classic/beta/models/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAWzE,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AAC7F,OAAO,KAAK,EACV,sCAAsC,EACtC,qCAAqC,EACrC,8BAA8B,EAC9B,8BAA8B,EAC9B,2BAA2B,EAC3B,4BAA4B,EAC5B,oCAAoC,EACrC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAErE,YAAY,EAAE,iCAAiC,IAAI,uBAAuB,EAAE,CAAC;AAE7E,sDAAsD;AACtD,MAAM,WAAW,oBAAoB;IACnC,qGAAqG;IACrG,cAAc,EAAE,CACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,sBAAsB,EACzC,OAAO,CAAC,EAAE,sCAAsC,KAC7C,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAChC,mGAAmG;IACnG,a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3B,sKAAsK;IACtK,MAAM,EAAE,CACN,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,8BAA8B,KACrC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,iFAAiF;IACjF,GAAG,EAAE,CACH,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,2BAA2B,KAClC,OAAO,CAAC,YAAY,CAAC,CAAC;IAC3B,mDAAmD;IACnD,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,4BAA4B,KAAK,0BAA0B,CAAC,YAAY,CAAC,CAAC;IAC3F,kDAAkD;IAClD,YAAY,EAAE,CACZ,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,oCAAoC,KAC3C,0BAA0B,CAAC,YAAY,CAAC,CAAC;CAC/C;AAsCD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,gBAAgB,GAAG,oBAAoB,CAIxF"}
@@ -21,11 +21,12 @@ __export(models_exports, {
21
21
  });
22
22
  module.exports = __toCommonJS(models_exports);
23
23
  var import_operations = require("../../../api/beta/models/operations.js");
24
+ var import_uploads = require("../../../api/beta/models/uploads.js");
24
25
  function _getBetaModels(context) {
25
26
  return {
26
27
  getCredentials: (name, version, credentialRequest, options) => (0, import_operations.getCredentials)(context, name, version, credentialRequest, options),
27
28
  pendingUpload: (name, version, pendingUploadRequest, options) => (0, import_operations.pendingUpload)(context, name, version, pendingUploadRequest, options),
28
- create: (name, version, source, options) => (0, import_operations.createFromSource)(context, name, version, source, options),
29
+ create: (name, version, source, options) => (0, import_uploads.createFromSource)(context, name, version, source, options),
29
30
  update: (name, modelVersionUpdate, version, options) => (0, import_operations.update)(context, name, modelVersionUpdate, version, options),
30
31
  delete: (name, version, options) => (0, import_operations.$delete)(context, name, version, options),
31
32
  get: (name, version, options) => (0, import_operations.get)(context, name, version, options),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/classic/beta/models/index.ts"],
4
- "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AIProjectContext } from \"../../../api/aiProjectContext.js\";\nimport {\n getCredentials,\n pendingUpload,\n createFromSource,\n update,\n $delete,\n get,\n list,\n listVersions,\n} from \"../../../api/beta/models/operations.js\";\nimport type { BetaModelsCreateFromSourceOptions } from \"../../../api/beta/models/options.js\";\nimport type {\n BetaModelsGetCredentialsOptionalParams,\n BetaModelsPendingUploadOptionalParams,\n BetaModelsUpdateOptionalParams,\n BetaModelsDeleteOptionalParams,\n BetaModelsGetOptionalParams,\n BetaModelsListOptionalParams,\n BetaModelsListVersionsOptionalParams,\n} from \"../../../api/beta/models/options.js\";\nimport type {\n DatasetCredential,\n ModelVersion,\n UpdateModelVersionRequest,\n ModelPendingUploadRequest,\n ModelPendingUploadResponse,\n ModelCredentialRequest,\n} from \"../../../models/models.js\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\n\nexport type { BetaModelsCreateFromSourceOptions as BetaModelsCreateOptions };\n\n/** Interface representing a BetaModels operations. */\nexport interface BetaModelsOperations {\n /** Retrieves temporary credentials for accessing the storage backing the specified model version. */\n getCredentials: (\n name: string,\n version: string,\n credentialRequest: ModelCredentialRequest,\n options?: BetaModelsGetCredentialsOptionalParams,\n ) => Promise<DatasetCredential>;\n /** Initiates a new pending upload or retrieves an existing one for the specified model version. */\n pendingUpload: (\n name: string,\n version: string,\n pendingUploadRequest: ModelPendingUploadRequest,\n options?: BetaModelsPendingUploadOptionalParams,\n ) => Promise<ModelPendingUploadResponse>;\n /** Upload local model files and register a model version. Wraps pendingUpload, file upload, async creation, and polling into a single call. */\n create: (\n name: string,\n version: string,\n source: string,\n options?: BetaModelsCreateFromSourceOptions,\n ) => Promise<ModelVersion>;\n /** Update an existing ModelVersion with the given version id */\n update: (\n name: string,\n modelVersionUpdate: UpdateModelVersionRequest,\n version: string,\n options?: BetaModelsUpdateOptionalParams,\n ) => Promise<ModelVersion>;\n /** Delete the specific version of the ModelVersion. The service returns 200 OK if the ModelVersion was deleted successfully or if the ModelVersion does not exist. */\n delete: (\n name: string,\n version: string,\n options?: BetaModelsDeleteOptionalParams,\n ) => Promise<void>;\n /** Retrieves the specified model version, returning 404 if it does not exist. */\n get: (\n name: string,\n version: string,\n options?: BetaModelsGetOptionalParams,\n ) => Promise<ModelVersion>;\n /** List the latest version of each ModelVersion */\n list: (options?: BetaModelsListOptionalParams) => PagedAsyncIterableIterator<ModelVersion>;\n /** List all versions of the given ModelVersion */\n listVersions: (\n name: string,\n options?: BetaModelsListVersionsOptionalParams,\n ) => PagedAsyncIterableIterator<ModelVersion>;\n}\n\nfunction _getBetaModels(context: AIProjectContext) {\n return {\n getCredentials: (\n name: string,\n version: string,\n credentialRequest: ModelCredentialRequest,\n options?: BetaModelsGetCredentialsOptionalParams,\n ) => getCredentials(context, name, version, credentialRequest, options),\n pendingUpload: (\n name: string,\n version: string,\n pendingUploadRequest: ModelPendingUploadRequest,\n options?: BetaModelsPendingUploadOptionalParams,\n ) => pendingUpload(context, name, version, pendingUploadRequest, options),\n create: (\n name: string,\n version: string,\n source: string,\n options?: BetaModelsCreateFromSourceOptions,\n ) => createFromSource(context, name, version, source, options),\n update: (\n name: string,\n modelVersionUpdate: UpdateModelVersionRequest,\n version: string,\n options?: BetaModelsUpdateOptionalParams,\n ) => update(context, name, modelVersionUpdate, version, options),\n delete: (name: string, version: string, options?: BetaModelsDeleteOptionalParams) =>\n $delete(context, name, version, options),\n get: (name: string, version: string, options?: BetaModelsGetOptionalParams) =>\n get(context, name, version, options),\n list: (options?: BetaModelsListOptionalParams) => list(context, options),\n listVersions: (name: string, options?: BetaModelsListVersionsOptionalParams) =>\n listVersions(context, name, options),\n };\n}\n\nexport function _getBetaModelsOperations(context: AIProjectContext): BetaModelsOperations {\n return {\n ..._getBetaModels(context),\n };\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,wBASO;AA0EP,SAAS,eAAe,SAA2B;AACjD,SAAO;AAAA,IACL,gBAAgB,CACd,MACA,SACA,mBACA,gBACG,kCAAe,SAAS,MAAM,SAAS,mBAAmB,OAAO;AAAA,IACtE,eAAe,CACb,MACA,SACA,sBACA,gBACG,iCAAc,SAAS,MAAM,SAAS,sBAAsB,OAAO;AAAA,IACxE,QAAQ,CACN,MACA,SACA,QACA,gBACG,oCAAiB,SAAS,MAAM,SAAS,QAAQ,OAAO;AAAA,IAC7D,QAAQ,CACN,MACA,oBACA,SACA,gBACG,0BAAO,SAAS,MAAM,oBAAoB,SAAS,OAAO;AAAA,IAC/D,QAAQ,CAAC,MAAc,SAAiB,gBACtC,2BAAQ,SAAS,MAAM,SAAS,OAAO;AAAA,IACzC,KAAK,CAAC,MAAc,SAAiB,gBACnC,uBAAI,SAAS,MAAM,SAAS,OAAO;AAAA,IACrC,MAAM,CAAC,gBAA2C,wBAAK,SAAS,OAAO;AAAA,IACvE,cAAc,CAAC,MAAc,gBAC3B,gCAAa,SAAS,MAAM,OAAO;AAAA,EACvC;AACF;AAEO,SAAS,yBAAyB,SAAiD;AACxF,SAAO;AAAA,IACL,GAAG,eAAe,OAAO;AAAA,EAC3B;AACF;",
4
+ "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AIProjectContext } from \"../../../api/aiProjectContext.js\";\nimport {\n getCredentials,\n pendingUpload,\n update,\n $delete,\n get,\n list,\n listVersions,\n} from \"../../../api/beta/models/operations.js\";\nimport { createFromSource } from \"#platform/api/beta/models/uploads\";\nimport type { BetaModelsCreateFromSourceOptions } from \"../../../api/beta/models/options.js\";\nimport type {\n BetaModelsGetCredentialsOptionalParams,\n BetaModelsPendingUploadOptionalParams,\n BetaModelsUpdateOptionalParams,\n BetaModelsDeleteOptionalParams,\n BetaModelsGetOptionalParams,\n BetaModelsListOptionalParams,\n BetaModelsListVersionsOptionalParams,\n} from \"../../../api/beta/models/options.js\";\nimport type {\n DatasetCredential,\n ModelVersion,\n UpdateModelVersionRequest,\n ModelPendingUploadRequest,\n ModelPendingUploadResponse,\n ModelCredentialRequest,\n} from \"../../../models/models.js\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\n\nexport type { BetaModelsCreateFromSourceOptions as BetaModelsCreateOptions };\n\n/** Interface representing a BetaModels operations. */\nexport interface BetaModelsOperations {\n /** Retrieves temporary credentials for accessing the storage backing the specified model version. */\n getCredentials: (\n name: string,\n version: string,\n credentialRequest: ModelCredentialRequest,\n options?: BetaModelsGetCredentialsOptionalParams,\n ) => Promise<DatasetCredential>;\n /** Initiates a new pending upload or retrieves an existing one for the specified model version. */\n pendingUpload: (\n name: string,\n version: string,\n pendingUploadRequest: ModelPendingUploadRequest,\n options?: BetaModelsPendingUploadOptionalParams,\n ) => Promise<ModelPendingUploadResponse>;\n /** Upload local model files and register a model version. Only supported in Node.js. Wraps pendingUpload, file upload, async creation, and polling into a single call. */\n create: (\n name: string,\n version: string,\n source: string,\n options?: BetaModelsCreateFromSourceOptions,\n ) => Promise<ModelVersion>;\n /** Update an existing ModelVersion with the given version id */\n update: (\n name: string,\n modelVersionUpdate: UpdateModelVersionRequest,\n version: string,\n options?: BetaModelsUpdateOptionalParams,\n ) => Promise<ModelVersion>;\n /** Delete the specific version of the ModelVersion. The service returns 200 OK if the ModelVersion was deleted successfully or if the ModelVersion does not exist. */\n delete: (\n name: string,\n version: string,\n options?: BetaModelsDeleteOptionalParams,\n ) => Promise<void>;\n /** Retrieves the specified model version, returning 404 if it does not exist. */\n get: (\n name: string,\n version: string,\n options?: BetaModelsGetOptionalParams,\n ) => Promise<ModelVersion>;\n /** List the latest version of each ModelVersion */\n list: (options?: BetaModelsListOptionalParams) => PagedAsyncIterableIterator<ModelVersion>;\n /** List all versions of the given ModelVersion */\n listVersions: (\n name: string,\n options?: BetaModelsListVersionsOptionalParams,\n ) => PagedAsyncIterableIterator<ModelVersion>;\n}\n\nfunction _getBetaModels(context: AIProjectContext) {\n return {\n getCredentials: (\n name: string,\n version: string,\n credentialRequest: ModelCredentialRequest,\n options?: BetaModelsGetCredentialsOptionalParams,\n ) => getCredentials(context, name, version, credentialRequest, options),\n pendingUpload: (\n name: string,\n version: string,\n pendingUploadRequest: ModelPendingUploadRequest,\n options?: BetaModelsPendingUploadOptionalParams,\n ) => pendingUpload(context, name, version, pendingUploadRequest, options),\n create: (\n name: string,\n version: string,\n source: string,\n options?: BetaModelsCreateFromSourceOptions,\n ) => createFromSource(context, name, version, source, options),\n update: (\n name: string,\n modelVersionUpdate: UpdateModelVersionRequest,\n version: string,\n options?: BetaModelsUpdateOptionalParams,\n ) => update(context, name, modelVersionUpdate, version, options),\n delete: (name: string, version: string, options?: BetaModelsDeleteOptionalParams) =>\n $delete(context, name, version, options),\n get: (name: string, version: string, options?: BetaModelsGetOptionalParams) =>\n get(context, name, version, options),\n list: (options?: BetaModelsListOptionalParams) => list(context, options),\n listVersions: (name: string, options?: BetaModelsListVersionsOptionalParams) =>\n listVersions(context, name, options),\n };\n}\n\nexport function _getBetaModelsOperations(context: AIProjectContext): BetaModelsOperations {\n return {\n ..._getBetaModels(context),\n };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,wBAQO;AACP,qBAAiC;AA0EjC,SAAS,eAAe,SAA2B;AACjD,SAAO;AAAA,IACL,gBAAgB,CACd,MACA,SACA,mBACA,gBACG,kCAAe,SAAS,MAAM,SAAS,mBAAmB,OAAO;AAAA,IACtE,eAAe,CACb,MACA,SACA,sBACA,gBACG,iCAAc,SAAS,MAAM,SAAS,sBAAsB,OAAO;AAAA,IACxE,QAAQ,CACN,MACA,SACA,QACA,gBACG,iCAAiB,SAAS,MAAM,SAAS,QAAQ,OAAO;AAAA,IAC7D,QAAQ,CACN,MACA,oBACA,SACA,gBACG,0BAAO,SAAS,MAAM,oBAAoB,SAAS,OAAO;AAAA,IAC/D,QAAQ,CAAC,MAAc,SAAiB,gBACtC,2BAAQ,SAAS,MAAM,SAAS,OAAO;AAAA,IACzC,KAAK,CAAC,MAAc,SAAiB,gBACnC,uBAAI,SAAS,MAAM,SAAS,OAAO;AAAA,IACrC,MAAM,CAAC,gBAA2C,wBAAK,SAAS,OAAO;AAAA,IACvE,cAAc,CAAC,MAAc,gBAC3B,gCAAa,SAAS,MAAM,OAAO;AAAA,EACvC;AACF;AAEO,SAAS,yBAAyB,SAAiD;AACxF,SAAO;AAAA,IACL,GAAG,eAAe,OAAO;AAAA,EAC3B;AACF;",
6
6
  "names": []
7
7
  }
@@ -19,9 +19,9 @@ export interface DatasetsOperations {
19
19
  list: (options?: DatasetsListOptionalParams) => PagedAsyncIterableIterator<DatasetVersionUnion>;
20
20
  /** List all versions of the given DatasetVersion */
21
21
  listVersions: (name: string, options?: DatasetsListVersionsOptionalParams) => PagedAsyncIterableIterator<DatasetVersionUnion>;
22
- /** Upload a file to the DatasetVersion */
22
+ /** Upload a file to the DatasetVersion. Only supported in Node.js. */
23
23
  uploadFile: (name: string, version: string, filePath: string, options?: DatasetUploadOptions) => Promise<DatasetVersionUnion>;
24
- /** Upload a folder to the DatasetVersion */
24
+ /** Upload a folder to the DatasetVersion. Only supported in Node.js. */
25
25
  uploadFolder: (name: string, version: string, folderPath: string, options?: DatasetUploadOptions) => Promise<DatasetVersionUnion>;
26
26
  }
27
27
  export declare function _getDatasetsOperations(context: AIProjectContext, projectOptions?: AIProjectClientOptionalParams): DatasetsOperations;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/classic/datasets/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,6BAA6B,EAC7B,gBAAgB,EACjB,MAAM,+BAA+B,CAAC;AAYvC,OAAO,KAAK,EACV,oCAAoC,EACpC,mCAAmC,EACnC,oCAAoC,EACpC,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,EAC1B,kCAAkC,EACnC,MAAM,+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3B,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACnC;AA0CD,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,gBAAgB,EACzB,cAAc,GAAE,6BAAkC,GACjD,kBAAkB,CAIpB"}
@@ -21,6 +21,7 @@ __export(datasets_exports, {
21
21
  });
22
22
  module.exports = __toCommonJS(datasets_exports);
23
23
  var import_operations = require("../../api/datasets/operations.js");
24
+ var import_uploads = require("../../api/datasets/uploads.js");
24
25
  function _getDatasets(context, projectOptions = {}) {
25
26
  return {
26
27
  getCredentials: (name, version, options) => (0, import_operations.getCredentials)(context, name, version, options),
@@ -30,8 +31,8 @@ function _getDatasets(context, projectOptions = {}) {
30
31
  get: (name, version, options) => (0, import_operations.get)(context, name, version, options),
31
32
  list: (options) => (0, import_operations.list)(context, options),
32
33
  listVersions: (name, options) => (0, import_operations.listVersions)(context, name, options),
33
- uploadFile: (name, version, filePath, options) => (0, import_operations.uploadFile)(context, name, version, filePath, { ...options, projectOptions }),
34
- uploadFolder: (name, version, folderPath, options) => (0, import_operations.uploadFolder)(context, name, version, folderPath, { ...options, projectOptions })
34
+ uploadFile: (name, version, filePath, options) => (0, import_uploads.uploadFile)(context, name, version, filePath, { ...options, projectOptions }),
35
+ uploadFolder: (name, version, folderPath, options) => (0, import_uploads.uploadFolder)(context, name, version, folderPath, { ...options, projectOptions })
35
36
  };
36
37
  }
37
38
  function _getDatasetsOperations(context, projectOptions = {}) {