@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,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/classic/datasets/index.ts"],
4
- "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n AIProjectClientOptionalParams,\n AIProjectContext,\n} from \"../../api/aiProjectContext.js\";\nimport {\n getCredentials,\n pendingUpload,\n createOrUpdate,\n $delete,\n get,\n list,\n listVersions,\n uploadFile,\n uploadFolder,\n} from \"../../api/datasets/operations.js\";\nimport type {\n DatasetsGetCredentialsOptionalParams,\n DatasetsPendingUploadOptionalParams,\n DatasetsCreateOrUpdateOptionalParams,\n DatasetsDeleteOptionalParams,\n DatasetsGetOptionalParams,\n DatasetsListOptionalParams,\n DatasetsListVersionsOptionalParams,\n} from \"../../api/datasets/options.js\";\nimport type {\n DatasetVersionUnion,\n PendingUploadRequest,\n PendingUploadResponse,\n DatasetCredential,\n} from \"../../models/models.js\";\nimport type { DatasetUploadOptions } from \"../../api/index.js\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\n\n/** Interface representing a Datasets operations. */\nexport interface DatasetsOperations {\n /** Get the SAS credential to access the storage account associated with a Dataset version. */\n getCredentials: (\n name: string,\n version: string,\n options?: DatasetsGetCredentialsOptionalParams,\n ) => Promise<DatasetCredential>;\n /** Start a new or get an existing pending upload of a dataset for a specific version. */\n pendingUpload: (\n name: string,\n version: string,\n pendingUploadRequest: PendingUploadRequest,\n options?: DatasetsPendingUploadOptionalParams,\n ) => Promise<PendingUploadResponse>;\n /** Create a new or update an existing DatasetVersion with the given version id */\n createOrUpdate: (\n name: string,\n version: string,\n datasetVersion: DatasetVersionUnion,\n options?: DatasetsCreateOrUpdateOptionalParams,\n ) => Promise<DatasetVersionUnion>;\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. */\n delete: (name: string, version: string, options?: DatasetsDeleteOptionalParams) => Promise<void>;\n /** Get the specific version of the DatasetVersion. The service returns 404 Not Found error if the DatasetVersion does not exist. */\n get: (\n name: string,\n version: string,\n options?: DatasetsGetOptionalParams,\n ) => Promise<DatasetVersionUnion>;\n /** List the latest version of each DatasetVersion */\n list: (options?: DatasetsListOptionalParams) => PagedAsyncIterableIterator<DatasetVersionUnion>;\n /** List all versions of the given DatasetVersion */\n listVersions: (\n name: string,\n options?: DatasetsListVersionsOptionalParams,\n ) => PagedAsyncIterableIterator<DatasetVersionUnion>;\n /** Upload a file to the DatasetVersion */\n uploadFile: (\n name: string,\n version: string,\n filePath: string,\n options?: DatasetUploadOptions,\n ) => Promise<DatasetVersionUnion>;\n /** Upload a folder to the DatasetVersion */\n uploadFolder: (\n name: string,\n version: string,\n folderPath: string,\n options?: DatasetUploadOptions,\n ) => Promise<DatasetVersionUnion>;\n}\n\nfunction _getDatasets(\n context: AIProjectContext,\n projectOptions: AIProjectClientOptionalParams = {},\n) {\n return {\n getCredentials: (\n name: string,\n version: string,\n options?: DatasetsGetCredentialsOptionalParams,\n ) => getCredentials(context, name, version, options),\n pendingUpload: (\n name: string,\n version: string,\n pendingUploadRequest: PendingUploadRequest,\n options?: DatasetsPendingUploadOptionalParams,\n ) => pendingUpload(context, name, version, pendingUploadRequest, options),\n createOrUpdate: (\n name: string,\n version: string,\n datasetVersion: DatasetVersionUnion,\n options?: DatasetsCreateOrUpdateOptionalParams,\n ) => createOrUpdate(context, name, version, datasetVersion, options),\n delete: (name: string, version: string, options?: DatasetsDeleteOptionalParams) =>\n $delete(context, name, version, options),\n get: (name: string, version: string, options?: DatasetsGetOptionalParams) =>\n get(context, name, version, options),\n list: (options?: DatasetsListOptionalParams) => list(context, options),\n listVersions: (name: string, options?: DatasetsListVersionsOptionalParams) =>\n listVersions(context, name, options),\n uploadFile: (name: string, version: string, filePath: string, options?: DatasetUploadOptions) =>\n uploadFile(context, name, version, filePath, { ...options, projectOptions }),\n uploadFolder: (\n name: string,\n version: string,\n folderPath: string,\n options?: DatasetUploadOptions,\n ) => uploadFolder(context, name, version, folderPath, { ...options, projectOptions }),\n };\n}\n\nexport function _getDatasetsOperations(\n context: AIProjectContext,\n projectOptions: AIProjectClientOptionalParams = {},\n): DatasetsOperations {\n return {\n ..._getDatasets(context, projectOptions),\n };\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,wBAUO;AAwEP,SAAS,aACP,SACA,iBAAgD,CAAC,GACjD;AACA,SAAO;AAAA,IACL,gBAAgB,CACd,MACA,SACA,gBACG,kCAAe,SAAS,MAAM,SAAS,OAAO;AAAA,IACnD,eAAe,CACb,MACA,SACA,sBACA,gBACG,iCAAc,SAAS,MAAM,SAAS,sBAAsB,OAAO;AAAA,IACxE,gBAAgB,CACd,MACA,SACA,gBACA,gBACG,kCAAe,SAAS,MAAM,SAAS,gBAAgB,OAAO;AAAA,IACnE,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,gBAAyC,wBAAK,SAAS,OAAO;AAAA,IACrE,cAAc,CAAC,MAAc,gBAC3B,gCAAa,SAAS,MAAM,OAAO;AAAA,IACrC,YAAY,CAAC,MAAc,SAAiB,UAAkB,gBAC5D,8BAAW,SAAS,MAAM,SAAS,UAAU,EAAE,GAAG,SAAS,eAAe,CAAC;AAAA,IAC7E,cAAc,CACZ,MACA,SACA,YACA,gBACG,gCAAa,SAAS,MAAM,SAAS,YAAY,EAAE,GAAG,SAAS,eAAe,CAAC;AAAA,EACtF;AACF;AAEO,SAAS,uBACd,SACA,iBAAgD,CAAC,GAC7B;AACpB,SAAO;AAAA,IACL,GAAG,aAAa,SAAS,cAAc;AAAA,EACzC;AACF;",
4
+ "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n AIProjectClientOptionalParams,\n AIProjectContext,\n} from \"../../api/aiProjectContext.js\";\nimport {\n getCredentials,\n pendingUpload,\n createOrUpdate,\n $delete,\n get,\n list,\n listVersions,\n} from \"../../api/datasets/operations.js\";\nimport { uploadFile, uploadFolder } from \"#platform/api/datasets/uploads\";\nimport type {\n DatasetsGetCredentialsOptionalParams,\n DatasetsPendingUploadOptionalParams,\n DatasetsCreateOrUpdateOptionalParams,\n DatasetsDeleteOptionalParams,\n DatasetsGetOptionalParams,\n DatasetsListOptionalParams,\n DatasetsListVersionsOptionalParams,\n} from \"../../api/datasets/options.js\";\nimport type {\n DatasetVersionUnion,\n PendingUploadRequest,\n PendingUploadResponse,\n DatasetCredential,\n} from \"../../models/models.js\";\nimport type { DatasetUploadOptions } from \"../../api/index.js\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\n\n/** Interface representing a Datasets operations. */\nexport interface DatasetsOperations {\n /** Get the SAS credential to access the storage account associated with a Dataset version. */\n getCredentials: (\n name: string,\n version: string,\n options?: DatasetsGetCredentialsOptionalParams,\n ) => Promise<DatasetCredential>;\n /** Start a new or get an existing pending upload of a dataset for a specific version. */\n pendingUpload: (\n name: string,\n version: string,\n pendingUploadRequest: PendingUploadRequest,\n options?: DatasetsPendingUploadOptionalParams,\n ) => Promise<PendingUploadResponse>;\n /** Create a new or update an existing DatasetVersion with the given version id */\n createOrUpdate: (\n name: string,\n version: string,\n datasetVersion: DatasetVersionUnion,\n options?: DatasetsCreateOrUpdateOptionalParams,\n ) => Promise<DatasetVersionUnion>;\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. */\n delete: (name: string, version: string, options?: DatasetsDeleteOptionalParams) => Promise<void>;\n /** Get the specific version of the DatasetVersion. The service returns 404 Not Found error if the DatasetVersion does not exist. */\n get: (\n name: string,\n version: string,\n options?: DatasetsGetOptionalParams,\n ) => Promise<DatasetVersionUnion>;\n /** List the latest version of each DatasetVersion */\n list: (options?: DatasetsListOptionalParams) => PagedAsyncIterableIterator<DatasetVersionUnion>;\n /** List all versions of the given DatasetVersion */\n listVersions: (\n name: string,\n options?: DatasetsListVersionsOptionalParams,\n ) => PagedAsyncIterableIterator<DatasetVersionUnion>;\n /** Upload a file to the DatasetVersion. Only supported in Node.js. */\n uploadFile: (\n name: string,\n version: string,\n filePath: string,\n options?: DatasetUploadOptions,\n ) => Promise<DatasetVersionUnion>;\n /** Upload a folder to the DatasetVersion. Only supported in Node.js. */\n uploadFolder: (\n name: string,\n version: string,\n folderPath: string,\n options?: DatasetUploadOptions,\n ) => Promise<DatasetVersionUnion>;\n}\n\nfunction _getDatasets(\n context: AIProjectContext,\n projectOptions: AIProjectClientOptionalParams = {},\n) {\n return {\n getCredentials: (\n name: string,\n version: string,\n options?: DatasetsGetCredentialsOptionalParams,\n ) => getCredentials(context, name, version, options),\n pendingUpload: (\n name: string,\n version: string,\n pendingUploadRequest: PendingUploadRequest,\n options?: DatasetsPendingUploadOptionalParams,\n ) => pendingUpload(context, name, version, pendingUploadRequest, options),\n createOrUpdate: (\n name: string,\n version: string,\n datasetVersion: DatasetVersionUnion,\n options?: DatasetsCreateOrUpdateOptionalParams,\n ) => createOrUpdate(context, name, version, datasetVersion, options),\n delete: (name: string, version: string, options?: DatasetsDeleteOptionalParams) =>\n $delete(context, name, version, options),\n get: (name: string, version: string, options?: DatasetsGetOptionalParams) =>\n get(context, name, version, options),\n list: (options?: DatasetsListOptionalParams) => list(context, options),\n listVersions: (name: string, options?: DatasetsListVersionsOptionalParams) =>\n listVersions(context, name, options),\n uploadFile: (name: string, version: string, filePath: string, options?: DatasetUploadOptions) =>\n uploadFile(context, name, version, filePath, { ...options, projectOptions }),\n uploadFolder: (\n name: string,\n version: string,\n folderPath: string,\n options?: DatasetUploadOptions,\n ) => uploadFolder(context, name, version, folderPath, { ...options, projectOptions }),\n };\n}\n\nexport function _getDatasetsOperations(\n context: AIProjectContext,\n projectOptions: AIProjectClientOptionalParams = {},\n): DatasetsOperations {\n return {\n ..._getDatasets(context, projectOptions),\n };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,wBAQO;AACP,qBAAyC;AAwEzC,SAAS,aACP,SACA,iBAAgD,CAAC,GACjD;AACA,SAAO;AAAA,IACL,gBAAgB,CACd,MACA,SACA,gBACG,kCAAe,SAAS,MAAM,SAAS,OAAO;AAAA,IACnD,eAAe,CACb,MACA,SACA,sBACA,gBACG,iCAAc,SAAS,MAAM,SAAS,sBAAsB,OAAO;AAAA,IACxE,gBAAgB,CACd,MACA,SACA,gBACA,gBACG,kCAAe,SAAS,MAAM,SAAS,gBAAgB,OAAO;AAAA,IACnE,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,gBAAyC,wBAAK,SAAS,OAAO;AAAA,IACrE,cAAc,CAAC,MAAc,gBAC3B,gCAAa,SAAS,MAAM,OAAO;AAAA,IACrC,YAAY,CAAC,MAAc,SAAiB,UAAkB,gBAC5D,2BAAW,SAAS,MAAM,SAAS,UAAU,EAAE,GAAG,SAAS,eAAe,CAAC;AAAA,IAC7E,cAAc,CACZ,MACA,SACA,YACA,gBACG,6BAAa,SAAS,MAAM,SAAS,YAAY,EAAE,GAAG,SAAS,eAAe,CAAC;AAAA,EACtF;AACF;AAEO,SAAS,uBACd,SACA,iBAAgD,CAAC,GAC7B;AACpB,SAAO;AAAA,IACL,GAAG,aAAa,SAAS,cAAc;AAAA,EACzC;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Current version of the `@azure/ai-projects` package.
3
3
  */
4
- export declare const SDK_VERSION = "2.7.0";
4
+ export declare const SDK_VERSION = "2.7.1";
5
5
  /**
6
6
  * The package name of the `@azure/ai-projects` package.
7
7
  */
@@ -21,7 +21,7 @@ __export(constants_exports, {
21
21
  SDK_VERSION: () => SDK_VERSION
22
22
  });
23
23
  module.exports = __toCommonJS(constants_exports);
24
- const SDK_VERSION = `2.7.0`;
24
+ const SDK_VERSION = `2.7.1`;
25
25
  const PACKAGE_NAME = "@azure/ai-projects";
26
26
  // Annotate the CommonJS export names for ESM import in node:
27
27
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/constants.ts"],
4
- "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Current version of the `@azure/ai-projects` package.\n */\nexport const SDK_VERSION = `2.7.0`;\n\n/**\n * The package name of the `@azure/ai-projects` package.\n */\nexport const PACKAGE_NAME = \"@azure/ai-projects\";\n"],
4
+ "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Current version of the `@azure/ai-projects` package.\n */\nexport const SDK_VERSION = `2.7.1`;\n\n/**\n * The package name of the `@azure/ai-projects` package.\n */\nexport const PACKAGE_NAME = \"@azure/ai-projects\";\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMO,MAAM,cAAc;AAKpB,MAAM,eAAe;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure/ai-projects",
3
- "version": "2.7.0",
3
+ "version": "2.7.1",
4
4
  "type": "commonjs",
5
5
  "exports": {
6
6
  "./package.json": "./package.json"
@@ -1,7 +1,7 @@
1
1
  import type { AIProjectContext as Client } from "../../index.js";
2
2
  import type { DatasetCredential, _PagedModelVersion, ModelVersion, UpdateModelVersionRequest, ModelPendingUploadRequest, ModelPendingUploadResponse, ModelCredentialRequest } from "../../../models/models.js";
3
3
  import type { PagedAsyncIterableIterator } from "@azure/core-paging";
4
- import type { BetaModelsGetCredentialsOptionalParams, BetaModelsPendingUploadOptionalParams, BetaModelsPendingCreateVersionOptionalParams, BetaModelsCreateFromSourceOptions, BetaModelsUpdateOptionalParams, BetaModelsDeleteOptionalParams, BetaModelsGetOptionalParams, BetaModelsListOptionalParams, BetaModelsListVersionsOptionalParams } from "./options.js";
4
+ import type { BetaModelsGetCredentialsOptionalParams, BetaModelsPendingUploadOptionalParams, BetaModelsPendingCreateVersionOptionalParams, BetaModelsUpdateOptionalParams, BetaModelsDeleteOptionalParams, BetaModelsGetOptionalParams, BetaModelsListOptionalParams, BetaModelsListVersionsOptionalParams } from "./options.js";
5
5
  import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client";
6
6
  export declare function _getCredentialsSend(context: Client, name: string, version: string, credentialRequest: ModelCredentialRequest, options?: BetaModelsGetCredentialsOptionalParams): StreamableMethod;
7
7
  export declare function _getCredentialsDeserialize(result: PathUncheckedResponse): Promise<DatasetCredential>;
@@ -41,5 +41,4 @@ export declare function _listVersionsSend(context: Client, name: string, options
41
41
  export declare function _listVersionsDeserialize(result: PathUncheckedResponse): Promise<_PagedModelVersion>;
42
42
  /** List all versions of the given ModelVersion */
43
43
  export declare function listVersions(context: Client, name: string, options?: BetaModelsListVersionsOptionalParams): PagedAsyncIterableIterator<ModelVersion>;
44
- export declare function createFromSource(context: Client, name: string, version: string, source: string, options?: BetaModelsCreateFromSourceOptions): Promise<ModelVersion>;
45
44
  //# sourceMappingURL=operations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../../src/api/beta/models/operations.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,IAAI,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACvB,MAAM,2BAA2B,CAAC;AAYnC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAGrE,OAAO,KAAK,EACV,sCAAsC,EACtC,qCAAqC,EACrC,4CAA4C,EAC5C,iCAAiC,EACjC,8BAA8B,EAC9B,8BAA8B,EAC9B,2BAA2B,EAC3B,4BAA4B,EAC5B,oCAAoC,EACrC,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAMvF,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,sBAA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C,CAO7B;AAED,kDAAkD;AAClD,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,oCAA6D,GACrE,0BAA0B,CAAC,YAAY,CAAC,CAQ1C"}
@@ -4,9 +4,6 @@ import { datasetCredentialDeserializer, _pagedModelVersionDeserializer, modelVer
4
4
  import { buildPagedAsyncIterator } from "../../../static-helpers/pagingHelpers.js";
5
5
  import { expandUrlTemplate } from "../../../static-helpers/urlTemplate.js";
6
6
  import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client";
7
- import { BlobServiceClient } from "@azure/storage-blob";
8
- import fs from "node:fs";
9
- import nodePath from "node:path";
10
7
  export function _getCredentialsSend(context, name, version, credentialRequest, options = { requestOptions: {} }) {
11
8
  const foundryFeatures = "Models=V1Preview";
12
9
  const path = expandUrlTemplate("/models/{name}/versions/{version}/credentials{?api-version}", {
@@ -246,60 +243,4 @@ export async function _listVersionsDeserialize(result) {
246
243
  export function listVersions(context, name, options = { requestOptions: {} }) {
247
244
  return buildPagedAsyncIterator(context, () => _listVersionsSend(context, name, options), _listVersionsDeserialize, ["200"], { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "v1" });
248
245
  }
249
- function getAllFiles(dir) {
250
- const results = [];
251
- for (const entry of fs.readdirSync(dir)) {
252
- const fullPath = nodePath.join(dir, entry);
253
- if (fs.statSync(fullPath).isDirectory()) {
254
- results.push(...getAllFiles(fullPath));
255
- }
256
- else {
257
- results.push(fullPath);
258
- }
259
- }
260
- return results;
261
- }
262
- export async function createFromSource(context, name, version, source, options = {}) {
263
- const pollingTimeout = options.pollingTimeout ?? 300_000;
264
- const pollingInterval = options.pollingInterval ?? 2_000;
265
- // Step 1: Get a pending upload SAS URL
266
- const uploadResponse = await pendingUpload(context, name, version, {
267
- pendingUploadType: "TemporaryBlobReference",
268
- });
269
- // Step 2: Upload local files to the blob container
270
- const containerClient = new BlobServiceClient(uploadResponse.blobReference.credential.sasUri).getContainerClient("");
271
- const files = getAllFiles(source);
272
- for (const filePath of files) {
273
- const blobName = nodePath.relative(source, filePath).replace(/\\/g, "/");
274
- const data = fs.readFileSync(filePath);
275
- const blockBlobClient = containerClient.getBlockBlobClient(blobName);
276
- await blockBlobClient.upload(data, data.length);
277
- }
278
- // Step 3: Trigger async model version creation
279
- await pendingCreateVersion(context, name, version, {
280
- blobUri: uploadResponse.blobReference.blobUri,
281
- weightType: options.weightType,
282
- baseModel: options.baseModel,
283
- description: options.description,
284
- tags: options.tags,
285
- name,
286
- version,
287
- });
288
- // Step 4: Poll until the model version is available
289
- const deadline = Date.now() + pollingTimeout;
290
- while (Date.now() < deadline) {
291
- try {
292
- return await get(context, name, version);
293
- }
294
- catch (e) {
295
- if (e.statusCode === 404) {
296
- await new Promise((resolve) => setTimeout(resolve, pollingInterval));
297
- }
298
- else {
299
- throw e;
300
- }
301
- }
302
- }
303
- throw new Error(`Model version '${name}@${version}' did not become available within ${pollingTimeout}ms.`);
304
- }
305
246
  //# sourceMappingURL=operations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../../src/api/beta/models/operations.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAYlC,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,sBAAsB,EACtB,wBAAwB,EACxB,mCAAmC,EACnC,gCAAgC,EAChC,mCAAmC,EACnC,sCAAsC,EACtC,gCAAgC,GACjC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAa3E,OAAO,EAAE,eAAe,EAAE,mCAAmC,EAAE,MAAM,yBAAyB,CAAC;AAC/F,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,QAAQ,MA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;iBAAM,CAAC;gBACN,MAAM,CAAC,CAAC;YACV,CAAC;QACH,CAAC;IACH,CAAC;IACD,MAAM,IAAI,KAAK,CACb,kBAAkB,IAAI,IAAI,OAAO,qCAAqC,cAAc,KAAK,CAC1F,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AIProjectContext as Client } from \"../../index.js\";\nimport type {\n DatasetCredential,\n _PagedModelVersion,\n ModelVersion,\n UpdateModelVersionRequest,\n ModelPendingUploadRequest,\n ModelPendingUploadResponse,\n ModelCredentialRequest,\n} from \"../../../models/models.js\";\nimport {\n datasetCredentialDeserializer,\n _pagedModelVersionDeserializer,\n modelVersionSerializer,\n modelVersionDeserializer,\n updateModelVersionRequestSerializer,\n _createAsyncResponseDeserializer,\n modelPendingUploadRequestSerializer,\n modelPendingUploadResponseDeserializer,\n modelCredentialRequestSerializer,\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 BetaModelsGetCredentialsOptionalParams,\n BetaModelsPendingUploadOptionalParams,\n BetaModelsPendingCreateVersionOptionalParams,\n BetaModelsCreateFromSourceOptions,\n BetaModelsUpdateOptionalParams,\n BetaModelsDeleteOptionalParams,\n BetaModelsGetOptionalParams,\n BetaModelsListOptionalParams,\n BetaModelsListVersionsOptionalParams,\n} from \"./options.js\";\nimport type { StreamableMethod, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { createRestError, operationOptionsToRequestParameters } from \"@azure-rest/core-client\";\nimport { BlobServiceClient } from \"@azure/storage-blob\";\nimport fs from \"node:fs\";\nimport nodePath from \"node:path\";\n\nexport function _getCredentialsSend(\n context: Client,\n name: string,\n version: string,\n credentialRequest: ModelCredentialRequest,\n options: BetaModelsGetCredentialsOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const foundryFeatures = \"Models=V1Preview\";\n const path = expandUrlTemplate(\n \"/models/{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 contentType: \"application/json\",\n headers: {\n \"foundry-features\": foundryFeatures,\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: modelCredentialRequestSerializer(credentialRequest),\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/** Retrieves temporary credentials for accessing the storage backing the specified model version. */\nexport async function getCredentials(\n context: Client,\n name: string,\n version: string,\n credentialRequest: ModelCredentialRequest,\n options: BetaModelsGetCredentialsOptionalParams = { requestOptions: {} },\n): Promise<DatasetCredential> {\n const result = await _getCredentialsSend(context, name, version, credentialRequest, options);\n return _getCredentialsDeserialize(result);\n}\n\nexport function _pendingUploadSend(\n context: Client,\n name: string,\n version: string,\n pendingUploadRequest: ModelPendingUploadRequest,\n options: BetaModelsPendingUploadOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const foundryFeatures = \"Models=V1Preview\";\n const path = expandUrlTemplate(\n \"/models/{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 \"foundry-features\": foundryFeatures,\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: modelPendingUploadRequestSerializer(pendingUploadRequest),\n });\n}\n\nexport async function _pendingUploadDeserialize(\n result: PathUncheckedResponse,\n): Promise<ModelPendingUploadResponse> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return modelPendingUploadResponseDeserializer(result.body);\n}\n\n/** Initiates a new pending upload or retrieves an existing one for the specified model version. */\nexport async function pendingUpload(\n context: Client,\n name: string,\n version: string,\n pendingUploadRequest: ModelPendingUploadRequest,\n options: BetaModelsPendingUploadOptionalParams = { requestOptions: {} },\n): Promise<ModelPendingUploadResponse> {\n const result = await _pendingUploadSend(context, name, version, pendingUploadRequest, options);\n return _pendingUploadDeserialize(result);\n}\n\nexport function _pendingCreateVersionSend(\n context: Client,\n name: string,\n version: string,\n modelVersion: ModelVersion,\n options: BetaModelsPendingCreateVersionOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const foundryFeatures = \"Models=V1Preview\";\n const path = expandUrlTemplate(\n \"/models/{name}/versions/{version}/createAsync{?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 \"foundry-features\": foundryFeatures,\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: modelVersionSerializer(modelVersion),\n });\n}\n\nexport async function _pendingCreateVersionDeserialize(result: PathUncheckedResponse): Promise<{\n location?: string;\n operationResult?: string | null;\n}> {\n const expectedStatuses = [\"202\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _createAsyncResponseDeserializer(result.body);\n}\n\n/** Creates a model version asynchronously with blob content validation. Returns 202 Accepted with a location header for polling the operation status. */\nexport async function pendingCreateVersion(\n context: Client,\n name: string,\n version: string,\n modelVersion: ModelVersion,\n options: BetaModelsPendingCreateVersionOptionalParams = { requestOptions: {} },\n): Promise<{\n location?: string;\n operationResult?: string | null;\n}> {\n const result = await _pendingCreateVersionSend(context, name, version, modelVersion, options);\n return _pendingCreateVersionDeserialize(result);\n}\n\nexport function _updateSend(\n context: Client,\n name: string,\n modelVersionUpdate: UpdateModelVersionRequest,\n version: string,\n options: BetaModelsUpdateOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const foundryFeatures = \"Models=V1Preview\";\n const path = expandUrlTemplate(\n \"/models/{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 \"foundry-features\": foundryFeatures,\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: updateModelVersionRequestSerializer(modelVersionUpdate),\n });\n}\n\nexport async function _updateDeserialize(result: PathUncheckedResponse): Promise<ModelVersion> {\n const expectedStatuses = [\"201\", \"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return modelVersionDeserializer(result.body);\n}\n\n/** Updates an existing model version identified by its version ID. */\nexport async function update(\n context: Client,\n name: string,\n modelVersionUpdate: UpdateModelVersionRequest,\n version: string,\n options: BetaModelsUpdateOptionalParams = { requestOptions: {} },\n): Promise<ModelVersion> {\n const result = await _updateSend(context, name, modelVersionUpdate, version, options);\n return _updateDeserialize(result);\n}\n\nexport function _$deleteSend(\n context: Client,\n name: string,\n version: string,\n options: BetaModelsDeleteOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const foundryFeatures = \"Models=V1Preview\";\n const path = expandUrlTemplate(\n \"/models/{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({\n ...operationOptionsToRequestParameters(options),\n headers: { \"foundry-features\": foundryFeatures, ...options.requestOptions?.headers },\n });\n}\n\nexport async function _$deleteDeserialize(result: PathUncheckedResponse): Promise<void> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return;\n}\n\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. */\nexport async function $delete(\n context: Client,\n name: string,\n version: string,\n options: BetaModelsDeleteOptionalParams = { 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: BetaModelsGetOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const foundryFeatures = \"Models=V1Preview\";\n const path = expandUrlTemplate(\n \"/models/{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 \"foundry-features\": foundryFeatures,\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getDeserialize(result: PathUncheckedResponse): Promise<ModelVersion> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return modelVersionDeserializer(result.body);\n}\n\n/** Retrieves the specified model version, returning 404 if it does not exist. */\nexport async function get(\n context: Client,\n name: string,\n version: string,\n options: BetaModelsGetOptionalParams = { requestOptions: {} },\n): Promise<ModelVersion> {\n const result = await _getSend(context, name, version, options);\n return _getDeserialize(result);\n}\n\nexport function _listSend(\n context: Client,\n options: BetaModelsListOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const foundryFeatures = \"Models=V1Preview\";\n const path = expandUrlTemplate(\n \"/models{?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 \"foundry-features\": foundryFeatures,\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listDeserialize(result: PathUncheckedResponse): Promise<_PagedModelVersion> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _pagedModelVersionDeserializer(result.body);\n}\n\n/** List the latest version of each ModelVersion */\nexport function list(\n context: Client,\n options: BetaModelsListOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<ModelVersion> {\n return buildPagedAsyncIterator(\n context,\n () => _listSend(context, options),\n _listDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\", apiVersion: context.apiVersion ?? \"v1\" },\n );\n}\n\nexport function _listVersionsSend(\n context: Client,\n name: string,\n options: BetaModelsListVersionsOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const foundryFeatures = \"Models=V1Preview\";\n const path = expandUrlTemplate(\n \"/models/{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 \"foundry-features\": foundryFeatures,\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listVersionsDeserialize(\n result: PathUncheckedResponse,\n): Promise<_PagedModelVersion> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _pagedModelVersionDeserializer(result.body);\n}\n\n/** List all versions of the given ModelVersion */\nexport function listVersions(\n context: Client,\n name: string,\n options: BetaModelsListVersionsOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<ModelVersion> {\n return buildPagedAsyncIterator(\n context,\n () => _listVersionsSend(context, name, options),\n _listVersionsDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\", apiVersion: context.apiVersion ?? \"v1\" },\n );\n}\n\nfunction getAllFiles(dir: string): string[] {\n const results: string[] = [];\n for (const entry of fs.readdirSync(dir)) {\n const fullPath = nodePath.join(dir, entry);\n if (fs.statSync(fullPath).isDirectory()) {\n results.push(...getAllFiles(fullPath));\n } else {\n results.push(fullPath);\n }\n }\n return results;\n}\n\nexport async function createFromSource(\n context: Client,\n name: string,\n version: string,\n source: string,\n options: BetaModelsCreateFromSourceOptions = {},\n): Promise<ModelVersion> {\n const pollingTimeout = options.pollingTimeout ?? 300_000;\n const pollingInterval = options.pollingInterval ?? 2_000;\n\n // Step 1: Get a pending upload SAS URL\n const uploadResponse = await pendingUpload(context, name, version, {\n pendingUploadType: \"TemporaryBlobReference\",\n });\n\n // Step 2: Upload local files to the blob container\n const containerClient = new BlobServiceClient(\n uploadResponse.blobReference.credential.sasUri,\n ).getContainerClient(\"\");\n const files = getAllFiles(source);\n for (const filePath of files) {\n const blobName = nodePath.relative(source, filePath).replace(/\\\\/g, \"/\");\n const data = fs.readFileSync(filePath);\n const blockBlobClient = containerClient.getBlockBlobClient(blobName);\n await blockBlobClient.upload(data, data.length);\n }\n\n // Step 3: Trigger async model version creation\n await pendingCreateVersion(context, name, version, {\n blobUri: uploadResponse.blobReference.blobUri,\n weightType: options.weightType,\n baseModel: options.baseModel,\n description: options.description,\n tags: options.tags,\n name,\n version,\n });\n\n // Step 4: Poll until the model version is available\n const deadline = Date.now() + pollingTimeout;\n while (Date.now() < deadline) {\n try {\n return await get(context, name, version);\n } catch (e: any) {\n if (e.statusCode === 404) {\n await new Promise((resolve) => setTimeout(resolve, pollingInterval));\n } else {\n throw e;\n }\n }\n }\n throw new Error(\n `Model version '${name}@${version}' did not become available within ${pollingTimeout}ms.`,\n );\n}\n"]}
1
+ {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../../src/api/beta/models/operations.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAYlC,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,sBAAsB,EACtB,wBAAwB,EACxB,mCAAmC,EACnC,gCAAgC,EAChC,mCAAmC,EACnC,sCAAsC,EAC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AI,CAAC,CAAC;AACrD,CAAC;AAED,kDAAkD;AAClD,MAAM,UAAU,YAAY,CAC1B,OAAe,EACf,IAAY,EACZ,UAAgD,EAAE,cAAc,EAAE,EAAE,EAAE;IAEtE,OAAO,uBAAuB,CAC5B,OAAO,EACP,GAAG,EAAE,CAAC,iBAAiB,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,EAC/C,wBAAwB,EACxB,CAAC,KAAK,CAAC,EACP,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,IAAI,EAAE,CACxF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AIProjectContext as Client } from \"../../index.js\";\nimport type {\n DatasetCredential,\n _PagedModelVersion,\n ModelVersion,\n UpdateModelVersionRequest,\n ModelPendingUploadRequest,\n ModelPendingUploadResponse,\n ModelCredentialRequest,\n} from \"../../../models/models.js\";\nimport {\n datasetCredentialDeserializer,\n _pagedModelVersionDeserializer,\n modelVersionSerializer,\n modelVersionDeserializer,\n updateModelVersionRequestSerializer,\n _createAsyncResponseDeserializer,\n modelPendingUploadRequestSerializer,\n modelPendingUploadResponseDeserializer,\n modelCredentialRequestSerializer,\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 BetaModelsGetCredentialsOptionalParams,\n BetaModelsPendingUploadOptionalParams,\n BetaModelsPendingCreateVersionOptionalParams,\n BetaModelsUpdateOptionalParams,\n BetaModelsDeleteOptionalParams,\n BetaModelsGetOptionalParams,\n BetaModelsListOptionalParams,\n BetaModelsListVersionsOptionalParams,\n} from \"./options.js\";\nimport type { StreamableMethod, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { createRestError, operationOptionsToRequestParameters } from \"@azure-rest/core-client\";\n\nexport function _getCredentialsSend(\n context: Client,\n name: string,\n version: string,\n credentialRequest: ModelCredentialRequest,\n options: BetaModelsGetCredentialsOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const foundryFeatures = \"Models=V1Preview\";\n const path = expandUrlTemplate(\n \"/models/{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 contentType: \"application/json\",\n headers: {\n \"foundry-features\": foundryFeatures,\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: modelCredentialRequestSerializer(credentialRequest),\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/** Retrieves temporary credentials for accessing the storage backing the specified model version. */\nexport async function getCredentials(\n context: Client,\n name: string,\n version: string,\n credentialRequest: ModelCredentialRequest,\n options: BetaModelsGetCredentialsOptionalParams = { requestOptions: {} },\n): Promise<DatasetCredential> {\n const result = await _getCredentialsSend(context, name, version, credentialRequest, options);\n return _getCredentialsDeserialize(result);\n}\n\nexport function _pendingUploadSend(\n context: Client,\n name: string,\n version: string,\n pendingUploadRequest: ModelPendingUploadRequest,\n options: BetaModelsPendingUploadOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const foundryFeatures = \"Models=V1Preview\";\n const path = expandUrlTemplate(\n \"/models/{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 \"foundry-features\": foundryFeatures,\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: modelPendingUploadRequestSerializer(pendingUploadRequest),\n });\n}\n\nexport async function _pendingUploadDeserialize(\n result: PathUncheckedResponse,\n): Promise<ModelPendingUploadResponse> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return modelPendingUploadResponseDeserializer(result.body);\n}\n\n/** Initiates a new pending upload or retrieves an existing one for the specified model version. */\nexport async function pendingUpload(\n context: Client,\n name: string,\n version: string,\n pendingUploadRequest: ModelPendingUploadRequest,\n options: BetaModelsPendingUploadOptionalParams = { requestOptions: {} },\n): Promise<ModelPendingUploadResponse> {\n const result = await _pendingUploadSend(context, name, version, pendingUploadRequest, options);\n return _pendingUploadDeserialize(result);\n}\n\nexport function _pendingCreateVersionSend(\n context: Client,\n name: string,\n version: string,\n modelVersion: ModelVersion,\n options: BetaModelsPendingCreateVersionOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const foundryFeatures = \"Models=V1Preview\";\n const path = expandUrlTemplate(\n \"/models/{name}/versions/{version}/createAsync{?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 \"foundry-features\": foundryFeatures,\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: modelVersionSerializer(modelVersion),\n });\n}\n\nexport async function _pendingCreateVersionDeserialize(result: PathUncheckedResponse): Promise<{\n location?: string;\n operationResult?: string | null;\n}> {\n const expectedStatuses = [\"202\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _createAsyncResponseDeserializer(result.body);\n}\n\n/** Creates a model version asynchronously with blob content validation. Returns 202 Accepted with a location header for polling the operation status. */\nexport async function pendingCreateVersion(\n context: Client,\n name: string,\n version: string,\n modelVersion: ModelVersion,\n options: BetaModelsPendingCreateVersionOptionalParams = { requestOptions: {} },\n): Promise<{\n location?: string;\n operationResult?: string | null;\n}> {\n const result = await _pendingCreateVersionSend(context, name, version, modelVersion, options);\n return _pendingCreateVersionDeserialize(result);\n}\n\nexport function _updateSend(\n context: Client,\n name: string,\n modelVersionUpdate: UpdateModelVersionRequest,\n version: string,\n options: BetaModelsUpdateOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const foundryFeatures = \"Models=V1Preview\";\n const path = expandUrlTemplate(\n \"/models/{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 \"foundry-features\": foundryFeatures,\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: updateModelVersionRequestSerializer(modelVersionUpdate),\n });\n}\n\nexport async function _updateDeserialize(result: PathUncheckedResponse): Promise<ModelVersion> {\n const expectedStatuses = [\"201\", \"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return modelVersionDeserializer(result.body);\n}\n\n/** Updates an existing model version identified by its version ID. */\nexport async function update(\n context: Client,\n name: string,\n modelVersionUpdate: UpdateModelVersionRequest,\n version: string,\n options: BetaModelsUpdateOptionalParams = { requestOptions: {} },\n): Promise<ModelVersion> {\n const result = await _updateSend(context, name, modelVersionUpdate, version, options);\n return _updateDeserialize(result);\n}\n\nexport function _$deleteSend(\n context: Client,\n name: string,\n version: string,\n options: BetaModelsDeleteOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const foundryFeatures = \"Models=V1Preview\";\n const path = expandUrlTemplate(\n \"/models/{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({\n ...operationOptionsToRequestParameters(options),\n headers: { \"foundry-features\": foundryFeatures, ...options.requestOptions?.headers },\n });\n}\n\nexport async function _$deleteDeserialize(result: PathUncheckedResponse): Promise<void> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return;\n}\n\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. */\nexport async function $delete(\n context: Client,\n name: string,\n version: string,\n options: BetaModelsDeleteOptionalParams = { 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: BetaModelsGetOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const foundryFeatures = \"Models=V1Preview\";\n const path = expandUrlTemplate(\n \"/models/{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 \"foundry-features\": foundryFeatures,\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getDeserialize(result: PathUncheckedResponse): Promise<ModelVersion> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return modelVersionDeserializer(result.body);\n}\n\n/** Retrieves the specified model version, returning 404 if it does not exist. */\nexport async function get(\n context: Client,\n name: string,\n version: string,\n options: BetaModelsGetOptionalParams = { requestOptions: {} },\n): Promise<ModelVersion> {\n const result = await _getSend(context, name, version, options);\n return _getDeserialize(result);\n}\n\nexport function _listSend(\n context: Client,\n options: BetaModelsListOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const foundryFeatures = \"Models=V1Preview\";\n const path = expandUrlTemplate(\n \"/models{?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 \"foundry-features\": foundryFeatures,\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listDeserialize(result: PathUncheckedResponse): Promise<_PagedModelVersion> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _pagedModelVersionDeserializer(result.body);\n}\n\n/** List the latest version of each ModelVersion */\nexport function list(\n context: Client,\n options: BetaModelsListOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<ModelVersion> {\n return buildPagedAsyncIterator(\n context,\n () => _listSend(context, options),\n _listDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\", apiVersion: context.apiVersion ?? \"v1\" },\n );\n}\n\nexport function _listVersionsSend(\n context: Client,\n name: string,\n options: BetaModelsListVersionsOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const foundryFeatures = \"Models=V1Preview\";\n const path = expandUrlTemplate(\n \"/models/{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 \"foundry-features\": foundryFeatures,\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listVersionsDeserialize(\n result: PathUncheckedResponse,\n): Promise<_PagedModelVersion> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _pagedModelVersionDeserializer(result.body);\n}\n\n/** List all versions of the given ModelVersion */\nexport function listVersions(\n context: Client,\n name: string,\n options: BetaModelsListVersionsOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<ModelVersion> {\n return buildPagedAsyncIterator(\n context,\n () => _listVersionsSend(context, name, options),\n _listVersionsDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\", apiVersion: context.apiVersion ?? \"v1\" },\n );\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import type { AIProjectContext as Client } from "../../index.js";
2
+ import type { ModelVersion } from "../../../models/models.js";
3
+ import type { BetaModelsCreateFromSourceOptions } from "./options.js";
4
+ export declare function createFromSource(context: Client, name: string, version: string, source: string, options?: BetaModelsCreateFromSourceOptions): Promise<ModelVersion>;
5
+ //# sourceMappingURL=uploads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uploads.d.ts","sourceRoot":"","sources":["../../../../../src/api/beta/models/uploads.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,IAAI,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,cAAc,CAAC;AAgBtE,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,iCAAsC,GAC9C,OAAO,CAAC,YAAY,CAAC,CAgDvB"}
@@ -0,0 +1,63 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import fs from "node:fs";
4
+ import nodePath from "node:path";
5
+ import { BlobServiceClient } from "@azure/storage-blob";
6
+ import { get, pendingCreateVersion, pendingUpload } from "./operations.js";
7
+ function getAllFiles(dir) {
8
+ const results = [];
9
+ for (const entry of fs.readdirSync(dir)) {
10
+ const fullPath = nodePath.join(dir, entry);
11
+ if (fs.statSync(fullPath).isDirectory()) {
12
+ results.push(...getAllFiles(fullPath));
13
+ }
14
+ else {
15
+ results.push(fullPath);
16
+ }
17
+ }
18
+ return results;
19
+ }
20
+ export async function createFromSource(context, name, version, source, options = {}) {
21
+ const pollingTimeout = options.pollingTimeout ?? 300_000;
22
+ const pollingInterval = options.pollingInterval ?? 2_000;
23
+ // Step 1: Get a pending upload SAS URL
24
+ const uploadResponse = await pendingUpload(context, name, version, {
25
+ pendingUploadType: "TemporaryBlobReference",
26
+ });
27
+ // Step 2: Upload local files to the blob container
28
+ const containerClient = new BlobServiceClient(uploadResponse.blobReference.credential.sasUri).getContainerClient("");
29
+ const files = getAllFiles(source);
30
+ for (const filePath of files) {
31
+ const blobName = nodePath.relative(source, filePath).replace(/\\/g, "/");
32
+ const data = fs.readFileSync(filePath);
33
+ const blockBlobClient = containerClient.getBlockBlobClient(blobName);
34
+ await blockBlobClient.upload(data, data.length);
35
+ }
36
+ // Step 3: Trigger async model version creation
37
+ await pendingCreateVersion(context, name, version, {
38
+ blobUri: uploadResponse.blobReference.blobUri,
39
+ weightType: options.weightType,
40
+ baseModel: options.baseModel,
41
+ description: options.description,
42
+ tags: options.tags,
43
+ name,
44
+ version,
45
+ });
46
+ // Step 4: Poll until the model version is available
47
+ const deadline = Date.now() + pollingTimeout;
48
+ while (Date.now() < deadline) {
49
+ try {
50
+ return await get(context, name, version);
51
+ }
52
+ catch (e) {
53
+ if (typeof e === "object" && e !== null && "statusCode" in e && e.statusCode === 404) {
54
+ await new Promise((resolve) => setTimeout(resolve, pollingInterval));
55
+ }
56
+ else {
57
+ throw e;
58
+ }
59
+ }
60
+ }
61
+ throw new Error(`Model version '${name}@${version}' did not become available within ${pollingTimeout}ms.`);
62
+ }
63
+ //# sourceMappingURL=uploads.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uploads.js","sourceRoot":"","sources":["../../../../../src/api/beta/models/uploads.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAIxD,OAAO,EAAE,GAAG,EAAE,oBAAoB,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b,kBAAkB,IAAI,IAAI,OAAO,qCAAqC,cAAc,KAAK,CAC1F,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport fs from \"node:fs\";\nimport nodePath from \"node:path\";\nimport { BlobServiceClient } from \"@azure/storage-blob\";\nimport type { AIProjectContext as Client } from \"../../index.js\";\nimport type { ModelVersion } from \"../../../models/models.js\";\nimport type { BetaModelsCreateFromSourceOptions } from \"./options.js\";\nimport { get, pendingCreateVersion, pendingUpload } from \"./operations.js\";\n\nfunction getAllFiles(dir: string): string[] {\n const results: string[] = [];\n for (const entry of fs.readdirSync(dir)) {\n const fullPath = nodePath.join(dir, entry);\n if (fs.statSync(fullPath).isDirectory()) {\n results.push(...getAllFiles(fullPath));\n } else {\n results.push(fullPath);\n }\n }\n return results;\n}\n\nexport async function createFromSource(\n context: Client,\n name: string,\n version: string,\n source: string,\n options: BetaModelsCreateFromSourceOptions = {},\n): Promise<ModelVersion> {\n const pollingTimeout = options.pollingTimeout ?? 300_000;\n const pollingInterval = options.pollingInterval ?? 2_000;\n\n // Step 1: Get a pending upload SAS URL\n const uploadResponse = await pendingUpload(context, name, version, {\n pendingUploadType: \"TemporaryBlobReference\",\n });\n\n // Step 2: Upload local files to the blob container\n const containerClient = new BlobServiceClient(\n uploadResponse.blobReference.credential.sasUri,\n ).getContainerClient(\"\");\n const files = getAllFiles(source);\n for (const filePath of files) {\n const blobName = nodePath.relative(source, filePath).replace(/\\\\/g, \"/\");\n const data = fs.readFileSync(filePath);\n const blockBlobClient = containerClient.getBlockBlobClient(blobName);\n await blockBlobClient.upload(data, data.length);\n }\n\n // Step 3: Trigger async model version creation\n await pendingCreateVersion(context, name, version, {\n blobUri: uploadResponse.blobReference.blobUri,\n weightType: options.weightType,\n baseModel: options.baseModel,\n description: options.description,\n tags: options.tags,\n name,\n version,\n });\n\n // Step 4: Poll until the model version is available\n const deadline = Date.now() + pollingTimeout;\n while (Date.now() < deadline) {\n try {\n return await get(context, name, version);\n } catch (e: unknown) {\n if (typeof e === \"object\" && e !== null && \"statusCode\" in e && e.statusCode === 404) {\n await new Promise((resolve) => setTimeout(resolve, pollingInterval));\n } else {\n throw e;\n }\n }\n }\n throw new Error(\n `Model version '${name}@${version}' did not become available within ${pollingTimeout}ms.`,\n );\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { DatasetUploadInternalOptions, AIProjectContext as Client } from "../index.js";
1
+ import type { AIProjectContext as Client } from "../index.js";
2
2
  import type { _PagedDatasetVersion, DatasetVersionUnion, PendingUploadRequest, PendingUploadResponse, DatasetCredential } from "../../models/models.js";
3
3
  import type { PagedAsyncIterableIterator } from "@azure/core-paging";
4
4
  import type { DatasetsGetCredentialsOptionalParams, DatasetsPendingUploadOptionalParams, DatasetsCreateOrUpdateOptionalParams, DatasetsDeleteOptionalParams, DatasetsGetOptionalParams, DatasetsListOptionalParams, DatasetsListVersionsOptionalParams } from "./options.js";
@@ -31,6 +31,4 @@ export declare function _listVersionsSend(context: Client, name: string, options
31
31
  export declare function _listVersionsDeserialize(result: PathUncheckedResponse): Promise<_PagedDatasetVersion>;
32
32
  /** List all versions of the given DatasetVersion */
33
33
  export declare function listVersions(context: Client, name: string, options?: DatasetsListVersionsOptionalParams): PagedAsyncIterableIterator<DatasetVersionUnion>;
34
- export declare function uploadFile(context: Client, name: string, version: string, filePath: string, options?: DatasetUploadInternalOptions): Promise<DatasetVersionUnion>;
35
- export declare function uploadFolder(context: Client, name: string, version: string, folderPath: string, options?: DatasetUploadInternalOptions): Promise<DatasetVersionUnion>;
36
34
  //# sourceMappingURL=operations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../src/api/datasets/operations.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,4BAA4B,EAAE,gBAAgB,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAC5F,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EACn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B,SAAS,CACvB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,0BAAmD,GAC3D,gBAAgB,CAiBlB;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,oBAAoB,CAAC,CAO/B;AAED,qDAAqD;AACrD,wBAAgB,IAAI,CAClB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,0BAAmD,GAC3D,0BAA0B,CAAC,mBAAmB,CAAC,CAQjD;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,kCAA2D,GACnE,gBAAgB,CAkBlB;AAED,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,oBAAoB,CAAC,CAO/B;AAED,oDAAoD;AACpD,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,kCAA2D,GACnE,0BAA0B,CAAC,mBAAmB,CAAC,CAQjD"}
@@ -1,13 +1,9 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import fs from "node:fs";
4
- import nodePath from "node:path";
5
3
  import { _pagedDatasetVersionDeserializer, datasetVersionUnionSerializer, datasetVersionUnionDeserializer, pendingUploadRequestSerializer, pendingUploadResponseDeserializer, datasetCredentialDeserializer, } from "../../models/models.js";
6
4
  import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js";
7
5
  import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js";
8
6
  import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client";
9
- import { ContainerClient } from "@azure/storage-blob";
10
- import { logger } from "../../logger.js";
11
7
  export function _getCredentialsSend(context, name, version, options = { requestOptions: {} }) {
12
8
  const path = expandUrlTemplate("/datasets/{name}/versions/{version}/credentials{?api-version}", {
13
9
  name: name,
@@ -197,129 +193,4 @@ export async function _listVersionsDeserialize(result) {
197
193
  export function listVersions(context, name, options = { requestOptions: {} }) {
198
194
  return buildPagedAsyncIterator(context, () => _listVersionsSend(context, name, options), _listVersionsDeserialize, ["200"], { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion });
199
195
  }
200
- // Internal helper method to create a new dataset and return a ContainerClient from azure-storage-blob package, to the dataset's blob storage.
201
- async function createDatasetAndGetItsContainer(context, name, version, options) {
202
- const { connectionName, projectOptions = {} } = options || {};
203
- // Start a pending upload to get the container URL with SAS token
204
- const pendingUploadResponse = await pendingUpload(context, name, version, {
205
- pendingUploadType: "BlobReference",
206
- connectionName,
207
- });
208
- const blobReference = pendingUploadResponse.blobReference;
209
- // Validate the response
210
- if (!blobReference) {
211
- throw new Error("Blob reference for consumption is not present");
212
- }
213
- if (!blobReference.credential?.type) {
214
- throw new Error("Credential type is not present");
215
- }
216
- if (blobReference.credential.type !== "SAS") {
217
- throw new Error("Credential type is not SAS");
218
- }
219
- if (!blobReference.blobUri) {
220
- throw new Error("Blob URI is not present or empty");
221
- }
222
- // Log metadata only; upload URLs can contain credentials.
223
- logger.verbose(`[createDatasetAndGetItsContainer] pendingUploadResponse.pendingUploadId = ${pendingUploadResponse.pendingUploadId}`);
224
- logger.verbose(`[createDatasetAndGetItsContainer] pendingUploadResponse.pendingUploadType = ${pendingUploadResponse.pendingUploadType}`);
225
- logger.verbose(`[createDatasetAndGetItsContainer] blobReference.storageAccountArmId = ${blobReference.storageAccountArmId}`);
226
- logger.verbose(`[createDatasetAndGetItsContainer] blobReference.credential.type = ${blobReference.credential.type}`);
227
- // Create container client from the blob URI (which includes the SAS token)
228
- const containerClient = new ContainerClient(blobReference.credential.sasUri);
229
- const pipeline = containerClient["storageClientContext"].pipeline;
230
- for (const { policy } of projectOptions.additionalPolicies ?? []) {
231
- pipeline.addPolicy(policy, { afterPhase: "Sign" });
232
- }
233
- return {
234
- containerClient,
235
- version,
236
- };
237
- }
238
- export async function uploadFile(context, name, version, filePath, options) {
239
- // if file does not exist
240
- const fileExists = fs.existsSync(filePath);
241
- if (!fileExists) {
242
- throw new Error(`File does not exist at path: ${filePath}`);
243
- }
244
- // Check if the file is a directory
245
- const isDirectory = fs.lstatSync(filePath).isDirectory();
246
- if (isDirectory) {
247
- throw new Error(`The provided file is actually a folder. Use method uploadFolder instead`);
248
- }
249
- const { containerClient, version: outputVersion } = await createDatasetAndGetItsContainer(context, name, version, options);
250
- // file name as blob name
251
- const blobName = nodePath.basename(filePath);
252
- const blockBlobClient = containerClient.getBlockBlobClient(blobName);
253
- await blockBlobClient.uploadStream(fs.createReadStream(filePath));
254
- const datasetVersion = await createOrUpdate(context, name, outputVersion, {
255
- name: name,
256
- version: outputVersion,
257
- type: "uri_file",
258
- dataUri: blockBlobClient.url,
259
- });
260
- return datasetVersion;
261
- }
262
- export async function uploadFolder(context, name, version, folderPath, options) {
263
- // Check if the folder exists
264
- const folderExists = fs.existsSync(folderPath);
265
- if (!folderExists) {
266
- throw new Error(`Folder does not exist at path: ${folderPath}`);
267
- }
268
- // Check if the folder is a file
269
- const isFile = fs.lstatSync(folderPath).isFile();
270
- if (isFile) {
271
- throw new Error(`The provided path is actually a file. Use method uploadFile instead`);
272
- }
273
- const { containerClient, version: outputVersion } = await createDatasetAndGetItsContainer(context, name, version, options);
274
- // Helper function to recursively get all files in a directory
275
- async function getAllFiles(dir, fileList = []) {
276
- const files = await fs.promises.readdir(dir);
277
- for (const file of files) {
278
- const filePath = `${dir}/${file}`;
279
- const stat = await fs.promises.lstat(filePath);
280
- if (stat.isDirectory()) {
281
- await getAllFiles(filePath, fileList);
282
- }
283
- else {
284
- fileList.push(filePath);
285
- }
286
- }
287
- return fileList;
288
- }
289
- // Get all files in the folder
290
- const allFiles = await getAllFiles(folderPath);
291
- let filteredFiles = allFiles;
292
- if (options?.filePattern) {
293
- try {
294
- const filePattern = new RegExp(options.filePattern);
295
- filteredFiles = allFiles.filter((file) => filePattern.test(file));
296
- }
297
- catch {
298
- // If regex pattern is invalid, ignore the pattern and upload all files
299
- }
300
- }
301
- if (filteredFiles.length === 0) {
302
- throw new Error("The provided folder is empty.");
303
- }
304
- // Upload each file to blob storage while maintaining relative paths
305
- for (const filePath of filteredFiles) {
306
- // Create blob name as relative path from the base folder
307
- const relativePath = nodePath.relative(folderPath, filePath).split(nodePath.sep).join("/");
308
- logger.verbose(`[uploadFolderAndCreate] Start uploading file '${filePath}' as blob '${relativePath}'`);
309
- // Get a block blob client for the relative path
310
- const blobClient = containerClient.getBlockBlobClient(relativePath);
311
- // Upload the file using a readable stream for better performance
312
- const fileStream = fs.createReadStream(filePath);
313
- await blobClient.uploadStream(fileStream);
314
- logger.verbose(`[uploadFolderAndCreate] Done uploading file '${filePath}' as blob '${relativePath}'`);
315
- }
316
- // Create dataset version that references this folder
317
- const datasetVersion = await createOrUpdate(context, name, outputVersion, {
318
- name: name,
319
- version: outputVersion,
320
- type: "uri_folder",
321
- dataUri: containerClient.url,
322
- });
323
- return datasetVersion;
324
- }
325
196
  //# sourceMappingURL=operations.js.map