Socket
Socket
Sign inDemoInstall

dynamics-web-api

Package Overview
Dependencies
6
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0-beta.3 to 2.0.0-beta.4

26

dist/dynamics-web-api.d.ts

@@ -1,2 +0,2 @@

/*! dynamics-web-api v2.0.0-beta.3 (c) 2023 Aleksandr Rogov */
/*! dynamics-web-api v2.0.0-beta.4 (c) 2023 Aleksandr Rogov */
/// <reference types="node" />

@@ -318,5 +318,5 @@ /**

/**
* Retrieves CSDL Document Metadata
* Retrieves a CSDL Document Metadata
* @param request - An object that represents all possible options for a current request.
* @returns {Promise<string>} Unformatted and unparsed CSDL $metadata document.
* @returns {Promise<string>} A raw CSDL $metadata document.
*/

@@ -403,2 +403,3 @@ retrieveCsdlMetadata: (request?: CsdlMetadataRequest) => Promise<string>;

export interface BatchRequest extends BaseRequest {
/** Sets Prefer header to "odata.continue-on-error" that allows more requests be processed when errors occur. The batch request will return '200 OK' and individual response errors will be returned in the batch response body. */
continueOnError?: boolean;

@@ -435,3 +436,3 @@ }

export interface CreateRequest<T = any> extends CRUDRequest {
/**v.1.7.5+ If set to true, the request bypasses custom business logic, all synchronous plug-ins and real-time workflows are disabled. Check for special exceptions in Microsft Docs. */
/**If set to true, the request bypasses custom business logic, all synchronous plug-ins and real-time workflows are disabled. Check for special exceptions in Microsft Docs. */
bypassCustomPluginExecution?: boolean;

@@ -456,7 +457,7 @@ /**Web API v9+ only! Boolean that enables duplicate detection. */

contentId?: string;
/**v.1.7.7+ A unique partition key value of a logical partition for non-relational custom entity data stored in NoSql tables of Azure heterogenous storage. */
/**A unique partition key value of a logical partition for non-relational custom entity data stored in NoSql tables of Azure heterogenous storage. */
partitionId?: string;
}
export interface UpdateRequestBase<T = any> extends CRUDRequest {
/**v.1.7.5+ If set to true, the request bypasses custom business logic, all synchronous plug-ins and real-time workflows are disabled. Check for special exceptions in Microsft Docs. */
/**If set to true, the request bypasses custom business logic, all synchronous plug-ins and real-time workflows are disabled. Check for special exceptions in Microsft Docs. */
bypassCustomPluginExecution?: boolean;

@@ -485,3 +486,3 @@ /**Web API v9+ only! Boolean that enables duplicate detection. */

navigationPropertyKey?: string;
/**v.1.7.7+ A unique partition key value of a logical partition for non-relational custom entity data stored in NoSql tables of Azure heterogenous storage. */
/**A unique partition key value of a logical partition for non-relational custom entity data stored in NoSql tables of Azure heterogenous storage. */
partitionId?: string;

@@ -516,3 +517,3 @@ }

export interface DeleteRequest extends CRUDRequest {
/**v.1.7.5+ If set to true, the request bypasses custom business logic, all synchronous plug-ins and real-time workflows are disabled. Check for special exceptions in Microsft Docs. */
/**If set to true, the request bypasses custom business logic, all synchronous plug-ins and real-time workflows are disabled. Check for special exceptions in Microsft Docs. */
bypassCustomPluginExecution?: boolean;

@@ -547,3 +548,3 @@ /**Sets If-Match header value that enables to use conditional retrieval or optimistic concurrency in applicable requests.*/

userQuery?: string;
/**v.1.7.7+ A unique partition key value of a logical partition for non-relational custom entity data stored in NoSql tables of Azure heterogenous storage. */
/**A unique partition key value of a logical partition for non-relational custom entity data stored in NoSql tables of Azure heterogenous storage. */
partitionId?: string;

@@ -572,5 +573,5 @@ }

trackChanges?: boolean;
/**v.1.7.7+ A unique partition key value of a logical partition for non-relational custom entity data stored in NoSql tables of Azure heterogenous storage. */
/**A unique partition key value of a logical partition for non-relational custom entity data stored in NoSql tables of Azure heterogenous storage. */
partitionId?: string;
/**v.1.7.7+ Additional query parameters that either have not been implemented yet or they are parameter aliases for "$filter" and "$orderBy". Important! These parameters ARE NOT URI encoded! */
/**Additional query parameters that either have not been implemented yet or they are parameter aliases for "$filter" and "$orderBy". Important! These parameters ARE NOT URI encoded! */
queryParams?: string[];

@@ -835,2 +836,3 @@ }

export interface AccessToken {
/** Access Token */
accessToken: string;

@@ -846,3 +848,3 @@ }

/**A function that is called when a security token needs to be refreshed. */
onTokenRefresh?: (() => Promise<AccessToken | string>) | null;
onTokenRefresh?: (() => Promise<AccessToken | string | null>) | null;
/**Sets Prefer header with value "odata.include-annotations=" and the specified annotation.Annotations provide additional information about lookups, options sets and other complex attribute types.*/

@@ -849,0 +851,0 @@ includeAnnotations?: string | null;

@@ -1,2 +0,2 @@

/*! dynamics-web-api v2.0.0-beta.3 (c) 2023 Aleksandr Rogov */
/*! dynamics-web-api v2.0.0-beta.4 (c) 2023 Aleksandr Rogov */
"use strict";var _dynamicsWebApiExports=(()=>{var q=Object.defineProperty;var le=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var ue=Object.prototype.hasOwnProperty;var b=(s,e)=>()=>(s&&(e=s(s=0)),e);var X=(s,e)=>{for(var t in e)q(s,t,{get:e[t],enumerable:!0})},me=(s,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of pe(e))!ue.call(s,n)&&n!==t&&q(s,n,{get:()=>e[n],enumerable:!(a=le(e,n))||a.enumerable});return s};var H=s=>me(q({},"__esModule",{value:!0}),s);function de(){return window.crypto}function j(){return de().getRandomValues(new Uint8Array(1))}var Q=b(()=>{"use strict"});function J(s){return!!new RegExp(M,"i").exec(s)}function S(s){let e=new RegExp("^{?("+M+")}?$","i").exec(s);return e?e[1]:null}function F(s){let e=new RegExp("("+M+")\\)$","i").exec(s);return e?e[1]:null}var M,w=b(()=>{"use strict";M="[0-9A-F]{8}[-]?([0-9A-F]{4}[-]?){3}[0-9A-F]{12}"});var ye,g,c,v=b(()=>{"use strict";Q();w();ye=4194304,g=class g{static buildFunctionParameters(e){if(e){let a=Object.keys(e),n="",r="";for(var t=1;t<=a.length;t++){let l=a[t-1],o=e[l];o!==null&&(typeof o=="string"&&!o.startsWith("Microsoft.Dynamics.CRM")&&!J(o)?o="'"+o+"'":typeof o=="object"&&(o=JSON.stringify(o)),t>1&&(n+=",",r+="&"),n+=l+"=@p"+t,r+="@p"+t+"="+(S(o)||o))}return"("+n+")?"+r}else return"()"}static getFetchXmlPagingCookie(e="",t=1){e=decodeURIComponent(decodeURIComponent(e));let a=/pagingcookie="(<cookie page="(\d+)".+<\/cookie>)/.exec(e);if(a!=null){let n=parseInt(a[2]);return{cookie:a[1].replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"'").replace(/\'/g,"&quot;"),page:n,nextPage:n+1}}else return{cookie:"",page:t,nextPage:t+1}}static convertToReferenceObject(e){let t=/\/(\w+)\(([0-9A-F]{8}[-]?([0-9A-F]{4}[-]?){3}[0-9A-F]{12})/i.exec(e["@odata.id"]);return{id:t[2],collection:t[1],oDataContext:e["@odata.context"]}}static isNull(e){return typeof e>"u"||e==null}static generateUUID(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^j()[0]&15>>e/4).toString(16))}static getXrmContext(){if(typeof GetGlobalContext<"u")return GetGlobalContext();if(typeof Xrm<"u"){if(!g.isNull(Xrm.Utility)&&!g.isNull(Xrm.Utility.getGlobalContext))return Xrm.Utility.getGlobalContext();if(!g.isNull(Xrm.Page)&&!g.isNull(Xrm.Page.context))return Xrm.Page.context}throw new Error("Xrm Context is not available. In most cases, it can be resolved by adding a reference to a ClientGlobalContext.js.aspx. Please refer to MSDN documentation for more details.")}static getClientUrl(){let t=g.getXrmContext().getClientUrl();return t.match(/\/$/)&&(t=t.substring(0,t.length-1)),t}static isObject(e){return typeof e=="object"&&!!e&&!Array.isArray(e)&&Object.prototype.toString.call(e)!=="[object Date]"}static copyObject(e,t){let a={};for(let n in e)e.hasOwnProperty(n)&&!t?.includes(n)&&(g.isObject(e[n])?a[n]=g.copyObject(e[n]):Array.isArray(e[n])?a[n]=e[n].slice():a[n]=e[n]);return a}static copyRequest(e,t=[]){t.includes("signal")||t.push("signal");let a=g.copyObject(e,t);return a.signal=e.signal,a}static setFileChunk(e,t,a,n){n=n||0;let r=n+a>t.length?t.length%a:a,l;if(typeof window>"u")l=t.slice(n,n+r);else{l=new Uint8Array(r);for(let o=0;o<r;o++)l[o]=t[n+o]}e.data=l,e.contentRange="bytes "+n+"-"+(n+r-1)+"/"+t.length}static convertToFileBuffer(e){if(typeof window>"u")return Buffer.from(e,"binary");{let a=new Uint8Array(e.length);for(var t=0;t<e.length;t++)a[t]=e.charCodeAt(t);return a}}};g.downloadChunkSize=ye;c=g});function C(s,e,t){throw new Error(t?`${s} requires a ${e} parameter to be of type ${t}.`:`${s} requires a ${e} parameter.`)}var i,P=b(()=>{"use strict";w();i=class s{static handleErrorResponse(e){throw new Error(`Error: ${e.status}: ${e.message}`)}static parameterCheck(e,t,a,n){(typeof e>"u"||e===null||e==="")&&C(t,a,n)}static stringParameterCheck(e,t,a){typeof e!="string"&&C(t,a,"String")}static maxLengthStringParameterCheck(e,t,a,n){if(e&&e.length>n)throw new Error(`${a} has a ${n} character limit.`)}static arrayParameterCheck(e,t,a){e.constructor!==Array&&C(t,a,"Array")}static stringOrArrayParameterCheck(e,t,a){e.constructor!==Array&&typeof e!="string"&&C(t,a,"String or Array")}static numberParameterCheck(e,t,a){if(typeof e!="number"){if(typeof e=="string"&&e&&!isNaN(parseInt(e)))return;C(t,a,"Number")}}static batchIsEmpty(){return[new Error("Payload of the batch operation is empty. Please make that you have other operations in between startBatch() and executeBatch() to successfuly build a batch payload.")]}static handleHttpError(e,t){let a=new Error;return Object.keys(e).forEach(n=>{a[n]=e[n]}),t&&Object.keys(t).forEach(n=>{a[n]=t[n]}),a}static boolParameterCheck(e,t,a){typeof e!="boolean"&&C(t,a,"Boolean")}static guidParameterCheck(e,t,a){let n=S(e);return n||C(t,a,"GUID String"),n}static keyParameterCheck(e,t,a){try{s.stringParameterCheck(e,t,a);let n=S(e);if(n)return n;let r=e.split(",");if(r.length)for(let l=0;l<r.length;l++)r[l]=r[l].trim().replace(/"/g,"'"),/^[\w\d\_]+\=(.+)$/i.exec(r[l])[0];return r.join(",")}catch{C(t,a,"String representing GUID or Alternate Key")}}static callbackParameterCheck(e,t,a){typeof e!="function"&&C(t,a,"Function")}static throwBatchIncompatible(e,t){if(t)throw t=!1,new Error(e+" cannot be used in a BATCH request.")}static throwBatchNotStarted(e){if(!e)throw new Error("Batch operation has not been started. Please call a DynamicsWebApi.startBatch() function prior to calling DynamicsWebApi.executeBatch() to perform a batch request correctly.")}}});var D,E,$,A,Z=b(()=>{"use strict";$=class ${};$.Prefer=(E=class{static get(e){return`${$.Prefer.IncludeAnnotations}="${e}"`}},E.ReturnRepresentation="return=representation",E.Annotations=(D=class{},D.AssociatedNavigationProperty="Microsoft.Dynamics.CRM.associatednavigationproperty",D.LookupLogicalName="Microsoft.Dynamics.CRM.lookuplogicalname",D.All="*",D.FormattedValue="OData.Community.Display.V1.FormattedValue",D.FetchXmlPagingCookie="Microsoft.Dynamics.CRM.fetchxmlpagingcookie",D),E.IncludeAnnotations="odata.include-annotations",E);A=$});function K(s,e){if(typeof e=="string"){let t=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:Z|[-+]\d{2}:\d{2})$/.exec(e);if(t)return new Date(Date.UTC(+t[1],+t[2]-1,+t[3],+t[4],+t[5],+t[6]))}return e}var Y=b(()=>{"use strict"});function G(s,e){let t=null;if(s.indexOf("@")!==-1){let a=s.split("@");switch(a[1]){case"odata.context":t="oDataContext";break;case"odata.count":t="oDataCount",e=e!=null?parseInt(e):0;break;case"odata.nextLink":t="oDataNextLink";break;case"odata.deltaLink":t="oDataDeltaLink";break;case A.Prefer.Annotations.FormattedValue:t=a[0]+"_Formatted";break;case A.Prefer.Annotations.AssociatedNavigationProperty:t=a[0]+"_NavigationProperty";break;case A.Prefer.Annotations.LookupLogicalName:t=a[0]+"_LogicalName";break}}return[t,e]}function B(s,e){if(e){if(e.isRef&&s["@odata.id"]!=null)return c.convertToReferenceObject(s);if(e.toCount)return G("@odata.count",s["@odata.count"])[1]||0}let t=Object.keys(s);for(let n=0;n<t.length;n++){let r=t[n];if(s[r]!=null)if(s[r].constructor===Array)for(var a=0;a<s[r].length;a++)s[r][a]=B(s[r][a]);else typeof s[r]=="object"&&B(s[r]);let l=G(r,s[r]);if(l[0]&&(s[l[0]]=l[1]),r.indexOf("_x002e_")!==-1){let o=r.split("_x002e_");if(!s.hasOwnProperty(o[0]))s[o[0]]={_dwaType:"alias"};else if(typeof s[o[0]]!="object"||typeof s[o[0]]=="object"&&!s[o[0]].hasOwnProperty("_dwaType"))throw new Error("The alias name of the linked entity must be unique!");s[o[0]][o[1]]=s[r],l=G(o[1],s[r]),l[0]&&(s[o[0]][l[0]]=l[1])}}return e&&e.hasOwnProperty("pageNumber")&&s["@"+A.Prefer.Annotations.FetchXmlPagingCookie]!=null&&(s.PagingInfo=c.getFetchXmlPagingCookie(s["@"+A.Prefer.Annotations.FetchXmlPagingCookie],e.pageNumber)),s}function ge(s){let e={position:0},t={},a,n,r;do r=e.position,n=Re(s,e),a=fe.exec(n),a!==null?t[a[1].toLowerCase()]=a[2]:e.position=r;while(n&&a);return t}function Re(s,e){return be(s,e,`\r

@@ -3,0 +3,0 @@ `)}function be(s,e,t){let a=e.position||0,n=s.length;if(t){if(n=s.indexOf(t,a),n===-1)return null;e.position=n+t.length}else e.position=n;return s.substring(a,n)}function ee(s,e,t=0){let a=s.substr(0,s.indexOf(`\r

{
"name": "dynamics-web-api",
"version": "2.0.0-beta.3",
"version": "2.0.0-beta.4",
"description": "DynamicsWebApi is a Microsoft Dynamics CRM Web API helper library",

@@ -5,0 +5,0 @@ "keywords": [

@@ -10,3 +10,3 @@ # DynamicsWebApi for Microsoft Dynamics 365 CE (CRM) / Microsoft Dataverse Web API (formerly known as Microsoft Common Data Service Web API)

It is compatible with: Microsoft Dataverse, Microsoft Dynamics 365: Customer Service, Field Service, Marketing, Project Operations, Talents, Sales and any application built on Microsoft Power Apps platform.
It is compatible with: Microsoft Dataverse; Microsoft Dynamics 365: Customer Service, Field Service, Marketing, Project Operations, Talents, Sales and any model-driven application built on Microsoft Power Apps platform.
As well as Microsoft Dynamics 365 CE (online), Microsoft Dynamics 365 CE (on-premises), Microsoft Dynamics CRM 2016, Microsoft Dynamics CRM Online.

@@ -16,3 +16,3 @@

- **Microsoft Dataverse Search API**. Access full power of its Search, Suggestion and Autocomplete capabilities.
- **Microsoft Dataverse Search API**. Access the full power of its Search, Suggestion and Autocomplete capabilities.
- **Batch Requests**. Convert all requests into a Batch operation with a single line of code.

@@ -19,0 +19,0 @@ - **Simplicity and Automation**. Such as automated paging, big file downloading/uploading in chunks of data, automated conversion of requests with long URLs into a Batch Request in the background and more!

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc