@azure/data-tables 13.3.1-alpha.20250606.1 → 13.3.1-alpha.20250609.2

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 (77) hide show
  1. package/dist/browser/sas/accountSasPermissions.d.ts +1 -1
  2. package/dist/browser/sas/accountSasPermissions.js +2 -2
  3. package/dist/browser/sas/accountSasPermissions.js.map +1 -1
  4. package/dist/browser/sas/accountSasResourceTypes.d.ts +1 -1
  5. package/dist/browser/sas/accountSasResourceTypes.js +1 -1
  6. package/dist/browser/sas/accountSasResourceTypes.js.map +1 -1
  7. package/dist/browser/sas/accountSasSignatureValues.d.ts +1 -1
  8. package/dist/browser/sas/accountSasSignatureValues.js +1 -1
  9. package/dist/browser/sas/accountSasSignatureValues.js.map +1 -1
  10. package/dist/browser/sas/generateAccountSas.d.ts +1 -1
  11. package/dist/browser/sas/generateAccountSas.js +1 -1
  12. package/dist/browser/sas/generateAccountSas.js.map +1 -1
  13. package/dist/browser/sas/generateTableSas.d.ts +1 -1
  14. package/dist/browser/sas/generateTableSas.js +1 -1
  15. package/dist/browser/sas/generateTableSas.js.map +1 -1
  16. package/dist/browser/sas/sasQueryParameters.d.ts +1 -1
  17. package/dist/browser/sas/sasQueryParameters.js.map +1 -1
  18. package/dist/browser/sas/tableSasSignatureValues.d.ts +1 -1
  19. package/dist/browser/sas/tableSasSignatureValues.js.map +1 -1
  20. package/dist/commonjs/sas/accountSasPermissions.d.ts +1 -1
  21. package/dist/commonjs/sas/accountSasPermissions.js +2 -2
  22. package/dist/commonjs/sas/accountSasPermissions.js.map +1 -1
  23. package/dist/commonjs/sas/accountSasResourceTypes.d.ts +1 -1
  24. package/dist/commonjs/sas/accountSasResourceTypes.js +1 -1
  25. package/dist/commonjs/sas/accountSasResourceTypes.js.map +1 -1
  26. package/dist/commonjs/sas/accountSasSignatureValues.d.ts +1 -1
  27. package/dist/commonjs/sas/accountSasSignatureValues.js +1 -1
  28. package/dist/commonjs/sas/accountSasSignatureValues.js.map +1 -1
  29. package/dist/commonjs/sas/generateAccountSas.d.ts +1 -1
  30. package/dist/commonjs/sas/generateAccountSas.js +1 -1
  31. package/dist/commonjs/sas/generateAccountSas.js.map +1 -1
  32. package/dist/commonjs/sas/generateTableSas.d.ts +1 -1
  33. package/dist/commonjs/sas/generateTableSas.js +1 -1
  34. package/dist/commonjs/sas/generateTableSas.js.map +1 -1
  35. package/dist/commonjs/sas/sasQueryParameters.d.ts +1 -1
  36. package/dist/commonjs/sas/sasQueryParameters.js.map +1 -1
  37. package/dist/commonjs/sas/tableSasSignatureValues.d.ts +1 -1
  38. package/dist/commonjs/sas/tableSasSignatureValues.js.map +1 -1
  39. package/dist/esm/sas/accountSasPermissions.d.ts +1 -1
  40. package/dist/esm/sas/accountSasPermissions.js +2 -2
  41. package/dist/esm/sas/accountSasPermissions.js.map +1 -1
  42. package/dist/esm/sas/accountSasResourceTypes.d.ts +1 -1
  43. package/dist/esm/sas/accountSasResourceTypes.js +1 -1
  44. package/dist/esm/sas/accountSasResourceTypes.js.map +1 -1
  45. package/dist/esm/sas/accountSasSignatureValues.d.ts +1 -1
  46. package/dist/esm/sas/accountSasSignatureValues.js +1 -1
  47. package/dist/esm/sas/accountSasSignatureValues.js.map +1 -1
  48. package/dist/esm/sas/generateAccountSas.d.ts +1 -1
  49. package/dist/esm/sas/generateAccountSas.js +1 -1
  50. package/dist/esm/sas/generateAccountSas.js.map +1 -1
  51. package/dist/esm/sas/generateTableSas.d.ts +1 -1
  52. package/dist/esm/sas/generateTableSas.js +1 -1
  53. package/dist/esm/sas/generateTableSas.js.map +1 -1
  54. package/dist/esm/sas/sasQueryParameters.d.ts +1 -1
  55. package/dist/esm/sas/sasQueryParameters.js.map +1 -1
  56. package/dist/esm/sas/tableSasSignatureValues.d.ts +1 -1
  57. package/dist/esm/sas/tableSasSignatureValues.js.map +1 -1
  58. package/dist/react-native/sas/accountSasPermissions.d.ts +1 -1
  59. package/dist/react-native/sas/accountSasPermissions.js +2 -2
  60. package/dist/react-native/sas/accountSasPermissions.js.map +1 -1
  61. package/dist/react-native/sas/accountSasResourceTypes.d.ts +1 -1
  62. package/dist/react-native/sas/accountSasResourceTypes.js +1 -1
  63. package/dist/react-native/sas/accountSasResourceTypes.js.map +1 -1
  64. package/dist/react-native/sas/accountSasSignatureValues.d.ts +1 -1
  65. package/dist/react-native/sas/accountSasSignatureValues.js +1 -1
  66. package/dist/react-native/sas/accountSasSignatureValues.js.map +1 -1
  67. package/dist/react-native/sas/generateAccountSas.d.ts +1 -1
  68. package/dist/react-native/sas/generateAccountSas.js +1 -1
  69. package/dist/react-native/sas/generateAccountSas.js.map +1 -1
  70. package/dist/react-native/sas/generateTableSas.d.ts +1 -1
  71. package/dist/react-native/sas/generateTableSas.js +1 -1
  72. package/dist/react-native/sas/generateTableSas.js.map +1 -1
  73. package/dist/react-native/sas/sasQueryParameters.d.ts +1 -1
  74. package/dist/react-native/sas/sasQueryParameters.js.map +1 -1
  75. package/dist/react-native/sas/tableSasSignatureValues.d.ts +1 -1
  76. package/dist/react-native/sas/tableSasSignatureValues.js.map +1 -1
  77. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"tableSasSignatureValues.js","sourceRoot":"","sources":["../../../src/sas/tableSasSignatureValues.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AA8EvE;;;;;;GAMG;AACH,MAAM,UAAU,+BAA+B,CAC7C,SAAiB,EACjB,UAA8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C,SAAS,mCAAI,EAAE,CAAC;IAE7D,MAAM,YAAY,GAAG;QACnB,iBAAiB;QACjB,WAAW;QACX,YAAY;QACZ,qBAAqB;QACrB,gBAAgB;QAChB,QAAQ;QACR,cAAc;QACd,OAAO;QACP,oBAAoB;QACpB,cAAc;QACd,kBAAkB;QAClB,YAAY;KACb,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,MAAM,SAAS,GAAG,iBAAiB,CAAC,YAAY,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;IAElE,OAAO,IAAI,kBAAkB,CAAC,OAAO,EAAE,SAAS,EAAE;QAChD,WAAW,EAAE,iBAAiB;QAC9B,QAAQ,EAAE,uBAAuB,CAAC,QAAQ;QAC1C,QAAQ,EAAE,uBAAuB,CAAC,QAAQ;QAC1C,SAAS,EAAE,uBAAuB,CAAC,SAAS;QAC5C,OAAO,EAAE,uBAAuB,CAAC,OAAO;QACxC,UAAU,EAAE,uBAAuB,CAAC,UAAU;QAC9C,SAAS;QACT,iBAAiB,EAAE,uBAAuB,CAAC,iBAAiB;QAC5D,WAAW,EAAE,uBAAuB,CAAC,WAAW;QAChD,eAAe,EAAE,uBAAuB,CAAC,eAAe;QACxD,SAAS,EAAE,uBAAuB,CAAC,SAAS;KAC7C,CAAC,CAAC;AACL,CAAC;AAED,SAAS,gBAAgB,CAAC,WAAmB,EAAE,SAAiB;IAC9D,yHAAyH;IACzH,yDAAyD;IACzD,OAAO,UAAU,WAAW,IAAI,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC;AAC5D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * TableSASSignatureValues is used to help generating SAS tokens for tables.\n */\n\nimport type { SasIPRange } from \"./sasIPRange.js\";\nimport { ipRangeToString } from \"./sasIPRange.js\";\nimport type { SasProtocol } from \"./sasQueryParameters.js\";\nimport { SasQueryParameters } from \"./sasQueryParameters.js\";\nimport type { TableSasPermissions } from \"./tableSasPermisions.js\";\nimport { tableSasPermissionsToString } from \"./tableSasPermisions.js\";\nimport type { NamedKeyCredential } from \"@azure/core-auth\";\nimport { SERVICE_VERSION } from \"../utils/constants.js\";\nimport { computeHMACSHA256 } from \"../utils/computeHMACSHA256.js\";\nimport { truncatedISO8061Date } from \"../utils/truncateISO8061Date.js\";\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * TableSASSignatureValues is used to help generating Table service SAS tokens for tables\n */\nexport interface TableSasSignatureValues {\n /**\n * The version of the service this SAS will target. If not specified, it will default to the version targeted by the\n * library.\n */\n version?: string;\n\n /**\n * Optional. SAS protocols, HTTPS only or HTTPSandHTTP\n */\n protocol?: SasProtocol;\n\n /**\n * Optional. When the SAS will take effect.\n */\n startsOn?: Date;\n\n /**\n * Optional. If identifier is not provided has a default value of one hour from the time the token is generated.\n * The time after which the SAS will no longer work.\n */\n expiresOn?: Date;\n\n /**\n * Optional. If identifier is not provided has a default value of \"read\"\n * Please refer to {@link TableSasPermissions} depending on the resource\n * being accessed for help constructing the permissions string.\n */\n permissions?: TableSasPermissions;\n /**\n * Optional. IP ranges allowed in this SAS.\n */\n ipRange?: SasIPRange;\n\n /**\n * Optional. The name of the access policy on the container this SAS references if any.\n *\n * @see https://learn.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy\n */\n identifier?: string;\n\n /**\n * Define the start of a Partition Key range\n * Table queries will only return results that are within the range, and attempts to use the shared access signature to add, update, or delete entities outside this range will fail.\n * If startPartitionKey equals endPartitionKey the shared access signature only authorizes access to entities in one partition in the table.\n * If startPartitionKey equals endPartitionKey and startRowKey equals endRowKey, the shared access signature can only access one entity in one partition\n */\n startPartitionKey?: string;\n /**\n * Define the end of a Partition Key range\n * Table queries will only return results that are within the range, and attempts to use the shared access signature to add, update, or delete entities outside this range will fail.\n * If startPartitionKey equals endPartitionKey the shared access signature only authorizes access to entities in one partition in the table.\n * If startPartitionKey equals endPartitionKey and startRowKey equals endRowKey, the shared access signature can only access one entity in one partition\n */\n endPartitionKey?: string;\n /**\n * Define the start of a Row Key range\n * Table queries will only return results that are within the range, and attempts to use the shared access signature to add, update, or delete entities outside this range will fail.\n * If startPartitionKey equals endPartitionKey the shared access signature only authorizes access to entities in one partition in the table.\n * If startPartitionKey equals endPartitionKey and startRowKey equals endRowKey, the shared access signature can only access one entity in one partition\n */\n startRowKey?: string;\n /**\n * Define the end of a Row Key range\n * Table queries will only return results that are within the range, and attempts to use the shared access signature to add, update, or delete entities outside this range will fail.\n * If startPartitionKey equals endPartitionKey the shared access signature only authorizes access to entities in one partition in the table.\n * If startPartitionKey equals endPartitionKey and startRowKey equals endRowKey, the shared access signature can only access one entity in one partition\n */\n endRowKey?: string;\n}\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Creates an instance of SASQueryParameters.\n *\n * **Note**: When identifier is not provided, permissions has a default value of \"read\" and expiresOn of one hour from the time the token is generated.\n */\nexport function generateTableSasQueryParameters(\n tableName: string,\n credential: NamedKeyCredential,\n tableSasSignatureValues: TableSasSignatureValues,\n): SasQueryParameters {\n const version = tableSasSignatureValues.version ?? SERVICE_VERSION;\n\n if (credential === undefined) {\n throw TypeError(\"Invalid NamedKeyCredential\");\n }\n\n if (!tableName) {\n throw new Error(\"Must provide a 'tableName'\");\n }\n\n const signedPermissions = tableSasPermissionsToString(tableSasSignatureValues.permissions);\n const signedStart = tableSasSignatureValues.startsOn\n ? truncatedISO8061Date(tableSasSignatureValues.startsOn, false /** withMilliseconds */)\n : \"\";\n const signedExpiry = tableSasSignatureValues.expiresOn\n ? truncatedISO8061Date(tableSasSignatureValues.expiresOn, false /** withMilliseconds */)\n : \"\";\n const canonicalizedResource = getCanonicalName(credential.name, tableName);\n const signedIdentifier = tableSasSignatureValues.identifier ?? \"\";\n const signedIP = ipRangeToString(tableSasSignatureValues.ipRange);\n const signedProtocol = tableSasSignatureValues.protocol || \"\";\n const startingPartitionKey = tableSasSignatureValues.startPartitionKey ?? \"\";\n const startingRowKey = tableSasSignatureValues.startRowKey ?? \"\";\n const endingPartitionKey = tableSasSignatureValues.endPartitionKey ?? \"\";\n const endingRowKey = tableSasSignatureValues.endRowKey ?? \"\";\n\n const stringToSign = [\n signedPermissions,\n signedStart,\n signedExpiry,\n canonicalizedResource,\n signedIdentifier,\n signedIP,\n signedProtocol,\n version,\n startingPartitionKey,\n startingRowKey,\n endingPartitionKey,\n endingRowKey,\n ].join(\"\\n\");\n\n const signature = computeHMACSHA256(stringToSign, credential.key);\n\n return new SasQueryParameters(version, signature, {\n permissions: signedPermissions,\n protocol: tableSasSignatureValues.protocol,\n startsOn: tableSasSignatureValues.startsOn,\n expiresOn: tableSasSignatureValues.expiresOn,\n ipRange: tableSasSignatureValues.ipRange,\n identifier: tableSasSignatureValues.identifier,\n tableName,\n startPartitionKey: tableSasSignatureValues.startPartitionKey,\n startRowKey: tableSasSignatureValues.startRowKey,\n endPartitionKey: tableSasSignatureValues.endPartitionKey,\n endRowKey: tableSasSignatureValues.endRowKey,\n });\n}\n\nfunction getCanonicalName(accountName: string, tableName: string): string {\n // Sample CanonicalName for URL = https://myaccount.table.core.windows.net/Employees(PartitionKey='Jeff',RowKey='Price'):\n // canonicalizedResource = \"/table/myaccount/employees\"\n return `/table/${accountName}/${tableName.toLowerCase()}`;\n}\n"]}
1
+ {"version":3,"file":"tableSasSignatureValues.js","sourceRoot":"","sources":["../../../src/sas/tableSasSignatureValues.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AA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,CAAC;IACjE,MAAM,kBAAkB,GAAG,MAAA,uBAAuB,CAAC,eAAe,mCAAI,EAAE,CAAC;IACzE,MAAM,YAAY,GAAG,MAAA,uBAAuB,CAAC,SAAS,mCAAI,EAAE,CAAC;IAE7D,MAAM,YAAY,GAAG;QACnB,iBAAiB;QACjB,WAAW;QACX,YAAY;QACZ,qBAAqB;QACrB,gBAAgB;QAChB,QAAQ;QACR,cAAc;QACd,OAAO;QACP,oBAAoB;QACpB,cAAc;QACd,kBAAkB;QAClB,YAAY;KACb,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,MAAM,SAAS,GAAG,iBAAiB,CAAC,YAAY,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;IAElE,OAAO,IAAI,kBAAkB,CAAC,OAAO,EAAE,SAAS,EAAE;QAChD,WAAW,EAAE,iBAAiB;QAC9B,QAAQ,EAAE,uBAAuB,CAAC,QAAQ;QAC1C,QAAQ,EAAE,uBAAuB,CAAC,QAAQ;QAC1C,SAAS,EAAE,uBAAuB,CAAC,SAAS;QAC5C,OAAO,EAAE,uBAAuB,CAAC,OAAO;QACxC,UAAU,EAAE,uBAAuB,CAAC,UAAU;QAC9C,SAAS;QACT,iBAAiB,EAAE,uBAAuB,CAAC,iBAAiB;QAC5D,WAAW,EAAE,uBAAuB,CAAC,WAAW;QAChD,eAAe,EAAE,uBAAuB,CAAC,eAAe;QACxD,SAAS,EAAE,uBAAuB,CAAC,SAAS;KAC7C,CAAC,CAAC;AACL,CAAC;AAED,SAAS,gBAAgB,CAAC,WAAmB,EAAE,SAAiB;IAC9D,yHAAyH;IACzH,yDAAyD;IACzD,OAAO,UAAU,WAAW,IAAI,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC;AAC5D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * TableSASSignatureValues is used to help generating SAS tokens for tables.\n */\n\nimport type { SasIPRange } from \"./sasIPRange.js\";\nimport { ipRangeToString } from \"./sasIPRange.js\";\nimport type { SasProtocol } from \"./sasQueryParameters.js\";\nimport { SasQueryParameters } from \"./sasQueryParameters.js\";\nimport type { TableSasPermissions } from \"./tableSasPermisions.js\";\nimport { tableSasPermissionsToString } from \"./tableSasPermisions.js\";\nimport type { NamedKeyCredential } from \"@azure/core-auth\";\nimport { SERVICE_VERSION } from \"../utils/constants.js\";\nimport { computeHMACSHA256 } from \"../utils/computeHMACSHA256.js\";\nimport { truncatedISO8061Date } from \"../utils/truncateISO8061Date.js\";\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * TableSASSignatureValues is used to help generating Table service SAS tokens for tables\n */\nexport interface TableSasSignatureValues {\n /**\n * The version of the service this SAS will target. If not specified, it will default to the version targeted by the\n * library.\n */\n version?: string;\n\n /**\n * Optional. SAS protocols, HTTPS only or HTTPSandHTTP\n */\n protocol?: SasProtocol;\n\n /**\n * Optional. When the SAS will take effect.\n */\n startsOn?: Date;\n\n /**\n * Optional. If identifier is not provided has a default value of one hour from the time the token is generated.\n * The time after which the SAS will no longer work.\n */\n expiresOn?: Date;\n\n /**\n * Optional. If identifier is not provided has a default value of \"read\"\n * Please refer to {@link TableSasPermissions} depending on the resource\n * being accessed for help constructing the permissions string.\n */\n permissions?: TableSasPermissions;\n /**\n * Optional. IP ranges allowed in this SAS.\n */\n ipRange?: SasIPRange;\n\n /**\n * Optional. The name of the access policy on the container this SAS references if any.\n *\n * @see https://learn.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy\n */\n identifier?: string;\n\n /**\n * Define the start of a Partition Key range\n * Table queries will only return results that are within the range, and attempts to use the shared access signature to add, update, or delete entities outside this range will fail.\n * If startPartitionKey equals endPartitionKey the shared access signature only authorizes access to entities in one partition in the table.\n * If startPartitionKey equals endPartitionKey and startRowKey equals endRowKey, the shared access signature can only access one entity in one partition\n */\n startPartitionKey?: string;\n /**\n * Define the end of a Partition Key range\n * Table queries will only return results that are within the range, and attempts to use the shared access signature to add, update, or delete entities outside this range will fail.\n * If startPartitionKey equals endPartitionKey the shared access signature only authorizes access to entities in one partition in the table.\n * If startPartitionKey equals endPartitionKey and startRowKey equals endRowKey, the shared access signature can only access one entity in one partition\n */\n endPartitionKey?: string;\n /**\n * Define the start of a Row Key range\n * Table queries will only return results that are within the range, and attempts to use the shared access signature to add, update, or delete entities outside this range will fail.\n * If startPartitionKey equals endPartitionKey the shared access signature only authorizes access to entities in one partition in the table.\n * If startPartitionKey equals endPartitionKey and startRowKey equals endRowKey, the shared access signature can only access one entity in one partition\n */\n startRowKey?: string;\n /**\n * Define the end of a Row Key range\n * Table queries will only return results that are within the range, and attempts to use the shared access signature to add, update, or delete entities outside this range will fail.\n * If startPartitionKey equals endPartitionKey the shared access signature only authorizes access to entities in one partition in the table.\n * If startPartitionKey equals endPartitionKey and startRowKey equals endRowKey, the shared access signature can only access one entity in one partition\n */\n endRowKey?: string;\n}\n\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Creates an instance of SASQueryParameters.\n *\n * **Note**: When identifier is not provided, permissions has a default value of \"read\" and expiresOn of one hour from the time the token is generated.\n */\nexport function generateTableSasQueryParameters(\n tableName: string,\n credential: NamedKeyCredential,\n tableSasSignatureValues: TableSasSignatureValues,\n): SasQueryParameters {\n const version = tableSasSignatureValues.version ?? SERVICE_VERSION;\n\n if (credential === undefined) {\n throw TypeError(\"Invalid NamedKeyCredential\");\n }\n\n if (!tableName) {\n throw new Error(\"Must provide a 'tableName'\");\n }\n\n const signedPermissions = tableSasPermissionsToString(tableSasSignatureValues.permissions);\n const signedStart = tableSasSignatureValues.startsOn\n ? truncatedISO8061Date(tableSasSignatureValues.startsOn, false /** withMilliseconds */)\n : \"\";\n const signedExpiry = tableSasSignatureValues.expiresOn\n ? truncatedISO8061Date(tableSasSignatureValues.expiresOn, false /** withMilliseconds */)\n : \"\";\n const canonicalizedResource = getCanonicalName(credential.name, tableName);\n const signedIdentifier = tableSasSignatureValues.identifier ?? \"\";\n const signedIP = ipRangeToString(tableSasSignatureValues.ipRange);\n const signedProtocol = tableSasSignatureValues.protocol || \"\";\n const startingPartitionKey = tableSasSignatureValues.startPartitionKey ?? \"\";\n const startingRowKey = tableSasSignatureValues.startRowKey ?? \"\";\n const endingPartitionKey = tableSasSignatureValues.endPartitionKey ?? \"\";\n const endingRowKey = tableSasSignatureValues.endRowKey ?? \"\";\n\n const stringToSign = [\n signedPermissions,\n signedStart,\n signedExpiry,\n canonicalizedResource,\n signedIdentifier,\n signedIP,\n signedProtocol,\n version,\n startingPartitionKey,\n startingRowKey,\n endingPartitionKey,\n endingRowKey,\n ].join(\"\\n\");\n\n const signature = computeHMACSHA256(stringToSign, credential.key);\n\n return new SasQueryParameters(version, signature, {\n permissions: signedPermissions,\n protocol: tableSasSignatureValues.protocol,\n startsOn: tableSasSignatureValues.startsOn,\n expiresOn: tableSasSignatureValues.expiresOn,\n ipRange: tableSasSignatureValues.ipRange,\n identifier: tableSasSignatureValues.identifier,\n tableName,\n startPartitionKey: tableSasSignatureValues.startPartitionKey,\n startRowKey: tableSasSignatureValues.startRowKey,\n endPartitionKey: tableSasSignatureValues.endPartitionKey,\n endRowKey: tableSasSignatureValues.endRowKey,\n });\n}\n\nfunction getCanonicalName(accountName: string, tableName: string): string {\n // Sample CanonicalName for URL = https://myaccount.table.core.windows.net/Employees(PartitionKey='Jeff',RowKey='Price'):\n // canonicalizedResource = \"/table/myaccount/employees\"\n return `/table/${accountName}/${tableName.toLowerCase()}`;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure/data-tables",
3
- "version": "13.3.1-alpha.20250606.1",
3
+ "version": "13.3.1-alpha.20250609.2",
4
4
  "description": "An isomorphic client library for the Azure Tables service.",
5
5
  "sdk-type": "client",
6
6
  "main": "./dist/commonjs/index.js",