@osdk/client 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/js/{chunk-TJNTUGSE.mjs → chunk-BQNFWSLL.mjs} +48 -22
- package/build/js/chunk-BQNFWSLL.mjs.map +1 -0
- package/build/js/{chunk-V77HHGVZ.cjs → chunk-KAL57TC5.cjs} +47 -21
- package/build/js/chunk-KAL57TC5.cjs.map +1 -0
- package/build/js/index.cjs +32 -14
- package/build/js/index.cjs.map +1 -1
- package/build/js/index.mjs +28 -10
- package/build/js/index.mjs.map +1 -1
- package/build/js/public/objects.cjs +3 -3
- package/build/js/public/objects.mjs +1 -1
- package/build/types/Client.d.ts +3 -3
- package/build/types/ObjectSetCreator.d.ts +3 -3
- package/build/types/OsdkObjectFrom.d.ts +11 -17
- package/build/types/actions/Actions.d.ts +17 -13
- package/build/types/actions/applyAction.d.ts +3 -10
- package/build/types/actions/createActionInvoker.d.ts +2 -1
- package/build/types/definitions/LinkDefinitions.d.ts +12 -13
- package/build/types/generatedNoCheck/Ontology.d.ts +13 -477
- package/build/types/generatedNoCheck/ontology/actions/actionTakesAttachment.d.ts +22 -10
- package/build/types/generatedNoCheck/ontology/actions/actionTakesObjectSet.d.ts +23 -13
- package/build/types/generatedNoCheck/ontology/actions/createOffice.d.ts +40 -28
- package/build/types/generatedNoCheck/ontology/actions/createOfficeAndEmployee.d.ts +46 -34
- package/build/types/generatedNoCheck/ontology/actions/index.d.ts +7 -7
- package/build/types/generatedNoCheck/ontology/actions/moveOffice.d.ts +40 -28
- package/build/types/generatedNoCheck/ontology/actions/promoteEmployee.d.ts +32 -20
- package/build/types/generatedNoCheck/ontology/actions/promoteEmployeeObject.d.ts +33 -23
- package/build/types/generatedNoCheck/ontology/objects/Employee.d.ts +20 -25
- package/build/types/generatedNoCheck/ontology/objects/ObjectWithTimestampPrimaryKey.d.ts +10 -7
- package/build/types/generatedNoCheck/ontology/objects/Office.d.ts +16 -15
- package/build/types/generatedNoCheck/ontology/objects/equipment.d.ts +10 -7
- package/build/types/generatedNoCheck/ontology/objects/objectTypeWithAllPropertyTypes.d.ts +38 -35
- package/build/types/index.d.ts +3 -1
- package/build/types/internal/conversions/legacyToModernSingleAggregationResult.d.ts +1 -1
- package/build/types/internal/conversions/modernToLegacyAggregationClause.d.ts +1 -2
- package/build/types/internal/conversions/modernToLegacyGroupByClause.d.ts +1 -2
- package/build/types/object/aggregateOrThrow.d.ts +3 -2
- package/build/types/object/fetchPageOrThrow.d.ts +4 -4
- package/build/types/object/followLinkOrThrow.d.ts +1 -1
- package/build/types/object/getLinkedObjectByPkOrThrow.d.ts +1 -1
- package/build/types/object/getLinkedObjectOrThrow.d.ts +5 -2
- package/build/types/object/pageLinkedObjectsOrThrow.d.ts +4 -6
- package/build/types/objectSet/LinkTypesFrom.d.ts +2 -2
- package/build/types/objectSet/ObjectSet.d.ts +13 -11
- package/build/types/objectSet/ObjectSet.test.d.ts +1 -0
- package/build/types/objectSet/ObjectSetListener.d.ts +7 -7
- package/build/types/objectSet/ObjectSetListenerWebsocket.d.ts +2 -2
- package/build/types/objectSet/createObjectSet.d.ts +2 -2
- package/build/types/query/WhereClause.d.ts +12 -5
- package/build/types/query/aggregations/AggregatableKeys.d.ts +3 -3
- package/build/types/query/aggregations/AggregateOpts.d.ts +4 -4
- package/build/types/query/aggregations/AggregationResultsWithGroups.d.ts +4 -4
- package/build/types/query/aggregations/AggregationResultsWithoutGroups.d.ts +5 -5
- package/build/types/query/aggregations/AggregationsClause.d.ts +5 -5
- package/build/types/query/aggregations/AggregationsClause.test.d.ts +4 -2
- package/build/types/query/aggregations/AggregationsResults.d.ts +2 -2
- package/build/types/query/aggregations/GroupByClause.d.ts +4 -4
- package/build/types/query/aggregations/GroupByClause.test.d.ts +2 -1
- package/build/types/util/test/mockOntology.d.ts +50 -48
- package/changelog/0.6.0/pr-9.v2.yml +5 -0
- package/changelog/0.7.0/pr-20.v2.yml +5 -0
- package/changelog/0.7.0/pr-24.v2.yml +5 -0
- package/changelog/0.7.0/pr-28.v2.yml +5 -0
- package/changelog/0.8.0/pr-30.v2.yml +5 -0
- package/changelog/0.9.0/pr-43.v2.yml +5 -0
- package/changelog/0.9.0/pr-45.v2.yml +5 -0
- package/changelog/0.9.0/pr-48.v2.yml +5 -0
- package/changelog/0.9.0/pr-59.v2.yml +5 -0
- package/changelog/0.9.0/pr-65.v2.yml +5 -0
- package/changelog/0.9.0/pr-72.v2.yml +5 -0
- package/changelog/0.9.0/pr-75.v2.yml +5 -0
- package/changelog/@unreleased/.gitkeep +0 -0
- package/package.json +11 -6
- package/build/js/chunk-TJNTUGSE.mjs.map +0 -1
- package/build/js/chunk-V77HHGVZ.cjs.map +0 -1
- /package/{CHANGELOG.md → CHANGELOG_OLD.md} +0 -0
package/build/js/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { aggregateOrThrow, fetchPageOrThrow, modernToLegacyWhereClause, isAttachment, convertWireToOsdkObjects } from './chunk-
|
|
2
|
-
export { object_exports as Objects } from './chunk-
|
|
1
|
+
import { aggregateOrThrow, fetchPageOrThrow, modernToLegacyWhereClause, isAttachment, convertWireToOsdkObjects } from './chunk-BQNFWSLL.mjs';
|
|
2
|
+
export { object_exports as Objects } from './chunk-BQNFWSLL.mjs';
|
|
3
3
|
import { createClientContext, createOpenApiRequest } from '@osdk/shared.net';
|
|
4
4
|
export { createClientContext, isOk } from '@osdk/shared.net';
|
|
5
5
|
import { applyActionV2, getObjectTypeV2 } from '@osdk/gateway/requests';
|
|
@@ -59,8 +59,8 @@ var ActionValidationError = class extends Error {
|
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
// src/actions/applyAction.ts
|
|
62
|
-
async function applyAction(client,
|
|
63
|
-
const response = await applyActionV2(createOpenApiRequest(client.stack, client.fetch), client.ontology.metadata.ontologyApiName,
|
|
62
|
+
async function applyAction(client, action, parameters, options = {}) {
|
|
63
|
+
const response = await applyActionV2(createOpenApiRequest(client.stack, client.fetch), client.ontology.metadata.ontologyApiName, action.apiName, {
|
|
64
64
|
parameters: remapActionParams(parameters),
|
|
65
65
|
options: {
|
|
66
66
|
mode: options?.validateOnly ? "VALIDATE_ONLY" : "VALIDATE_AND_EXECUTE",
|
|
@@ -93,7 +93,7 @@ function createActionInvoker(client) {
|
|
|
93
93
|
get: (_target, p, _receiver) => {
|
|
94
94
|
if (typeof p === "string") {
|
|
95
95
|
return function(...args) {
|
|
96
|
-
return applyAction(client, p, ...args);
|
|
96
|
+
return applyAction(client, client.ontology.actions[p], ...args);
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
99
|
return void 0;
|
|
@@ -649,7 +649,7 @@ async function getOntologyPropertyMappingForRid(ctx, ontologyRid, objectRid) {
|
|
|
649
649
|
var searchAroundPrefix = "searchAround_";
|
|
650
650
|
function createObjectSet2(objectType, clientCtx, objectSet = {
|
|
651
651
|
type: "base",
|
|
652
|
-
objectType
|
|
652
|
+
objectType: objectType["apiName"]
|
|
653
653
|
}) {
|
|
654
654
|
const base = {
|
|
655
655
|
definition: objectSet,
|
|
@@ -664,7 +664,7 @@ function createObjectSet2(objectType, clientCtx, objectSet = {
|
|
|
664
664
|
// throw "TODO";
|
|
665
665
|
// },
|
|
666
666
|
aggregateOrThrow: async (req) => {
|
|
667
|
-
return aggregateOrThrow(clientCtx, objectType, req);
|
|
667
|
+
return aggregateOrThrow(clientCtx, objectType, objectSet, req);
|
|
668
668
|
},
|
|
669
669
|
// fetchPage: async (args?: { nextPageToken?: string }) => {
|
|
670
670
|
// throw "TODO";
|
|
@@ -688,6 +688,24 @@ function createObjectSet2(objectType, clientCtx, objectSet = {
|
|
|
688
688
|
pivotTo: function(type) {
|
|
689
689
|
return createSearchAround(type)();
|
|
690
690
|
},
|
|
691
|
+
union: (...objectSets) => {
|
|
692
|
+
return createObjectSet2(objectType, clientCtx, {
|
|
693
|
+
type: "union",
|
|
694
|
+
objectSets: [objectSet, ...objectSets.map((os) => os.definition)]
|
|
695
|
+
});
|
|
696
|
+
},
|
|
697
|
+
intersect: (...objectSets) => {
|
|
698
|
+
return createObjectSet2(objectType, clientCtx, {
|
|
699
|
+
type: "intersect",
|
|
700
|
+
objectSets: [objectSet, ...objectSets.map((os) => os.definition)]
|
|
701
|
+
});
|
|
702
|
+
},
|
|
703
|
+
subtract: (...objectSets) => {
|
|
704
|
+
return createObjectSet2(objectType, clientCtx, {
|
|
705
|
+
type: "subtract",
|
|
706
|
+
objectSets: [objectSet, ...objectSets.map((os) => os.definition)]
|
|
707
|
+
});
|
|
708
|
+
},
|
|
691
709
|
subscribe(listener) {
|
|
692
710
|
const instance = ObjectSetListenerWebsocket.getInstance(clientCtx);
|
|
693
711
|
return instance.subscribe(objectSet, listener);
|
|
@@ -736,12 +754,12 @@ function createObjectSetCreator(client, clientContext) {
|
|
|
736
754
|
}
|
|
737
755
|
|
|
738
756
|
// src/util/UserAgent.ts
|
|
739
|
-
var USER_AGENT = `osdk-client/${"0.
|
|
757
|
+
var USER_AGENT = `osdk-client/${"0.9.0"}`;
|
|
740
758
|
|
|
741
759
|
// src/createClient.ts
|
|
742
760
|
function createClient(ontology, stack, tokenProvider, fetchFn = fetch) {
|
|
743
761
|
const clientCtx = createClientContext(ontology, stack, tokenProvider, USER_AGENT, fetchFn);
|
|
744
|
-
const objectSetFactory = (type) => createObjectSet2(type, clientCtx);
|
|
762
|
+
const objectSetFactory = (type) => createObjectSet2(ontology["objects"][type] ?? ontology["interfaces"]?.[type], clientCtx);
|
|
745
763
|
const client = Object.defineProperties({}, {
|
|
746
764
|
objectSet: {
|
|
747
765
|
get: () => objectSetFactory
|
|
@@ -754,7 +772,7 @@ function createClient(ontology, stack, tokenProvider, fetchFn = fetch) {
|
|
|
754
772
|
},
|
|
755
773
|
__UNSTABLE_preexistingObjectSet: {
|
|
756
774
|
get: () => (objectType, rid) => {
|
|
757
|
-
return createObjectSet2(objectType, clientCtx, {
|
|
775
|
+
return createObjectSet2(ontology["interfaces"]?.[objectType] ?? ontology["objects"][objectType], clientCtx, {
|
|
758
776
|
type: "intersect",
|
|
759
777
|
objectSets: [{
|
|
760
778
|
type: "base",
|