@osdk/generator 1.14.0-beta.0 → 1.14.0-beta.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.
- package/CHANGELOG.md +13 -0
- package/build/browser/index.js +37 -31
- package/build/browser/index.js.map +1 -1
- package/build/cjs/index.cjs +37 -31
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/v2.0/generatePerActionDataFiles.d.ts.map +1 -1
- package/build/cjs/v2.0/wireObjectTypeV2ToSdkObjectConstV2.d.ts.map +1 -1
- package/build/esm/index.js +37 -31
- package/build/esm/index.js.map +1 -1
- package/build/esm/v2.0/generatePerActionDataFiles.d.ts.map +1 -1
- package/build/esm/v2.0/wireObjectTypeV2ToSdkObjectConstV2.d.ts.map +1 -1
- package/package.json +4 -4
package/build/cjs/index.cjs
CHANGED
|
@@ -98,7 +98,7 @@ var EnhancedAction = class extends EnhancedBase {
|
|
|
98
98
|
return this.og.operations;
|
|
99
99
|
}
|
|
100
100
|
get paramsIdentifier() {
|
|
101
|
-
return `${this.shortApiName}.
|
|
101
|
+
return `${this.shortApiName}.Params`;
|
|
102
102
|
}
|
|
103
103
|
get definitionIdentifier() {
|
|
104
104
|
return `${this.shortApiName}.Definition`;
|
|
@@ -1967,7 +1967,7 @@ function wireObjectTypeV2ToSdkObjectConstV2(wireObject, {
|
|
|
1967
1967
|
|
|
1968
1968
|
|
|
1969
1969
|
|
|
1970
|
-
|
|
1970
|
+
|
|
1971
1971
|
export type ${objectDefIdentifier} = ${object.shortApiName}.Definition;
|
|
1972
1972
|
|
|
1973
1973
|
|
|
@@ -1997,7 +1997,7 @@ function createOsdkObject(object, identifier, {
|
|
|
1997
1997
|
const definition = object.getCleanedUpDefinition(true);
|
|
1998
1998
|
return `
|
|
1999
1999
|
export type ${identifier}<
|
|
2000
|
-
OPTIONS extends
|
|
2000
|
+
OPTIONS extends never | "$notStrict" | "$rid" = never,
|
|
2001
2001
|
K extends keyof ${osdkObjectPropsIdentifier}= keyof ${osdkObjectPropsIdentifier},
|
|
2002
2002
|
|
|
2003
2003
|
>
|
|
@@ -2005,6 +2005,8 @@ function createOsdkObject(object, identifier, {
|
|
|
2005
2005
|
${objectDefIdentifier},
|
|
2006
2006
|
K | OPTIONS
|
|
2007
2007
|
> & Pick<
|
|
2008
|
+
[OPTIONS] extends [never]
|
|
2009
|
+
? ${osdkObjectStrictPropsIdentifier} :
|
|
2008
2010
|
OPTIONS extends "$notStrict" ? ${osdkObjectPropsIdentifier} : ${osdkObjectStrictPropsIdentifier}
|
|
2009
2011
|
, K
|
|
2010
2012
|
> & {
|
|
@@ -2033,37 +2035,37 @@ $ObjectSet<${objectDefIdentifier},
|
|
|
2033
2035
|
${objectSetIdentifier}
|
|
2034
2036
|
>
|
|
2035
2037
|
{
|
|
2036
|
-
readonly aggregate: <AO extends $AggregateOpts<${objectDefIdentifier}>>(
|
|
2038
|
+
readonly aggregate: <const AO extends $AggregateOpts<${objectDefIdentifier}>>(
|
|
2037
2039
|
req: $AggregateOptsThatErrorsAndDisallowsOrderingWithMultipleGroupBy<${objectDefIdentifier}, AO>,
|
|
2038
2040
|
) => Promise<$AggregationsResults<${objectDefIdentifier}, AO>>;
|
|
2039
2041
|
|
|
2040
2042
|
|
|
2041
|
-
readonly pivotTo: <L extends $LinkNames<${objectDefIdentifier}>>(type: L) => $LinkedType<${objectDefIdentifier}, L>["objectSet"];
|
|
2043
|
+
readonly pivotTo: <const L extends $LinkNames<${objectDefIdentifier}>>(type: L) => $LinkedType<${objectDefIdentifier}, L>["objectSet"];
|
|
2042
2044
|
${object instanceof EnhancedObjectType ? `
|
|
2043
2045
|
readonly fetchOne: <
|
|
2044
|
-
L extends ${propertyKeysIdentifier},
|
|
2045
|
-
R extends boolean,
|
|
2046
|
-
S extends false | "throw" = $NullabilityAdherenceDefault,
|
|
2046
|
+
const L extends ${propertyKeysIdentifier},
|
|
2047
|
+
const R extends boolean,
|
|
2048
|
+
const S extends false | "throw" = $NullabilityAdherenceDefault,
|
|
2047
2049
|
>(
|
|
2048
2050
|
primaryKey: $PropertyValueClientToWire[${objectDefIdentifier}["primaryKeyType"]],
|
|
2049
2051
|
options?: $SelectArg<${objectDefIdentifier}, L, R, S>,
|
|
2050
2052
|
) => Promise<
|
|
2051
2053
|
${osdkObjectIdentifier}<
|
|
2052
|
-
(S extends false ? "$notStrict" :
|
|
2054
|
+
(S extends false ? "$notStrict" : never) | ($DefaultToFalse<R> extends false? never: "$rid" ),
|
|
2053
2055
|
L
|
|
2054
2056
|
>>
|
|
2055
2057
|
;
|
|
2056
2058
|
|
|
2057
2059
|
readonly fetchOneWithErrors: <
|
|
2058
|
-
L extends ${propertyKeysIdentifier},
|
|
2059
|
-
R extends boolean,
|
|
2060
|
-
S extends false | "throw" = $NullabilityAdherenceDefault,
|
|
2060
|
+
const L extends ${propertyKeysIdentifier},
|
|
2061
|
+
const R extends boolean,
|
|
2062
|
+
const S extends false | "throw" = $NullabilityAdherenceDefault,
|
|
2061
2063
|
>(
|
|
2062
2064
|
primaryKey: $PropertyValueClientToWire[${objectDefIdentifier}["primaryKeyType"]],
|
|
2063
2065
|
options?: $SelectArg<${objectDefIdentifier}, L, R, S>,
|
|
2064
2066
|
) => Promise<$Result<
|
|
2065
2067
|
${osdkObjectIdentifier}<
|
|
2066
|
-
(S extends false ? "$notStrict" :
|
|
2068
|
+
(S extends false ? "$notStrict" : never) | ($DefaultToFalse<R> extends false?never: "$rid"),
|
|
2067
2069
|
L
|
|
2068
2070
|
>
|
|
2069
2071
|
>>
|
|
@@ -2073,29 +2075,29 @@ readonly fetchOneWithErrors: <
|
|
|
2073
2075
|
` : ""}
|
|
2074
2076
|
|
|
2075
2077
|
readonly fetchPage: <
|
|
2076
|
-
L extends ${propertyKeysIdentifier},
|
|
2077
|
-
R extends boolean,
|
|
2078
|
-
const A extends $Augments,
|
|
2079
|
-
S extends $NullabilityAdherence = $NullabilityAdherenceDefault,
|
|
2078
|
+
const L extends ${propertyKeysIdentifier},
|
|
2079
|
+
const R extends boolean,
|
|
2080
|
+
const const A extends $Augments,
|
|
2081
|
+
const S extends $NullabilityAdherence = $NullabilityAdherenceDefault,
|
|
2080
2082
|
>(
|
|
2081
2083
|
args?: $FetchPageArgs<${objectDefIdentifier}, L, R, A, S>,
|
|
2082
2084
|
) => Promise<
|
|
2083
2085
|
$PageResult<${osdkObjectIdentifier}<
|
|
2084
|
-
(S extends false ? "$notStrict" :
|
|
2086
|
+
(S extends false ? "$notStrict" : never) | ($DefaultToFalse<R> extends false? never: "$rid"),
|
|
2085
2087
|
L
|
|
2086
2088
|
>>
|
|
2087
2089
|
>;
|
|
2088
2090
|
|
|
2089
2091
|
readonly fetchPageWithErrors: <
|
|
2090
|
-
L extends ${propertyKeysIdentifier},
|
|
2091
|
-
R extends boolean,
|
|
2092
|
+
const L extends ${propertyKeysIdentifier},
|
|
2093
|
+
const R extends boolean,
|
|
2092
2094
|
const A extends $Augments,
|
|
2093
|
-
S extends $NullabilityAdherence = $NullabilityAdherenceDefault,
|
|
2095
|
+
const S extends $NullabilityAdherence = $NullabilityAdherenceDefault,
|
|
2094
2096
|
>(
|
|
2095
2097
|
args?: $FetchPageArgs<${objectDefIdentifier}, L, R, A, S>,
|
|
2096
2098
|
) => Promise<$Result<
|
|
2097
2099
|
$PageResult<${osdkObjectIdentifier}<
|
|
2098
|
-
(S extends false ? "$notStrict" :
|
|
2100
|
+
(S extends false ? "$notStrict" : never) | ($DefaultToFalse<R> extends false? never : "$rid"),
|
|
2099
2101
|
L>>
|
|
2100
2102
|
>>;
|
|
2101
2103
|
|
|
@@ -2216,9 +2218,9 @@ async function generatePerActionDataFiles({
|
|
|
2216
2218
|
return JSON.stringify(type);
|
|
2217
2219
|
} else if (type.type === "object") {
|
|
2218
2220
|
const obj = enhancedOntology.requireObjectType(type.object);
|
|
2219
|
-
return `ObjectActionDataType<"${obj.fullApiName}", ${obj.getImportedDefinitionIdentifier(true)}>`;
|
|
2221
|
+
return `ObjectActionDataType<"${obj.fullApiName}", ${obj.getImportedDefinitionIdentifier(true)}.Definition>`;
|
|
2220
2222
|
} else if (type.type === "objectSet") {
|
|
2221
|
-
return `ObjectSetActionDataType<"${type.objectSet}", ${getObjectDefIdentifier(type.objectSet, true)}>`;
|
|
2223
|
+
return `ObjectSetActionDataType<"${type.objectSet}", ${getObjectDefIdentifier(type.objectSet, true)}.Definition>`;
|
|
2222
2224
|
}
|
|
2223
2225
|
return void 0;
|
|
2224
2226
|
}
|
|
@@ -2231,9 +2233,9 @@ async function generatePerActionDataFiles({
|
|
|
2231
2233
|
if (typeof input === "string") {
|
|
2232
2234
|
return `ActionParam.PrimitiveType<${JSON.stringify(input)}>`;
|
|
2233
2235
|
} else if (input.type === "object") {
|
|
2234
|
-
return `ActionParam.ObjectType<${enhancedOntology.requireObjectType(input.object).getImportedDefinitionIdentifier(true)}>`;
|
|
2236
|
+
return `ActionParam.ObjectType<${enhancedOntology.requireObjectType(input.object).getImportedDefinitionIdentifier(true)}.Definition>`;
|
|
2235
2237
|
} else if (input.type === "objectSet") {
|
|
2236
|
-
return `ActionParam.ObjectSetType<${enhancedOntology.requireObjectType(input.objectSet).getImportedDefinitionIdentifier(true)}>`;
|
|
2238
|
+
return `ActionParam.ObjectSetType<${enhancedOntology.requireObjectType(input.objectSet).getImportedDefinitionIdentifier(true)}.Definition>`;
|
|
2237
2239
|
}
|
|
2238
2240
|
}
|
|
2239
2241
|
function createV2Types() {
|
|
@@ -2244,7 +2246,7 @@ async function generatePerActionDataFiles({
|
|
|
2244
2246
|
${createParamsDef()}
|
|
2245
2247
|
|
|
2246
2248
|
${getDescriptionIfPresent(action.description)}
|
|
2247
|
-
export interface
|
|
2249
|
+
export interface Params {
|
|
2248
2250
|
${stringify(parameters, {
|
|
2249
2251
|
"*": (ogValue, _, ogKey) => {
|
|
2250
2252
|
const key = `${getDescriptionIfPresent(ogValue.description)}
|
|
@@ -2254,10 +2256,12 @@ async function generatePerActionDataFiles({
|
|
|
2254
2256
|
}
|
|
2255
2257
|
})}
|
|
2256
2258
|
}
|
|
2259
|
+
/** @deprecated **/
|
|
2260
|
+
export type Parameters = Params;
|
|
2257
2261
|
|
|
2258
2262
|
|
|
2259
2263
|
// Represents the definition of the action
|
|
2260
|
-
export interface Definition extends ActionDefinition<"${action.shortApiName}", ${uniqueApiNamesString}, ${action.shortApiName}>, VersionBound<$ExpectedClientVersion> {
|
|
2264
|
+
export interface Definition extends ActionDefinition<"${action.shortApiName}", ${uniqueApiNamesString}, ${action.shortApiName}.Signatures>, VersionBound<$ExpectedClientVersion> {
|
|
2261
2265
|
${Object.entries(actionDefSansParameters).sort((a, b) => a[0].localeCompare(b[0])).map(([key, value]) => {
|
|
2262
2266
|
return `${key}: ${JSON.stringify(value)};`;
|
|
2263
2267
|
}).join("\n")}
|
|
@@ -2266,9 +2270,11 @@ async function generatePerActionDataFiles({
|
|
|
2266
2270
|
}
|
|
2267
2271
|
|
|
2268
2272
|
// Represents a fqn of the action
|
|
2269
|
-
export interface
|
|
2273
|
+
export interface Signatures {
|
|
2270
2274
|
${getDescriptionIfPresent(action.description)}
|
|
2271
|
-
|
|
2275
|
+
applyAction<P extends ${action.paramsIdentifier}, OP extends ApplyActionOptions>(args: P, options?: OP): Promise<ActionReturnTypeForOptions<OP>>;
|
|
2276
|
+
|
|
2277
|
+
batchApplyAction<P extends ReadonlyArray<${action.paramsIdentifier}>, OP extends ApplyBatchActionOptions>(args: P, options?: OP): Promise<ActionReturnTypeForOptions<OP>>;
|
|
2272
2278
|
}
|
|
2273
2279
|
|
|
2274
2280
|
}
|
|
@@ -2279,7 +2285,7 @@ async function generatePerActionDataFiles({
|
|
|
2279
2285
|
export type ${oldParamsIdentifier} = ${action.paramsIdentifier} | ReadonlyArray<${action.paramsIdentifier}>;
|
|
2280
2286
|
|
|
2281
2287
|
/** @deprecated Use \`${action.definitionIdentifier}\` **/
|
|
2282
|
-
export type ${action.shortApiName} = ${action.shortApiName}.
|
|
2288
|
+
export type ${action.shortApiName} = ${action.shortApiName}.Signatures;
|
|
2283
2289
|
`;
|
|
2284
2290
|
}
|
|
2285
2291
|
function createV2Object() {
|